@quantiya/codevibe-core 2.0.76 → 2.0.77
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/dist/index.d.ts +4 -3
- package/dist/index.js +485 -485
- package/dist/local-executor/authority.d.ts +46 -0
- package/dist/local-executor/implementor-argv.d.ts +33 -1
- package/dist/local-executor/index.d.ts +3 -2
- package/dist/local-executor/local-executor-impl.d.ts +1 -0
- package/dist/orchestration-shell/cli.js +694 -126
- package/dist/orchestration-shell/index.d.ts +21 -0
- package/dist/substrate/sandbox-exec.d.ts +6 -1
- package/dist/substrate/types.d.ts +5 -0
- package/dist/substrate-launch/engage-substrate.d.ts +5 -0
- package/package.json +1 -1
|
@@ -58,4 +58,50 @@ export declare function safeReadFile(scope: AuthorityScope, p: string, options?:
|
|
|
58
58
|
*/
|
|
59
59
|
export declare function mergeAuthorityScope(base: AuthorityScope, incoming: AuthorityScope): AuthorityScope;
|
|
60
60
|
export declare function enforceNetwork(scope: AuthorityScope): void;
|
|
61
|
+
/**
|
|
62
|
+
* Normalizes an argv array into canonical forms for security validation:
|
|
63
|
+
* - Splits `--flag=value` into `['--flag', 'value']`
|
|
64
|
+
* - Converts camelCase CLI option names (e.g. `--allowedTools`) to kebab-case (`--allowed-tools`)
|
|
65
|
+
* - Normalizes aliases like `--allow-dangerously-skip-permissions` to `--dangerously-skip-permissions`
|
|
66
|
+
*/
|
|
67
|
+
export declare function normalizeArgv(argv: readonly string[]): string[];
|
|
68
|
+
/**
|
|
69
|
+
* Vendor M8 parser from Claude Code CLI (2.1.306) for permission rules.
|
|
70
|
+
* Accepts bare tool names ("Read", "Grep", "Glob") or tool calls ("Read(//path/**)").
|
|
71
|
+
* Extracts toolName and rawContent without mangling parentheses or commas inside the path.
|
|
72
|
+
*/
|
|
73
|
+
export declare function parseToolRuleM8(rule: string): {
|
|
74
|
+
toolName: string;
|
|
75
|
+
rawContent?: string;
|
|
76
|
+
} | null;
|
|
77
|
+
/**
|
|
78
|
+
* Exact vendor `Bu` tokenizer from Claude Code CLI (2.1.306).
|
|
79
|
+
* Splits allowed-tools CLI arguments by comma or space outside parentheses.
|
|
80
|
+
* Note: uses boolean flag `o` rather than integer depth, so internal parentheses
|
|
81
|
+
* followed by comma or space will split! (R11-F1)
|
|
82
|
+
*/
|
|
83
|
+
export declare function vendorBu(e: readonly string[]): string[];
|
|
84
|
+
/**
|
|
85
|
+
* Parse comma-separated tool rules where target patterns inside parentheses may contain
|
|
86
|
+
* commas, tool names, nested parentheses, spaces, or other characters (R4-F7, R5-F6, R7-F4, R8-F2, R9-F2, R9-F3, R10-F1, R11-F1).
|
|
87
|
+
* Matches Claude Code CLI 2.1.306's vendor `Bu` tokenizer logic.
|
|
88
|
+
* Returns an array of trimmed individual rule strings, or null if syntax is invalid.
|
|
89
|
+
*/
|
|
90
|
+
export declare function parseAllowedToolsRules(value: string | readonly string[]): string[] | null;
|
|
91
|
+
/**
|
|
92
|
+
* Strictly verifies whether an argv is a permitted read-only advisory invocation for Claude.
|
|
93
|
+
* Used by LocalExecutor to enforce confinement on requireConfined advisory turns (R7-F1, R8-F1, R8-F2, R9-F1, R9-F2, R9-F3, R10-F1, R10-F2).
|
|
94
|
+
*/
|
|
95
|
+
export declare function isStrictReadOnlyAdvisoryClaude(argv: readonly string[]): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Extracts and normalizes the config key from a Codex -c or --config argument (R10-F3, R11-F3, R12-F2).
|
|
98
|
+
* Handles -ckey=value, -c=key=value, --config key=value, --config="key=value", quotes, and leading '='.
|
|
99
|
+
*/
|
|
100
|
+
export declare function extractConfigKey(cfg: string): string;
|
|
101
|
+
export declare function isProtectedCodexConfigKey(key: string): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Strictly verifies whether an argv is a permitted read-only advisory invocation for Codex.
|
|
104
|
+
* Used by LocalExecutor to enforce confinement on requireConfined advisory turns (R7-F1, R8-F1, R9-F1, R10-F3, R11-F3, R12-F1, R12-F2).
|
|
105
|
+
*/
|
|
106
|
+
export declare function isStrictReadOnlyAdvisoryCodex(argv: readonly string[]): boolean;
|
|
61
107
|
export declare function enforceCommand(scope: AuthorityScope, argv: string[]): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type AuthorityScope } from './authority';
|
|
2
2
|
import type { AgentKind } from './types';
|
|
3
3
|
/** Read-only "plan" vs write "execute" authority for the implementor. */
|
|
4
4
|
export type ImplementorMode = 'plan' | 'execute';
|
|
@@ -29,6 +29,38 @@ export interface ImplementorArgvPlan {
|
|
|
29
29
|
* because broad advisory turns should have no file-inspection tools at all.
|
|
30
30
|
*/
|
|
31
31
|
export declare function buildClaudeNoToolsPlanArgv(): ImplementorArgvPlan;
|
|
32
|
+
/**
|
|
33
|
+
* Helper to escape literal characters in paths so gitignore-style glob pattern matching
|
|
34
|
+
* does not interpret literal `*`, `?`, `[`, `]` in directory/file names as wildcards (R4-F3).
|
|
35
|
+
*/
|
|
36
|
+
export declare function escapeClaudePathGlob(p: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Helper to format absolute paths for Claude Code CLI permission rules.
|
|
39
|
+
* Claude Code interprets a single leading slash as relative to the primary working directory;
|
|
40
|
+
* filesystem-absolute rules require a double leading slash (`//`).
|
|
41
|
+
*/
|
|
42
|
+
export declare function formatClaudePermissionPath(p: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Preserves exact path glob patterns for Claude Code CLI permission rules (R8-F4, R9-F2).
|
|
45
|
+
* Retained for backwards-compatibility; path permissions are passed via structured `--settings`
|
|
46
|
+
* where rules are preserved verbatim without comma-to-wildcard broadening.
|
|
47
|
+
*/
|
|
48
|
+
export declare function sanitizeClaudeAllowedToolsPattern(p: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* Dedicated plan argv for Claude during read-only advisory turns where repository
|
|
51
|
+
* tools are permitted (R1-F2, R2-F2).
|
|
52
|
+
*
|
|
53
|
+
* Confines Claude strictly to `Read,Grep,Glob` via BOTH `--tools` and `--allowed-tools`.
|
|
54
|
+
* When `workdir` is provided, scopes the allowed read targets explicitly to `workdir`
|
|
55
|
+
* (including its resolved symlink target) and any explicit attachments (R2-F2, R3-F3, R4-F3).
|
|
56
|
+
* Uses filesystem-absolute `//` anchor syntax required by Claude Code CLI (R3-F3).
|
|
57
|
+
* Escapes literal path components (`*`, `?`, `[`, `]`) before appending intentional `/**` wildcards (R4-F3).
|
|
58
|
+
* Enforces `--settings` with `permissions.defaultMode: 'dontAsk'` and scoped `allow` list
|
|
59
|
+
* to remove ambient permissive grants and establish an exclusive read boundary (R3-F2, R4-F2).
|
|
60
|
+
* Enforces `--strict-mcp-config` to eliminate ambient MCP servers from enabling
|
|
61
|
+
* unintended mutations or unconfined execution during advisory turns.
|
|
62
|
+
*/
|
|
63
|
+
export declare function buildClaudeReadOnlyAdvisoryPlanArgv(workdir?: string, attachments?: readonly string[]): ImplementorArgvPlan;
|
|
32
64
|
/**
|
|
33
65
|
* D9 — the ONE shared `CODEVIBE_AGY_MODEL` resolver used by BOTH
|
|
34
66
|
* `buildImplementorArgv` (the spawned argv) and `agyImplementorAllowlistEntries`
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export { AuthorityError, AuthorityRefusal, AuthorityRefusalCategory, AuthorityScope, FileNotFound, enforceCommand, enforceNetwork, enforceRead, enforceWrite, safeReadFile, safeWriteFile, } from './authority';
|
|
1
|
+
export { AuthorityError, AuthorityRefusal, AuthorityRefusalCategory, AuthorityScope, FileNotFound, enforceCommand, enforceNetwork, enforceRead, enforceWrite, parseAllowedToolsRules, parseToolRuleM8, vendorBu, normalizeArgv, isStrictReadOnlyAdvisoryClaude, isStrictReadOnlyAdvisoryCodex, safeReadFile, safeWriteFile, } from './authority';
|
|
2
2
|
export { spawnHealthProbe, spawnImplementor, spawnReviewer } from './spawn';
|
|
3
|
+
export { reapMarkedProcessTree, PROCESS_TREE_MARKER_ENV, type ReapResult, type ReapOptions, } from './descendant-reaper';
|
|
3
4
|
export { AgentKind, AuthorityAction, ClassBInbound, ExecutorError, FailureClass, FileChangeKind, GateDispatchPayload, GateDispatchReviewerSeat, HookEvent, ImplementorHandle, LocalExecutor, MergeGateDispatchPayload, ProbeHandle, ProcessExitedInfo, ProcessRole, ProcessSpawnedInfo, ReviewerHandle, ReviewerDispatchPayload, ReviseFeedbackPayload, ReviseSeatFinding, SignedEnvelope, SpawnArgs, SpawnArgsInvalid, SpawnHandleBase, TaskGroupHaltedPayload, TrackAssignedPayload, TrackConflictContext, } from './types';
|
|
4
|
-
export { agyImplementorAllowlistEntries, agyWorkdirBriefPreamble, AGY_IMPLEMENTOR_PRINT_TIMEOUT, buildImplementorArgv, extractMcpServerConfig, setupAgyWebPlugin, stripAgyWebPlugin, stripClaudeWebArgs, stripCodexWebArgs, IMPLEMENTOR_COMMAND_ALLOWLIST, makeImplementorCommandScope, resolveAgyModel, type ImplementorArgvPlan, type ImplementorCaptureSurface, type ImplementorMode, } from './implementor-argv';
|
|
5
|
+
export { agyImplementorAllowlistEntries, agyWorkdirBriefPreamble, AGY_IMPLEMENTOR_PRINT_TIMEOUT, buildClaudeNoToolsPlanArgv, buildClaudeReadOnlyAdvisoryPlanArgv, escapeClaudePathGlob, formatClaudePermissionPath, sanitizeClaudeAllowedToolsPattern, buildImplementorArgv, extractMcpServerConfig, setupAgyWebPlugin, stripAgyWebPlugin, stripClaudeWebArgs, stripCodexWebArgs, IMPLEMENTOR_COMMAND_ALLOWLIST, makeImplementorCommandScope, resolveAgyModel, type ImplementorArgvPlan, type ImplementorCaptureSurface, type ImplementorMode, } from './implementor-argv';
|
|
5
6
|
export { verifyClassBEd25519, classBCanonicalForSigning, ed25519PublicKeyFromRaw, type ClassBCryptoVerifyResult, } from './class-b-verify';
|
|
6
7
|
export { TrackRegistry, TrackProcess, trackKey } from './track-registry';
|
|
7
8
|
export { EmitShellEventFn, HookBridge, HookBridgeDeps, } from './hook-bridge';
|
|
@@ -112,6 +112,7 @@ export type SubstrateEngager = (input: {
|
|
|
112
112
|
* applies whenever the row cannot be established).
|
|
113
113
|
*/
|
|
114
114
|
requireConfined?: boolean;
|
|
115
|
+
writableWorkdir?: boolean;
|
|
115
116
|
webBrowsingActive?: boolean;
|
|
116
117
|
/** F-P46a-4 — the spawn's process-tree id, folded into the sandbox environment. */
|
|
117
118
|
processTreeId?: string;
|