@piagent/platform 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +7 -0
- package/AGENTS.md +31 -0
- package/CHANGELOG.md +296 -0
- package/CODE_OF_CONDUCT.md +36 -0
- package/CONTRIBUTING.md +66 -0
- package/LICENSE +21 -0
- package/README.md +588 -0
- package/SECURITY.md +38 -0
- package/adapters/backend-api/profile.json +88 -0
- package/adapters/be-readonly-fe/profile.json +120 -0
- package/adapters/data/profile.json +88 -0
- package/adapters/devops/profile.json +92 -0
- package/adapters/docs/profile.json +74 -0
- package/adapters/fullstack/profile.json +94 -0
- package/adapters/generic/profile.json +95 -0
- package/adapters/mobile/profile.json +87 -0
- package/adapters/node-typescript/profile.json +76 -0
- package/adapters/python/profile.json +75 -0
- package/adapters/web-frontend/profile.json +101 -0
- package/catalog/capabilities.json +206 -0
- package/docs/architecture.md +64 -0
- package/docs/auto-delegation-policy.md +192 -0
- package/docs/capability-packs.md +234 -0
- package/docs/command-reference-vietnamese.md +484 -0
- package/docs/context-window-policy.md +85 -0
- package/docs/distribution-standard.md +229 -0
- package/docs/herdr-workflow.md +58 -0
- package/docs/mcp-and-tools.md +316 -0
- package/docs/memory-policy.md +164 -0
- package/docs/model-options.md +165 -0
- package/docs/oauth-providers.md +53 -0
- package/docs/operator-manual-vietnamese.md +1080 -0
- package/docs/package-architecture-notes.md +101 -0
- package/docs/project-adapters.md +174 -0
- package/docs/project-onboarding.md +135 -0
- package/docs/publishing-for-teams.md +64 -0
- package/docs/quality-benchmark.md +74 -0
- package/docs/quickstart-vietnamese.md +350 -0
- package/docs/release-install-policy.md +223 -0
- package/docs/runtime-harness-standard.md +118 -0
- package/docs/runtime-policy-design.md +132 -0
- package/docs/runtime-quality-baseline.md +257 -0
- package/docs/security-redaction-benchmark.md +56 -0
- package/docs/security-threat-model.md +66 -0
- package/docs/subagent-orchestration-capabilities.md +104 -0
- package/docs/subagents-and-multiagent.md +346 -0
- package/docs/task-implementation-contract.md +200 -0
- package/docs/team-onboarding.md +333 -0
- package/docs/usage-observability.md +130 -0
- package/docs/vercel-docs-site.md +115 -0
- package/docs/workflow-recipes.md +125 -0
- package/docs-site/assets/piagent-logo.svg +35 -0
- package/docs-site/favicon.svg +18 -0
- package/docs-site/index.html +1613 -0
- package/docs-site/vercel.json +24 -0
- package/evals/fixtures/action-proposal.invalid.json +34 -0
- package/evals/fixtures/action-proposal.valid.json +34 -0
- package/evals/fixtures/capability-pack.invalid.json +123 -0
- package/evals/fixtures/capability-pack.valid.json +123 -0
- package/evals/fixtures/capability-recipe.invalid.json +81 -0
- package/evals/fixtures/capability-recipe.valid.json +82 -0
- package/evals/fixtures/context-index.invalid.json +25 -0
- package/evals/fixtures/context-index.valid.json +25 -0
- package/evals/fixtures/eval-scenario.invalid.json +40 -0
- package/evals/fixtures/eval-scenario.valid.json +45 -0
- package/evals/fixtures/project-profile.invalid.json +88 -0
- package/evals/fixtures/project-profile.valid.json +95 -0
- package/evals/fixtures/task-contract.invalid.json +73 -0
- package/evals/fixtures/task-contract.valid.json +74 -0
- package/evals/golden/enforcement-decisions.json +329 -0
- package/evals/scenarios/capability-resolution.json +45 -0
- package/package.json +132 -0
- package/packages/piagent-core/README.md +147 -0
- package/packages/piagent-core/capabilities/capability-core.js +1023 -0
- package/packages/piagent-core/capabilities/capability-sources.js +265 -0
- package/packages/piagent-core/extensions/guard-io.js +45 -0
- package/packages/piagent-core/extensions/guard-shell-analysis.ts +558 -0
- package/packages/piagent-core/extensions/guard-types.ts +406 -0
- package/packages/piagent-core/extensions/piagent-guard.ts +5760 -0
- package/packages/piagent-core/extensions/policy-core.js +1070 -0
- package/packages/piagent-core/extensions/redaction-core.js +4 -0
- package/packages/piagent-core/extensions/runtime-evidence.js +215 -0
- package/packages/piagent-core/package.json +46 -0
- package/packages/piagent-core/policies/base-policy.json +249 -0
- package/packages/piagent-core/prompts/be-to-fe.md +82 -0
- package/packages/piagent-core/prompts/commit.md +27 -0
- package/packages/piagent-core/prompts/discuss.md +35 -0
- package/packages/piagent-core/prompts/memory-policy.md +52 -0
- package/packages/piagent-core/prompts/model-options.md +68 -0
- package/packages/piagent-core/prompts/onboard-project.md +147 -0
- package/packages/piagent-core/prompts/piagent-commands.md +68 -0
- package/packages/piagent-core/prompts/plan.md +35 -0
- package/packages/piagent-core/prompts/platform-improve.md +69 -0
- package/packages/piagent-core/prompts/pr.md +26 -0
- package/packages/piagent-core/prompts/review.md +38 -0
- package/packages/piagent-core/prompts/scout.md +50 -0
- package/packages/piagent-core/prompts/task.md +69 -0
- package/packages/piagent-core/security/sensitive-data.js +187 -0
- package/packages/piagent-core/skills/piagent-ops/SKILL.md +44 -0
- package/packages/piagent-core/skills/piagent-source-cache/SKILL.md +59 -0
- package/packages/piagent-core/skills/piagent-source-cache/checkout-source-repo.sh +144 -0
- package/packages/piagent-core/subagents/piagent-oracle.md +29 -0
- package/packages/piagent-core/subagents/piagent-planner.md +46 -0
- package/packages/piagent-core/subagents/piagent-reviewer.md +48 -0
- package/packages/piagent-core/subagents/piagent-scout.md +37 -0
- package/packages/piagent-core/subagents/piagent-worker.md +44 -0
- package/packs/engineering-base/pack.json +123 -0
- package/packs/engineering-base/recipes/bounded-change.json +82 -0
- package/packs/web-delivery/pack.json +72 -0
- package/packs/web-delivery/recipes/verified-web-change.json +57 -0
- package/schemas/action-proposal.schema.json +90 -0
- package/schemas/capability-pack.schema.json +190 -0
- package/schemas/capability-recipe.schema.json +72 -0
- package/schemas/context-index.schema.json +258 -0
- package/schemas/eval-scenario.schema.json +67 -0
- package/schemas/project-profile.schema.json +555 -0
- package/schemas/task-contract.schema.json +314 -0
- package/scripts/audit-runtime-host.sh +78 -0
- package/scripts/bootstrap-local.sh +25 -0
- package/scripts/capability-catalog.mjs +290 -0
- package/scripts/check-runtime-advisories.mjs +114 -0
- package/scripts/configure-mcp.sh +301 -0
- package/scripts/configure-model-scope.sh +143 -0
- package/scripts/configure-subagents.sh +241 -0
- package/scripts/import-agent-instructions.mjs +199 -0
- package/scripts/init-project.sh +369 -0
- package/scripts/install-global.sh +532 -0
- package/scripts/link-project.sh +25 -0
- package/scripts/migrate-project-state.mjs +176 -0
- package/scripts/pi-auto.sh +79 -0
- package/scripts/pi-model-catalog.sh +154 -0
- package/scripts/pi-session-stats.sh +135 -0
- package/scripts/piagent-cli.mjs +53 -0
- package/scripts/profile-doctor.sh +238 -0
- package/scripts/quality-benchmark.sh +185 -0
- package/scripts/redaction-benchmark.mjs +227 -0
- package/scripts/runtime-policy-smoke.sh +48 -0
- package/scripts/setup.sh +425 -0
- package/scripts/team-doctor.sh +461 -0
- package/scripts/verify-local.sh +540 -0
- package/scripts/verify-release-identity.mjs +85 -0
- package/scripts/verify-vercel-link.mjs +64 -0
- package/templates/global/mcp.json +9 -0
- package/templates/global/settings.json +37 -0
- package/templates/project/.mcp.json +9 -0
- package/templates/project/.pi/context-index.json +25 -0
- package/templates/project/.pi/gitignore.template +22 -0
- package/templates/project/.pi/mcp.json +9 -0
- package/templates/project/.pi/memory/MEMORY.md +11 -0
- package/templates/project/.pi/memory/memory_summary.md +9 -0
- package/templates/project/.pi/piagent-profile.json +107 -0
- package/templates/project/.pi/project-context.md +30 -0
- package/templates/project/.pi/settings.json +17 -0
- package/templates/project/.pi/task-contract.template.json +74 -0
- package/templates/project/.pi/tech-context/README.md +7 -0
- package/templates/project/.pi/tech-stack.json +10 -0
- package/templates/project/AGENTS.md +34 -0
- package/templates/project/REVIEW_GUIDELINES.md +23 -0
- package/types/pi-runtime-shims.d.ts +13 -0
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
// Shared shapes for the guard and its domain modules.
|
|
2
|
+
// Types only: no runtime values, so importing this cannot introduce a cycle.
|
|
3
|
+
|
|
4
|
+
export type ProjectProfile = {
|
|
5
|
+
schemaVersion?: number;
|
|
6
|
+
projectId?: string;
|
|
7
|
+
displayName?: string;
|
|
8
|
+
mode?: string;
|
|
9
|
+
permissionProfile?: PermissionProfileMode;
|
|
10
|
+
protectedPaths?: string[];
|
|
11
|
+
shellProtectedPaths?: string[];
|
|
12
|
+
readOnlyPaths?: string[];
|
|
13
|
+
requiredContext?: string[];
|
|
14
|
+
verifyCommands?: Record<string, string[]>;
|
|
15
|
+
mcpCapabilities?: string[];
|
|
16
|
+
capabilityPacks?: Array<{ name: string; version: string }>;
|
|
17
|
+
capabilityPolicy?: {
|
|
18
|
+
allowedOwners?: string[];
|
|
19
|
+
allowedLifecycles?: Array<"experimental" | "stable" | "deprecated">;
|
|
20
|
+
allowedFilesystemRead?: string[];
|
|
21
|
+
allowedFilesystemWrite?: string[];
|
|
22
|
+
allowedNetworkDomains?: string[];
|
|
23
|
+
allowedExternalActions?: string[];
|
|
24
|
+
};
|
|
25
|
+
memory?: MemorySettings;
|
|
26
|
+
contextIndex?: ContextIndexSettings;
|
|
27
|
+
runtimePolicy?: RuntimePolicySettings;
|
|
28
|
+
orchestration?: OrchestrationPolicySettings;
|
|
29
|
+
techStack?: ProjectTechStackReference;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export type MemorySettings = {
|
|
33
|
+
enabled?: boolean;
|
|
34
|
+
mode?: "off" | "manual" | "assisted" | "external-package";
|
|
35
|
+
scope?: "project" | "global" | "hybrid";
|
|
36
|
+
summaryFile?: string;
|
|
37
|
+
handbookFile?: string;
|
|
38
|
+
localDir?: string;
|
|
39
|
+
readBeforeTask?: boolean;
|
|
40
|
+
writePolicy?: "explicit-only" | "task-trace" | "session-summary";
|
|
41
|
+
maxInjectedChars?: number;
|
|
42
|
+
externalPackages?: string[];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export type RuntimePolicySettings = {
|
|
46
|
+
execPolicy?: "off" | "advisory" | "enforce";
|
|
47
|
+
contextBudget?: "off" | "advisory" | "enforce";
|
|
48
|
+
toolRegistry?: "off" | "advisory" | "enforce";
|
|
49
|
+
finalGate?: "off" | "advisory" | "enforce";
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export type ContextIndexSettings = {
|
|
53
|
+
enabled?: boolean;
|
|
54
|
+
path?: string;
|
|
55
|
+
writePolicy?: "onboarding-record" | "approved-workflow" | "off";
|
|
56
|
+
requireCitations?: boolean;
|
|
57
|
+
maxNodes?: number;
|
|
58
|
+
maxEdges?: number;
|
|
59
|
+
includeTechStack?: boolean;
|
|
60
|
+
includeMemoryPointers?: boolean;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export type ContextIndexNodeKind = "profile" | "tech" | "module" | "command" | "doc" | "decision" | "risk" | "memory" | "task" | "verify" | "context";
|
|
64
|
+
|
|
65
|
+
export type ContextIndexEdgeKind = "uses_tech" | "depends_on" | "verified_by" | "protected_by" | "documented_by" | "derived_from" | "updates" | "relates_to";
|
|
66
|
+
|
|
67
|
+
export type ContextIndexCitation = {
|
|
68
|
+
path?: string;
|
|
69
|
+
reason?: string;
|
|
70
|
+
url?: string;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export type ContextIndexNode = {
|
|
74
|
+
id: string;
|
|
75
|
+
kind: ContextIndexNodeKind;
|
|
76
|
+
label: string;
|
|
77
|
+
summary?: string;
|
|
78
|
+
path?: string;
|
|
79
|
+
tags?: string[];
|
|
80
|
+
citations?: ContextIndexCitation[];
|
|
81
|
+
updatedAt?: string;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export type ContextIndexEdge = {
|
|
85
|
+
from: string;
|
|
86
|
+
to: string;
|
|
87
|
+
kind: ContextIndexEdgeKind;
|
|
88
|
+
reason?: string;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export type ProjectContextIndex = {
|
|
92
|
+
schemaVersion: 1;
|
|
93
|
+
projectId?: string;
|
|
94
|
+
profileMode?: string;
|
|
95
|
+
source: "onboarding-record" | "approved-workflow" | "manual";
|
|
96
|
+
summary: string;
|
|
97
|
+
generatedAt: string;
|
|
98
|
+
updatedAt: string;
|
|
99
|
+
policy: Required<ContextIndexSettings>;
|
|
100
|
+
nodes: ContextIndexNode[];
|
|
101
|
+
edges: ContextIndexEdge[];
|
|
102
|
+
citations: ContextIndexCitation[];
|
|
103
|
+
warnings: string[];
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export type TechRole = "frontend" | "backend" | "database" | "mobile" | "devops" | "data" | "docs" | "runtime";
|
|
107
|
+
|
|
108
|
+
export type ProjectTechStackReference = {
|
|
109
|
+
provider?: "context7";
|
|
110
|
+
manifest?: string;
|
|
111
|
+
contextDir?: string;
|
|
112
|
+
roles?: Partial<Record<TechRole, string[]>>;
|
|
113
|
+
updatedAt?: string;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
export type TechOption = {
|
|
117
|
+
id: string;
|
|
118
|
+
label: string;
|
|
119
|
+
role: TechRole;
|
|
120
|
+
description: string;
|
|
121
|
+
context7Query?: string;
|
|
122
|
+
topics: string[];
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export type TechStackEntry = {
|
|
126
|
+
id: string;
|
|
127
|
+
label: string;
|
|
128
|
+
role: TechRole;
|
|
129
|
+
description: string;
|
|
130
|
+
context7: {
|
|
131
|
+
provider: "context7";
|
|
132
|
+
query: string;
|
|
133
|
+
status: "pending" | "recorded";
|
|
134
|
+
contextFile: string;
|
|
135
|
+
resolvedLibraryId?: string;
|
|
136
|
+
retrievedAt?: string;
|
|
137
|
+
digest?: string;
|
|
138
|
+
};
|
|
139
|
+
topics: string[];
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export type TechStackManifest = {
|
|
143
|
+
schemaVersion: 1;
|
|
144
|
+
provider: "context7";
|
|
145
|
+
profile: string;
|
|
146
|
+
roles: Partial<Record<TechRole, string[]>>;
|
|
147
|
+
selected: TechStackEntry[];
|
|
148
|
+
skippedRoles?: TechRole[];
|
|
149
|
+
contextDir: string;
|
|
150
|
+
createdAt: string;
|
|
151
|
+
updatedAt: string;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
export type TechContextSnapshot = {
|
|
155
|
+
schemaVersion: 1;
|
|
156
|
+
provider: "context7";
|
|
157
|
+
status: "pending" | "recorded";
|
|
158
|
+
techId: string;
|
|
159
|
+
role: TechRole;
|
|
160
|
+
query: string;
|
|
161
|
+
resolvedLibraryId?: string;
|
|
162
|
+
topics?: string[];
|
|
163
|
+
retrievedAt?: string;
|
|
164
|
+
summary?: string;
|
|
165
|
+
keyRules: string[];
|
|
166
|
+
citations: Array<{ title?: string; url?: string; source?: string }>;
|
|
167
|
+
digest?: string;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export type OrchestrationMode = "solo-first" | "bounded-subagents" | "parallel-readonly";
|
|
171
|
+
|
|
172
|
+
export type ReviewLens = "correctness" | "tests" | "scope" | "security" | "docs" | "release" | "package";
|
|
173
|
+
|
|
174
|
+
export type OrchestrationRole = "parent" | "piagent-scout" | "piagent-planner" | "piagent-worker" | "piagent-reviewer" | "piagent-oracle";
|
|
175
|
+
|
|
176
|
+
export type WorkPlanStep = {
|
|
177
|
+
id: string;
|
|
178
|
+
title: string;
|
|
179
|
+
role: OrchestrationRole;
|
|
180
|
+
mode: "read-only" | "single-writer" | "review";
|
|
181
|
+
status: "pending" | "in-progress" | "done" | "skipped";
|
|
182
|
+
dependsOn?: string[];
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export type OrchestrationPolicySettings = {
|
|
186
|
+
defaultMode?: OrchestrationMode;
|
|
187
|
+
maxConcurrentSubagents?: number;
|
|
188
|
+
defaultReviewLenses?: ReviewLens[];
|
|
189
|
+
roleModelGuidance?: Partial<Record<"planner" | "worker" | "reviewer" | "watchdog", string>>;
|
|
190
|
+
fieldGuide?: {
|
|
191
|
+
enabled?: boolean;
|
|
192
|
+
path?: string;
|
|
193
|
+
maxLines?: number;
|
|
194
|
+
writePolicy?: "explicit-only" | "approved-workflow";
|
|
195
|
+
readBeforeTask?: boolean;
|
|
196
|
+
};
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export type ResolvedOrchestrationPolicy = {
|
|
200
|
+
defaultMode: OrchestrationMode;
|
|
201
|
+
maxConcurrentSubagents: number;
|
|
202
|
+
defaultReviewLenses: ReviewLens[];
|
|
203
|
+
roleModelGuidance: Record<"planner" | "worker" | "reviewer" | "watchdog", string>;
|
|
204
|
+
fieldGuide: {
|
|
205
|
+
enabled: boolean;
|
|
206
|
+
path: string;
|
|
207
|
+
maxLines: number;
|
|
208
|
+
writePolicy: "explicit-only" | "approved-workflow";
|
|
209
|
+
readBeforeTask: boolean;
|
|
210
|
+
};
|
|
211
|
+
rules: string[];
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
export type PermissionProfileMode = "read-only" | "workspace-write" | "trusted-full-access";
|
|
215
|
+
|
|
216
|
+
export type PermissionProfilesConfig = {
|
|
217
|
+
defaultMode?: PermissionProfileMode;
|
|
218
|
+
allowedModes?: PermissionProfileMode[];
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
export type ResolvedPermissionProfile = {
|
|
222
|
+
mode: PermissionProfileMode;
|
|
223
|
+
source: "env" | "command" | "profile" | "default" | "invalid-env" | "invalid-profile" | "policy-fallback";
|
|
224
|
+
requested?: string;
|
|
225
|
+
warning?: string;
|
|
226
|
+
runtimeEquivalent: string;
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export type ProfileOption = {
|
|
230
|
+
name: string;
|
|
231
|
+
displayName?: string;
|
|
232
|
+
mode?: string;
|
|
233
|
+
description: string;
|
|
234
|
+
recommended: boolean;
|
|
235
|
+
reason: string;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
export type ProjectOnboardingSnapshot = {
|
|
239
|
+
schemaVersion: 1;
|
|
240
|
+
projectId?: string;
|
|
241
|
+
profileMode?: string;
|
|
242
|
+
contextFile: string;
|
|
243
|
+
summary: string;
|
|
244
|
+
model?: string;
|
|
245
|
+
sourceFiles: Array<{ path: string; reason: string }>;
|
|
246
|
+
updateTriggers: string[];
|
|
247
|
+
notes?: string;
|
|
248
|
+
recordedAt: string;
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
export type TaskContract = {
|
|
252
|
+
taskId: string;
|
|
253
|
+
summary: string;
|
|
254
|
+
riskLane: "tiny" | "normal" | "high-risk";
|
|
255
|
+
expectedOutput: string;
|
|
256
|
+
acceptanceCriteria: string[];
|
|
257
|
+
scope: string[];
|
|
258
|
+
outOfScope: string[];
|
|
259
|
+
protectedPaths: string[];
|
|
260
|
+
requiredContext: string[];
|
|
261
|
+
contextManifest: Array<{ path: string; reason: string }>;
|
|
262
|
+
memoryCitations: Array<{ path: string; reason: string }>;
|
|
263
|
+
mcpCapabilities: string[];
|
|
264
|
+
verifyCommands: string[];
|
|
265
|
+
workPlan?: WorkPlanStep[];
|
|
266
|
+
reviewLenses?: ReviewLens[];
|
|
267
|
+
orchestration?: {
|
|
268
|
+
mode: OrchestrationMode;
|
|
269
|
+
subagents: "not-used" | "optional" | "used";
|
|
270
|
+
reason: string;
|
|
271
|
+
fieldGuidePath?: string;
|
|
272
|
+
modelRoles?: Record<"planner" | "worker" | "reviewer" | "watchdog", string>;
|
|
273
|
+
};
|
|
274
|
+
changedFiles: string[];
|
|
275
|
+
verifyEvidence: Array<{
|
|
276
|
+
command: string;
|
|
277
|
+
exitCode: number;
|
|
278
|
+
summary: string;
|
|
279
|
+
recordedAt: string;
|
|
280
|
+
observed?: boolean;
|
|
281
|
+
observedAt?: string;
|
|
282
|
+
isError?: boolean;
|
|
283
|
+
matchedProfileCommand?: boolean;
|
|
284
|
+
}>;
|
|
285
|
+
trace: {
|
|
286
|
+
outcome: "pending" | "completed" | "blocked" | "partial" | "failed";
|
|
287
|
+
friction?: string;
|
|
288
|
+
notes?: string;
|
|
289
|
+
recordedAt?: string;
|
|
290
|
+
};
|
|
291
|
+
createdAt: string;
|
|
292
|
+
updatedAt: string;
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
export type BasePolicy = {
|
|
296
|
+
protectedPaths: string[];
|
|
297
|
+
shellProtectedPaths?: string[];
|
|
298
|
+
blockedCommandPatterns: string[];
|
|
299
|
+
requireConfirmationPatterns: string[];
|
|
300
|
+
defaultRequiredContext: string[];
|
|
301
|
+
permissionProfiles?: PermissionProfilesConfig;
|
|
302
|
+
execPolicy?: ExecPolicyConfig;
|
|
303
|
+
contextBudget?: ContextBudgetConfig;
|
|
304
|
+
toolRegistry?: ToolRegistryConfig;
|
|
305
|
+
finalGate?: FinalGateConfig;
|
|
306
|
+
externalActionPolicy?: ExternalActionPolicyConfig;
|
|
307
|
+
orchestrationPolicy?: OrchestrationPolicySettings;
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
export type CommandRule = {
|
|
311
|
+
id: string;
|
|
312
|
+
action: "allow" | "prompt" | "forbid";
|
|
313
|
+
match: "prefix" | "contains" | "regex";
|
|
314
|
+
value: string | string[];
|
|
315
|
+
reason: string;
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
export type ExecPolicyConfig = {
|
|
319
|
+
defaultMode?: "advisory" | "enforce";
|
|
320
|
+
bannedPrefixSuggestions?: string[][];
|
|
321
|
+
rules?: CommandRule[];
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
export type ContextBudgetConfig = {
|
|
325
|
+
defaultMode?: "advisory" | "enforce";
|
|
326
|
+
maxContextFileChars?: number;
|
|
327
|
+
maxMemoryFileChars?: number;
|
|
328
|
+
maxManifestFiles?: number;
|
|
329
|
+
warnFragmentChars?: number;
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
export type ToolRegistryConfig = {
|
|
333
|
+
defaultMode?: "advisory" | "enforce";
|
|
334
|
+
alwaysAllowedTools?: string[];
|
|
335
|
+
toolCapabilities?: Record<string, string[]>;
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
export type ExternalActionPolicyConfig = {
|
|
339
|
+
defaultMode?: "advisory" | "enforce";
|
|
340
|
+
providerKeywords?: string[];
|
|
341
|
+
writeVerbs?: string[];
|
|
342
|
+
safeVerbs?: string[];
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
export type FinalGateConfig = {
|
|
346
|
+
defaultMode?: "advisory" | "enforce";
|
|
347
|
+
requireTaskContract?: boolean;
|
|
348
|
+
requireContextManifest?: boolean;
|
|
349
|
+
requireVerifyEvidence?: boolean;
|
|
350
|
+
requireTrace?: boolean;
|
|
351
|
+
requirePassingVerify?: boolean;
|
|
352
|
+
};
|
|
353
|
+
|
|
354
|
+
export type EffectiveProtectedPaths = {
|
|
355
|
+
readProtectedPaths: string[];
|
|
356
|
+
writeProtectedPaths: string[];
|
|
357
|
+
shellProtectedPaths: string[];
|
|
358
|
+
readOnlyPaths: string[];
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
export type UsageSnapshot = {
|
|
362
|
+
sessionFile?: string;
|
|
363
|
+
sessionId?: string;
|
|
364
|
+
sessionName?: string;
|
|
365
|
+
cwd: string;
|
|
366
|
+
mode: string;
|
|
367
|
+
model: string;
|
|
368
|
+
thinkingLevel: string;
|
|
369
|
+
entries: {
|
|
370
|
+
total: number;
|
|
371
|
+
branch: number;
|
|
372
|
+
};
|
|
373
|
+
contextUsage?: {
|
|
374
|
+
tokens: number | null;
|
|
375
|
+
contextWindow: number;
|
|
376
|
+
percent: number | null;
|
|
377
|
+
};
|
|
378
|
+
exactTotals: {
|
|
379
|
+
availableInCommand: false;
|
|
380
|
+
howToRead: string[];
|
|
381
|
+
};
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
export type ContextPreflight = {
|
|
385
|
+
workflow: string;
|
|
386
|
+
inputChars: number;
|
|
387
|
+
inputTokenEstimate: number;
|
|
388
|
+
liveContext?: UsageSnapshot["contextUsage"];
|
|
389
|
+
projectedContext?: {
|
|
390
|
+
tokens: number;
|
|
391
|
+
percent: number;
|
|
392
|
+
};
|
|
393
|
+
recommendation: "ok" | "watch" | "compact" | "fresh-session" | "unknown";
|
|
394
|
+
reason: string;
|
|
395
|
+
commands: string[];
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
export type ReferenceRepo = {
|
|
399
|
+
host: string;
|
|
400
|
+
owner: string;
|
|
401
|
+
repo: string;
|
|
402
|
+
cloneUrl: string;
|
|
403
|
+
checkoutPath: string;
|
|
404
|
+
commit?: string;
|
|
405
|
+
fetched: boolean;
|
|
406
|
+
};
|