init
Everything exported by guardlink/init, from the .d.ts files published in guardlink@2.0.0. See the entry points for the other subpaths, and use guardlink as a library for worked examples.
Interfaces
Section titled “Interfaces”InitOptions
Section titled “InitOptions”Properties
Section titled “Properties”InitResult
Section titled “InitResult”Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
created |
string[] |
- |
preserved |
string[] |
Files --force declined to overwrite because they hold authored content (D24). Distinct from skipped, which is the ordinary “exists, not forcing” case: an entry here means the user asked for an overwrite and did not get one, so callers are expected to say so loudly. |
project |
ProjectInfo |
- |
skipped |
string[] |
- |
updated |
string[] |
- |
SyncOptions
Section titled “SyncOptions”Properties
Section titled “Properties”| Property | Type |
|---|---|
dryRun? |
boolean |
model |
ThreatModel | null |
root |
string |
SyncResult
Section titled “SyncResult”Properties
Section titled “Properties”| Property | Type |
|---|---|
skipped |
string[] |
updated |
string[] |
Variables
Section titled “Variables”AGENT_CHOICES
Section titled “AGENT_CHOICES”
constAGENT_CHOICES:AgentChoice[]
Functions
Section titled “Functions”initProject()
Section titled “initProject()”initProject(
options):InitResult
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
InitOptions |
Returns
Section titled “Returns”promptAgentSelection()
Section titled “promptAgentSelection()”promptAgentSelection(
agentFiles):Promise<string[]>
Show detection-aware prompt. Displays:
- Always-created files
- Auto-detected agents (from directory presence)
- Optional agents user can add
Returns combined list of agent IDs (detected + user-selected).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
agentFiles |
AgentFile[] |
Returns
Section titled “Returns”Promise<string[]>
resolveAgentFiles()
Section titled “resolveAgentFiles()”resolveAgentFiles(
agentIds):AgentChoice[]
Resolve agent IDs (from picker or flags) to file paths.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
agentIds |
string[] |
Returns
Section titled “Returns”AgentChoice[]
syncAgentFiles()
Section titled “syncAgentFiles()”syncAgentFiles(
options):SyncResult
Regenerate ALL agent instruction files with live threat model context. Called after parse/validate/annotate to keep instructions up to date. Uses marker-based replacement so user content outside markers is preserved.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
SyncOptions |
Returns
Section titled “Returns”References
Section titled “References”AgentFile
Section titled “AgentFile”Re-exports AgentFile
detectProject
Section titled “detectProject”Re-exports detectProject
ProjectInfo
Section titled “ProjectInfo”Re-exports ProjectInfo

