@quantiya/codevibe-core 2.0.5 → 2.0.7
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/README.md +7 -5
- package/dist/agy-cli-contract.d.ts +14 -0
- package/dist/appsync/appsync-client.d.ts +59 -31
- package/dist/appsync/event-throttle.d.ts +33 -0
- package/dist/appsync/index.d.ts +3 -2
- package/dist/appsync/queries.d.ts +4 -2
- package/dist/auth/auth-telemetry.d.ts +26 -0
- package/dist/auth/vendor-key-cli.d.ts +49 -0
- package/dist/companion-mode/index.d.ts +36 -22
- package/dist/companion-mode/persist-preference.d.ts +1 -5
- package/dist/companion-mode/resolve-agent.d.ts +5 -4
- package/dist/config/config.d.ts +0 -5
- package/dist/credential-broker/__tests__/upstream-result-helpers.d.ts +21 -0
- package/dist/credential-broker/broker.d.ts +196 -12
- package/dist/credential-broker/chatgpt-config.d.ts +40 -0
- package/dist/credential-broker/index.d.ts +4 -1
- package/dist/credential-broker/oauth-account-lock.d.ts +104 -0
- package/dist/credential-broker/oauth-refresh.d.ts +72 -0
- package/dist/credential-broker/types.d.ts +165 -17
- package/dist/credential-broker/upstream-client.d.ts +3 -2
- package/dist/credential-broker/vendor-key-store.d.ts +32 -1
- package/dist/crypto/__tests__/encrypt-for-emit.test.d.ts +1 -0
- package/dist/crypto/encrypt-for-emit.d.ts +39 -0
- package/dist/crypto/index.d.ts +2 -0
- package/dist/daemon/__tests__/process-guards.test.d.ts +1 -0
- package/dist/daemon/index.d.ts +2 -0
- package/dist/daemon/process-guards.d.ts +38 -0
- package/dist/index.d.ts +17 -2
- package/dist/index.js +308 -281
- package/dist/keychain/keychain-manager.d.ts +25 -4
- package/dist/local-executor/__tests__/reviewer-rationale-flag.test.d.ts +1 -0
- package/dist/local-executor/class-a-sign.d.ts +15 -0
- package/dist/local-executor/group-decision-outcome.d.ts +11 -0
- package/dist/local-executor/implementor-argv.d.ts +89 -7
- package/dist/local-executor/local-executor-impl.d.ts +18 -7
- package/dist/local-executor/merge-conflict-resolve.d.ts +19 -0
- package/dist/local-executor/revert-reconcile.d.ts +12 -0
- package/dist/local-executor/reviewer-rationale-flag.d.ts +10 -0
- package/dist/local-executor/types.d.ts +1 -0
- package/dist/local-model/manager.d.ts +1 -1
- package/dist/local-model/ollama.d.ts +40 -0
- package/dist/orchestration/__tests__/detect-agents.test.d.ts +1 -0
- package/dist/orchestration/detect-agents.d.ts +10 -30
- package/dist/orchestration/index.d.ts +1 -2
- package/dist/orchestration-shell/__tests__/a1a-planner-offers.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/a6-cli-surface.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/advisory-attachments-dir-race.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/advisory-multi-mention-panel.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/advisory-panel-attachments.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/advisory-quota-stdout-result.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/agent-turn-context-batch.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/bounded-shutdown.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/brainstorm-quorum-wiring.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/brainstorm-quorum.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cli-team-session-key.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/command-intent.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/context-compaction.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/context-items-hosted-sync.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/context-items-wiring.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/context-items.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cp8-full-team-events.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/cp8-team-decomposed-zk.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/explicit-tty-exit.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/mention-suggest.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/route-browse-summarize-recovery.test.d.ts +1 -0
- package/dist/orchestration-shell/attachments.d.ts +58 -2
- package/dist/orchestration-shell/bounded-shutdown.d.ts +16 -0
- package/dist/orchestration-shell/brainstorm-quorum.d.ts +118 -0
- package/dist/orchestration-shell/cli.d.ts +97 -70
- package/dist/orchestration-shell/cli.js +30990 -22426
- package/dist/orchestration-shell/command-intent.d.ts +56 -0
- package/dist/orchestration-shell/components/InputBar.d.ts +6 -0
- package/dist/orchestration-shell/components/OrchestrationApp.d.ts +2 -0
- package/dist/orchestration-shell/context-compaction.d.ts +264 -0
- package/dist/orchestration-shell/context-items-hosted-sync.d.ts +19 -0
- package/dist/orchestration-shell/context-items.d.ts +408 -0
- package/dist/orchestration-shell/context-store.d.ts +162 -0
- package/dist/orchestration-shell/emit-shell-event.d.ts +34 -13
- package/dist/orchestration-shell/explicit-tty-exit.d.ts +18 -0
- package/dist/orchestration-shell/gate-prompts.d.ts +3 -3
- package/dist/orchestration-shell/index.d.ts +306 -37
- package/dist/orchestration-shell/mention-suggest.d.ts +11 -0
- package/dist/orchestration-shell/mode-selection.d.ts +4 -22
- package/dist/orchestration-shell/quorum-loop.d.ts +336 -20
- package/dist/orchestration-shell/task-progress.d.ts +2 -0
- package/dist/orchestration-shell/team-decompose.d.ts +37 -19
- package/dist/orchestration-shell/types.d.ts +71 -4
- package/dist/planner/index.d.ts +1 -1
- package/dist/planner/local-advisory.d.ts +12 -0
- package/dist/planner/local-gemma.d.ts +27 -0
- package/dist/planner/types.d.ts +7 -0
- package/dist/reviewer/index.d.ts +0 -2
- package/dist/reviewer/provider.d.ts +9 -6
- package/dist/reviewer/providers/antigravity.d.ts +2 -3
- package/dist/reviewer/registry.d.ts +9 -4
- package/dist/reviewer/token-usage.d.ts +10 -0
- package/dist/session/__tests__/device-registration-lease.test.d.ts +1 -0
- package/dist/session/__tests__/pending-session-create.test.d.ts +1 -0
- package/dist/session/__tests__/session-rekey-fingerprint.test.d.ts +1 -0
- package/dist/session/__tests__/session-resume-key-reconciliation.test.d.ts +1 -0
- package/dist/session/__tests__/session-resume-pending-first.test.d.ts +1 -0
- package/dist/session/device-key-watcher.d.ts +1 -0
- package/dist/session/index.d.ts +4 -2
- package/dist/session/pending-session-create.d.ts +61 -0
- package/dist/session/register-device-key.d.ts +11 -1
- package/dist/session/session-rekey.d.ts +4 -5
- package/dist/session/session-resume.d.ts +21 -1
- package/dist/substrate/docker.d.ts +7 -0
- package/dist/substrate/sandbox-exec.d.ts +17 -3
- package/dist/substrate/types.d.ts +32 -3
- package/dist/substrate-launch/apikey-bootstrap.d.ts +24 -1
- package/dist/substrate-launch/engage-substrate.d.ts +17 -0
- package/dist/substrate-launch/sanitized-env.d.ts +5 -5
- package/dist/tool-activity/__tests__/consolidator.test.d.ts +1 -0
- package/dist/tool-activity/__tests__/digest.test.d.ts +1 -0
- package/dist/tool-activity/__tests__/flock-rollout-lock.test.d.ts +1 -0
- package/dist/tool-activity/__tests__/ledger.test.d.ts +1 -0
- package/dist/tool-activity/__tests__/outbox.test.d.ts +1 -0
- package/dist/tool-activity/__tests__/replay-cursor.test.d.ts +1 -0
- package/dist/tool-activity/__tests__/session-map.test.d.ts +1 -0
- package/dist/tool-activity/__tests__/socket-rollout-lock.test.d.ts +1 -0
- package/dist/tool-activity/atomic-file.d.ts +27 -0
- package/dist/tool-activity/consolidator.d.ts +253 -0
- package/dist/tool-activity/digest.d.ts +4 -0
- package/dist/tool-activity/flock-rollout-lock.d.ts +68 -0
- package/dist/tool-activity/index.d.ts +9 -0
- package/dist/tool-activity/ledger.d.ts +274 -0
- package/dist/tool-activity/outbox.d.ts +60 -0
- package/dist/tool-activity/replay-cursor.d.ts +156 -0
- package/dist/tool-activity/session-map.d.ts +133 -0
- package/dist/tool-activity/socket-rollout-lock.d.ts +57 -0
- package/dist/tool-activity/types.d.ts +368 -0
- package/dist/types/encryption.d.ts +4 -0
- package/dist/types/events.d.ts +24 -4
- package/dist/types/session.d.ts +32 -2
- package/package.json +6 -5
- package/dist/orchestration/orchestration-cli.d.ts +0 -12
- package/dist/orchestration/setup-bootstrap.d.ts +0 -146
- package/dist/orchestration/setup-failure-recourse.d.ts +0 -23
- package/dist/orchestration/setup-save.d.ts +0 -47
- package/dist/orchestration/setup-seat-picker.d.ts +0 -72
- package/dist/orchestration/setup-telemetry.d.ts +0 -54
- package/dist/orchestration/setup-test-agents.d.ts +0 -108
- package/dist/orchestration/setup-types.d.ts +0 -146
- package/dist/orchestration/setup-wizard.d.ts +0 -57
- package/dist/orchestration-shell/cohort-flag.d.ts +0 -16
- package/dist/reviewer/providers/gemini.d.ts +0 -109
- /package/dist/{companion-mode/__tests__/detect-parallel.test.d.ts → appsync/__tests__/appsync-client-context-items.test.d.ts} +0 -0
- /package/dist/{orchestration-shell/__tests__/cli-stub-session-adapter.test.d.ts → appsync/__tests__/heartbeat-active.test.d.ts} +0 -0
- /package/dist/{orchestration/__tests__/setup-bootstrap.test.d.ts → appsync/__tests__/orphan-sweep-null-heartbeat.test.d.ts} +0 -0
- /package/dist/{orchestration/__tests__/setup-failure-recourse.test.d.ts → auth/__tests__/vendor-key-cli.test.d.ts} +0 -0
- /package/dist/{orchestration/__tests__/setup-save.test.d.ts → companion-mode/__tests__/mode-selected-emit.test.d.ts} +0 -0
- /package/dist/{orchestration/__tests__/setup-seat-picker.test.d.ts → companion-mode/__tests__/private-launcher-detection.test.d.ts} +0 -0
- /package/dist/{orchestration/__tests__/setup-telemetry.test.d.ts → companion-mode/__tests__/private-launcher-path.test.d.ts} +0 -0
- /package/dist/{orchestration/__tests__/setup-test-agents.test.d.ts → credential-broker/__tests__/broker-c4.test.d.ts} +0 -0
- /package/dist/{orchestration/__tests__/setup-types.test.d.ts → credential-broker/__tests__/broker-streaming.test.d.ts} +0 -0
- /package/dist/{orchestration/__tests__/setup-wizard.test.d.ts → credential-broker/__tests__/chatgpt-config.test.d.ts} +0 -0
- /package/dist/{reviewer/providers/__tests__/gemini-live-smoke.test.d.ts → credential-broker/__tests__/oauth-account-lock.test.d.ts} +0 -0
- /package/dist/{reviewer/providers/__tests__/gemini.test.d.ts → credential-broker/__tests__/oauth-refresh.test.d.ts} +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Logger } from '../logger';
|
|
2
|
+
import type { RolloutLock, RolloutOwnership } from './session-map';
|
|
3
|
+
export interface SocketRolloutLockOptions {
|
|
4
|
+
agent: string;
|
|
5
|
+
logger: Logger;
|
|
6
|
+
/** Override the filesystem-socket directory (tests) — default os.tmpdir(). */
|
|
7
|
+
socketDir?: string;
|
|
8
|
+
/** Base retry backoff while a LIVE owner holds `R` (default 25ms, capped ×~40). */
|
|
9
|
+
backoffMs?: number;
|
|
10
|
+
/** Max total wait before {@link acquireOwnership} throws (default 60000ms). */
|
|
11
|
+
maxWaitMs?: number;
|
|
12
|
+
/** Injectable clock (default Date.now). */
|
|
13
|
+
now?: () => number;
|
|
14
|
+
/** Injectable delay (default setTimeout) — tests pass a controllable fake. */
|
|
15
|
+
delay?: (ms: number) => Promise<void>;
|
|
16
|
+
/** Connect-probe timeout deciding live-vs-stale on filesystem sockets (default 500ms). */
|
|
17
|
+
probeTimeoutMs?: number;
|
|
18
|
+
}
|
|
19
|
+
export declare class SocketRolloutLock implements RolloutLock {
|
|
20
|
+
private readonly agent;
|
|
21
|
+
private readonly logger;
|
|
22
|
+
private readonly socketDir;
|
|
23
|
+
private readonly backoffMs;
|
|
24
|
+
private readonly maxWaitMs;
|
|
25
|
+
private readonly now;
|
|
26
|
+
private readonly delayFn;
|
|
27
|
+
private readonly probeTimeoutMs;
|
|
28
|
+
constructor(opts: SocketRolloutLockOptions);
|
|
29
|
+
/** A short per-user, per-R address key (sun_path is length-bounded). */
|
|
30
|
+
private key;
|
|
31
|
+
/** Abstract name (Linux) or filesystem path (else) for a rollout's lock socket. */
|
|
32
|
+
private address;
|
|
33
|
+
/**
|
|
34
|
+
* The on-disk lock-socket path for a rollout, or `null` on Linux (abstract
|
|
35
|
+
* sockets have no filesystem presence). Diagnostic / test use only.
|
|
36
|
+
*/
|
|
37
|
+
socketPathFor(rollout: string): string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Block until this process exclusively holds `rollout` (like `flock(LOCK_EX)`),
|
|
40
|
+
* then return an ownership handle. Throws if it cannot acquire within maxWaitMs
|
|
41
|
+
* (the caller's per-call barrier then throws — a RETRYABLE re-observe, never a
|
|
42
|
+
* skip, §4.5 invariant ①).
|
|
43
|
+
*/
|
|
44
|
+
acquireOwnership(rollout: string): Promise<RolloutOwnership>;
|
|
45
|
+
/** Attempt one bind. Returns the listening server, or null on EADDRINUSE. */
|
|
46
|
+
private tryBind;
|
|
47
|
+
/**
|
|
48
|
+
* On a filesystem socket, decide whether EADDRINUSE is a live owner or a stale
|
|
49
|
+
* file from a crashed one. Connect-probe: connect OK → live (false); refused /
|
|
50
|
+
* absent → stale → unlink → true. Linux abstract sockets vanish on death, so
|
|
51
|
+
* EADDRINUSE is always live → never stale.
|
|
52
|
+
*/
|
|
53
|
+
private breakStaleFilesystemSocket;
|
|
54
|
+
/** True if a listener currently accepts a connection at `address`. */
|
|
55
|
+
private probeConnect;
|
|
56
|
+
private closeServer;
|
|
57
|
+
}
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* One occurrence of a tool invocation inside a window (§4.1). `id` is the
|
|
4
|
+
* REPRODUCIBLE native invocation id (claude `toolu_…`, codex `call_id`) — it is
|
|
5
|
+
* the MOBILE render-dedup key (design-lock ①), so it must re-derive
|
|
6
|
+
* byte-identically on any transcript rescan. `ts` is the best-available
|
|
7
|
+
* occurrence time (display fidelity only; not required re-derivable, §4.5).
|
|
8
|
+
*/
|
|
9
|
+
export declare const ToolActivityOccurrenceSchema: z.ZodObject<{
|
|
10
|
+
ts: z.ZodString;
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
id: string;
|
|
14
|
+
ts: string;
|
|
15
|
+
}, {
|
|
16
|
+
id: string;
|
|
17
|
+
ts: string;
|
|
18
|
+
}>;
|
|
19
|
+
export type ToolActivityOccurrence = z.infer<typeof ToolActivityOccurrenceSchema>;
|
|
20
|
+
/**
|
|
21
|
+
* Per-occurrence display detail (§4.1 manifest JSON `detail[]`) — lives OUTSIDE
|
|
22
|
+
* `occurrences[]` (which stays the minimal `{ts,id}` dedup shape). `i` indexes into
|
|
23
|
+
* the group's `occurrences[]`; `digest` is `digestOf(toolInput)` (§0), a one-way
|
|
24
|
+
* `sha256:`-prefixed hash carried ENCRYPTED (G4-safe). Present only for occurrences
|
|
25
|
+
* whose observer supplied a tool input.
|
|
26
|
+
*/
|
|
27
|
+
export declare const ToolActivityDetailSchema: z.ZodObject<{
|
|
28
|
+
i: z.ZodNumber;
|
|
29
|
+
digest: z.ZodString;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
digest: string;
|
|
32
|
+
i: number;
|
|
33
|
+
}, {
|
|
34
|
+
digest: string;
|
|
35
|
+
i: number;
|
|
36
|
+
}>;
|
|
37
|
+
export type ToolActivityDetail = z.infer<typeof ToolActivityDetailSchema>;
|
|
38
|
+
/**
|
|
39
|
+
* One `{tool, target}` group within a window (§4.1) — Hendry's
|
|
40
|
+
* `grep file1 ×2 @ t1,t2` shape. `count === occurrences.length` (lossless).
|
|
41
|
+
*/
|
|
42
|
+
export declare const ToolActivityGroupSchema: z.ZodObject<{
|
|
43
|
+
tool: z.ZodString;
|
|
44
|
+
/** The normalized grouping target (§4.1 manifest JSON key `target`; file path / command word). */
|
|
45
|
+
target: z.ZodOptional<z.ZodString>;
|
|
46
|
+
count: z.ZodNumber;
|
|
47
|
+
occurrences: z.ZodArray<z.ZodObject<{
|
|
48
|
+
ts: z.ZodString;
|
|
49
|
+
id: z.ZodString;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
id: string;
|
|
52
|
+
ts: string;
|
|
53
|
+
}, {
|
|
54
|
+
id: string;
|
|
55
|
+
ts: string;
|
|
56
|
+
}>, "many">;
|
|
57
|
+
detail: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
58
|
+
i: z.ZodNumber;
|
|
59
|
+
digest: z.ZodString;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
digest: string;
|
|
62
|
+
i: number;
|
|
63
|
+
}, {
|
|
64
|
+
digest: string;
|
|
65
|
+
i: number;
|
|
66
|
+
}>, "many">>;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
count: number;
|
|
69
|
+
occurrences: {
|
|
70
|
+
id: string;
|
|
71
|
+
ts: string;
|
|
72
|
+
}[];
|
|
73
|
+
tool: string;
|
|
74
|
+
target?: string | undefined;
|
|
75
|
+
detail?: {
|
|
76
|
+
digest: string;
|
|
77
|
+
i: number;
|
|
78
|
+
}[] | undefined;
|
|
79
|
+
}, {
|
|
80
|
+
count: number;
|
|
81
|
+
occurrences: {
|
|
82
|
+
id: string;
|
|
83
|
+
ts: string;
|
|
84
|
+
}[];
|
|
85
|
+
tool: string;
|
|
86
|
+
target?: string | undefined;
|
|
87
|
+
detail?: {
|
|
88
|
+
digest: string;
|
|
89
|
+
i: number;
|
|
90
|
+
}[] | undefined;
|
|
91
|
+
}>;
|
|
92
|
+
export type ToolActivityGroup = z.infer<typeof ToolActivityGroupSchema>;
|
|
93
|
+
/**
|
|
94
|
+
* The consolidated manifest carried (E2E-encrypted at send) as the content of a
|
|
95
|
+
* `TOOL_ACTIVITY` event (§4.1 manifest JSON). `continues` marks an overflow-chained
|
|
96
|
+
* segment (§4.4 — never truncate, never degrade). The window-level fields
|
|
97
|
+
* (`windowStart`/`windowEnd`/`totalInvocations`/`trackId`) are OPTIONAL in the schema
|
|
98
|
+
* (a bare `{groups}` still validates) but the consolidator ALWAYS populates them;
|
|
99
|
+
* `trackId` is `null` on the companion path (2.0 team attribution only).
|
|
100
|
+
*/
|
|
101
|
+
export declare const ToolActivityManifestSchema: z.ZodObject<{
|
|
102
|
+
windowStart: z.ZodOptional<z.ZodString>;
|
|
103
|
+
windowEnd: z.ZodOptional<z.ZodString>;
|
|
104
|
+
totalInvocations: z.ZodOptional<z.ZodNumber>;
|
|
105
|
+
trackId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
106
|
+
groups: z.ZodArray<z.ZodObject<{
|
|
107
|
+
tool: z.ZodString;
|
|
108
|
+
/** The normalized grouping target (§4.1 manifest JSON key `target`; file path / command word). */
|
|
109
|
+
target: z.ZodOptional<z.ZodString>;
|
|
110
|
+
count: z.ZodNumber;
|
|
111
|
+
occurrences: z.ZodArray<z.ZodObject<{
|
|
112
|
+
ts: z.ZodString;
|
|
113
|
+
id: z.ZodString;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
id: string;
|
|
116
|
+
ts: string;
|
|
117
|
+
}, {
|
|
118
|
+
id: string;
|
|
119
|
+
ts: string;
|
|
120
|
+
}>, "many">;
|
|
121
|
+
detail: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
122
|
+
i: z.ZodNumber;
|
|
123
|
+
digest: z.ZodString;
|
|
124
|
+
}, "strip", z.ZodTypeAny, {
|
|
125
|
+
digest: string;
|
|
126
|
+
i: number;
|
|
127
|
+
}, {
|
|
128
|
+
digest: string;
|
|
129
|
+
i: number;
|
|
130
|
+
}>, "many">>;
|
|
131
|
+
}, "strip", z.ZodTypeAny, {
|
|
132
|
+
count: number;
|
|
133
|
+
occurrences: {
|
|
134
|
+
id: string;
|
|
135
|
+
ts: string;
|
|
136
|
+
}[];
|
|
137
|
+
tool: string;
|
|
138
|
+
target?: string | undefined;
|
|
139
|
+
detail?: {
|
|
140
|
+
digest: string;
|
|
141
|
+
i: number;
|
|
142
|
+
}[] | undefined;
|
|
143
|
+
}, {
|
|
144
|
+
count: number;
|
|
145
|
+
occurrences: {
|
|
146
|
+
id: string;
|
|
147
|
+
ts: string;
|
|
148
|
+
}[];
|
|
149
|
+
tool: string;
|
|
150
|
+
target?: string | undefined;
|
|
151
|
+
detail?: {
|
|
152
|
+
digest: string;
|
|
153
|
+
i: number;
|
|
154
|
+
}[] | undefined;
|
|
155
|
+
}>, "many">;
|
|
156
|
+
continues: z.ZodOptional<z.ZodBoolean>;
|
|
157
|
+
}, "strip", z.ZodTypeAny, {
|
|
158
|
+
groups: {
|
|
159
|
+
count: number;
|
|
160
|
+
occurrences: {
|
|
161
|
+
id: string;
|
|
162
|
+
ts: string;
|
|
163
|
+
}[];
|
|
164
|
+
tool: string;
|
|
165
|
+
target?: string | undefined;
|
|
166
|
+
detail?: {
|
|
167
|
+
digest: string;
|
|
168
|
+
i: number;
|
|
169
|
+
}[] | undefined;
|
|
170
|
+
}[];
|
|
171
|
+
trackId?: string | null | undefined;
|
|
172
|
+
windowStart?: string | undefined;
|
|
173
|
+
windowEnd?: string | undefined;
|
|
174
|
+
totalInvocations?: number | undefined;
|
|
175
|
+
continues?: boolean | undefined;
|
|
176
|
+
}, {
|
|
177
|
+
groups: {
|
|
178
|
+
count: number;
|
|
179
|
+
occurrences: {
|
|
180
|
+
id: string;
|
|
181
|
+
ts: string;
|
|
182
|
+
}[];
|
|
183
|
+
tool: string;
|
|
184
|
+
target?: string | undefined;
|
|
185
|
+
detail?: {
|
|
186
|
+
digest: string;
|
|
187
|
+
i: number;
|
|
188
|
+
}[] | undefined;
|
|
189
|
+
}[];
|
|
190
|
+
trackId?: string | null | undefined;
|
|
191
|
+
windowStart?: string | undefined;
|
|
192
|
+
windowEnd?: string | undefined;
|
|
193
|
+
totalInvocations?: number | undefined;
|
|
194
|
+
continues?: boolean | undefined;
|
|
195
|
+
}>;
|
|
196
|
+
export type ToolActivityManifest = z.infer<typeof ToolActivityManifestSchema>;
|
|
197
|
+
/**
|
|
198
|
+
* The durable outbox entry, stored PLAINTEXT at rest inside an explicit envelope
|
|
199
|
+
* (§4.5 — Stage-2 Codex H3 + agy F2: the envelope flag is unconditional so the
|
|
200
|
+
* send loop never double-encrypts or leaks a stale-key ciphertext). The manifest
|
|
201
|
+
* is encrypted ONLY at SEND, under the session's CURRENT key; `expectedSessionKeyGen`
|
|
202
|
+
* is therefore a SEND-TIME value (read from the live session), NOT stored here.
|
|
203
|
+
*
|
|
204
|
+
* `backendSessionId` is bound into the entry (X2a/W4) so a durably-outboxed
|
|
205
|
+
* occurrence is ROUTED by reading the entry and never depends on the separate
|
|
206
|
+
* `(R, call_id) → backend` session-map surviving.
|
|
207
|
+
*/
|
|
208
|
+
export declare const ToolActivityOutboxEnvelopeSchema: z.ZodObject<{
|
|
209
|
+
/** ALWAYS false — the entry never contains ciphertext (encrypt-at-send). */
|
|
210
|
+
isEncrypted: z.ZodLiteral<false>;
|
|
211
|
+
/** Random 128-bit id: the idempotency key (§4.9) AND the entry's filename stem. */
|
|
212
|
+
clientEventId: z.ZodString;
|
|
213
|
+
/** The plugin's backend session id this window belongs to (routing, X2a). */
|
|
214
|
+
backendSessionId: z.ZodString;
|
|
215
|
+
/** ISO-8601 ms — the event row sort key `(sessionId, windowStart)` (§4.9). */
|
|
216
|
+
windowStart: z.ZodString;
|
|
217
|
+
/** The plaintext manifest (encrypted only at send). */
|
|
218
|
+
manifest: z.ZodObject<{
|
|
219
|
+
windowStart: z.ZodOptional<z.ZodString>;
|
|
220
|
+
windowEnd: z.ZodOptional<z.ZodString>;
|
|
221
|
+
totalInvocations: z.ZodOptional<z.ZodNumber>;
|
|
222
|
+
trackId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
223
|
+
groups: z.ZodArray<z.ZodObject<{
|
|
224
|
+
tool: z.ZodString;
|
|
225
|
+
/** The normalized grouping target (§4.1 manifest JSON key `target`; file path / command word). */
|
|
226
|
+
target: z.ZodOptional<z.ZodString>;
|
|
227
|
+
count: z.ZodNumber;
|
|
228
|
+
occurrences: z.ZodArray<z.ZodObject<{
|
|
229
|
+
ts: z.ZodString;
|
|
230
|
+
id: z.ZodString;
|
|
231
|
+
}, "strip", z.ZodTypeAny, {
|
|
232
|
+
id: string;
|
|
233
|
+
ts: string;
|
|
234
|
+
}, {
|
|
235
|
+
id: string;
|
|
236
|
+
ts: string;
|
|
237
|
+
}>, "many">;
|
|
238
|
+
detail: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
239
|
+
i: z.ZodNumber;
|
|
240
|
+
digest: z.ZodString;
|
|
241
|
+
}, "strip", z.ZodTypeAny, {
|
|
242
|
+
digest: string;
|
|
243
|
+
i: number;
|
|
244
|
+
}, {
|
|
245
|
+
digest: string;
|
|
246
|
+
i: number;
|
|
247
|
+
}>, "many">>;
|
|
248
|
+
}, "strip", z.ZodTypeAny, {
|
|
249
|
+
count: number;
|
|
250
|
+
occurrences: {
|
|
251
|
+
id: string;
|
|
252
|
+
ts: string;
|
|
253
|
+
}[];
|
|
254
|
+
tool: string;
|
|
255
|
+
target?: string | undefined;
|
|
256
|
+
detail?: {
|
|
257
|
+
digest: string;
|
|
258
|
+
i: number;
|
|
259
|
+
}[] | undefined;
|
|
260
|
+
}, {
|
|
261
|
+
count: number;
|
|
262
|
+
occurrences: {
|
|
263
|
+
id: string;
|
|
264
|
+
ts: string;
|
|
265
|
+
}[];
|
|
266
|
+
tool: string;
|
|
267
|
+
target?: string | undefined;
|
|
268
|
+
detail?: {
|
|
269
|
+
digest: string;
|
|
270
|
+
i: number;
|
|
271
|
+
}[] | undefined;
|
|
272
|
+
}>, "many">;
|
|
273
|
+
continues: z.ZodOptional<z.ZodBoolean>;
|
|
274
|
+
}, "strip", z.ZodTypeAny, {
|
|
275
|
+
groups: {
|
|
276
|
+
count: number;
|
|
277
|
+
occurrences: {
|
|
278
|
+
id: string;
|
|
279
|
+
ts: string;
|
|
280
|
+
}[];
|
|
281
|
+
tool: string;
|
|
282
|
+
target?: string | undefined;
|
|
283
|
+
detail?: {
|
|
284
|
+
digest: string;
|
|
285
|
+
i: number;
|
|
286
|
+
}[] | undefined;
|
|
287
|
+
}[];
|
|
288
|
+
trackId?: string | null | undefined;
|
|
289
|
+
windowStart?: string | undefined;
|
|
290
|
+
windowEnd?: string | undefined;
|
|
291
|
+
totalInvocations?: number | undefined;
|
|
292
|
+
continues?: boolean | undefined;
|
|
293
|
+
}, {
|
|
294
|
+
groups: {
|
|
295
|
+
count: number;
|
|
296
|
+
occurrences: {
|
|
297
|
+
id: string;
|
|
298
|
+
ts: string;
|
|
299
|
+
}[];
|
|
300
|
+
tool: string;
|
|
301
|
+
target?: string | undefined;
|
|
302
|
+
detail?: {
|
|
303
|
+
digest: string;
|
|
304
|
+
i: number;
|
|
305
|
+
}[] | undefined;
|
|
306
|
+
}[];
|
|
307
|
+
trackId?: string | null | undefined;
|
|
308
|
+
windowStart?: string | undefined;
|
|
309
|
+
windowEnd?: string | undefined;
|
|
310
|
+
totalInvocations?: number | undefined;
|
|
311
|
+
continues?: boolean | undefined;
|
|
312
|
+
}>;
|
|
313
|
+
/** Native invocation ids in this window (ledger reconciliation + render dedup). */
|
|
314
|
+
invocationIds: z.ZodArray<z.ZodString, "many">;
|
|
315
|
+
}, "strip", z.ZodTypeAny, {
|
|
316
|
+
isEncrypted: false;
|
|
317
|
+
manifest: {
|
|
318
|
+
groups: {
|
|
319
|
+
count: number;
|
|
320
|
+
occurrences: {
|
|
321
|
+
id: string;
|
|
322
|
+
ts: string;
|
|
323
|
+
}[];
|
|
324
|
+
tool: string;
|
|
325
|
+
target?: string | undefined;
|
|
326
|
+
detail?: {
|
|
327
|
+
digest: string;
|
|
328
|
+
i: number;
|
|
329
|
+
}[] | undefined;
|
|
330
|
+
}[];
|
|
331
|
+
trackId?: string | null | undefined;
|
|
332
|
+
windowStart?: string | undefined;
|
|
333
|
+
windowEnd?: string | undefined;
|
|
334
|
+
totalInvocations?: number | undefined;
|
|
335
|
+
continues?: boolean | undefined;
|
|
336
|
+
};
|
|
337
|
+
windowStart: string;
|
|
338
|
+
clientEventId: string;
|
|
339
|
+
backendSessionId: string;
|
|
340
|
+
invocationIds: string[];
|
|
341
|
+
}, {
|
|
342
|
+
isEncrypted: false;
|
|
343
|
+
manifest: {
|
|
344
|
+
groups: {
|
|
345
|
+
count: number;
|
|
346
|
+
occurrences: {
|
|
347
|
+
id: string;
|
|
348
|
+
ts: string;
|
|
349
|
+
}[];
|
|
350
|
+
tool: string;
|
|
351
|
+
target?: string | undefined;
|
|
352
|
+
detail?: {
|
|
353
|
+
digest: string;
|
|
354
|
+
i: number;
|
|
355
|
+
}[] | undefined;
|
|
356
|
+
}[];
|
|
357
|
+
trackId?: string | null | undefined;
|
|
358
|
+
windowStart?: string | undefined;
|
|
359
|
+
windowEnd?: string | undefined;
|
|
360
|
+
totalInvocations?: number | undefined;
|
|
361
|
+
continues?: boolean | undefined;
|
|
362
|
+
};
|
|
363
|
+
windowStart: string;
|
|
364
|
+
clientEventId: string;
|
|
365
|
+
backendSessionId: string;
|
|
366
|
+
invocationIds: string[];
|
|
367
|
+
}>;
|
|
368
|
+
export type ToolActivityOutboxEnvelope = z.infer<typeof ToolActivityOutboxEnvelopeSchema>;
|
|
@@ -5,6 +5,8 @@ export interface EncryptedSessionKey {
|
|
|
5
5
|
deviceId: string;
|
|
6
6
|
encryptedKey: string;
|
|
7
7
|
ephemeralPublicKey: string;
|
|
8
|
+
/** SHA-256 of the exact registered public-key string used for wrapping. */
|
|
9
|
+
recipientPublicKeySha256?: string;
|
|
8
10
|
}
|
|
9
11
|
/**
|
|
10
12
|
* Device key stored with backend
|
|
@@ -51,4 +53,6 @@ export interface GrantSessionKeyInput {
|
|
|
51
53
|
deviceId: string;
|
|
52
54
|
encryptedKey: string;
|
|
53
55
|
ephemeralPublicKey: string;
|
|
56
|
+
/** SHA-256 of the exact registered public-key string used to wrap the key. */
|
|
57
|
+
recipientPublicKeySha256: string;
|
|
54
58
|
}
|
package/dist/types/events.d.ts
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 1.x values come first. CP-1 adds 9 new values per
|
|
5
5
|
* `codevibe-backend/docs/2.0/PHASE-CP-1-DESIGN.md` §3 lines 138-148 +
|
|
6
|
-
* §16 Stage A LOCK.
|
|
7
|
-
* `new-event-types-enabled` cohort
|
|
8
|
-
*
|
|
6
|
+
* §16 Stage A LOCK. CP-1 values emit unconditionally — the earlier
|
|
7
|
+
* `new-event-types-enabled` cohort gate was removed (2026-07-09 descope)
|
|
8
|
+
* now that the mobile forward-compat decoder ships (unknown types render
|
|
9
|
+
* as an "Unsupported Event" placeholder, no crash).
|
|
9
10
|
*/
|
|
10
11
|
export declare enum EventType {
|
|
11
12
|
USER_PROMPT = "USER_PROMPT",
|
|
@@ -25,7 +26,12 @@ export declare enum EventType {
|
|
|
25
26
|
STRUCTURAL_SUMMARY_GENERATED = "STRUCTURAL_SUMMARY_GENERATED",
|
|
26
27
|
LOCAL_AUTHORITY_REFUSAL = "LOCAL_AUTHORITY_REFUSAL",
|
|
27
28
|
CONTINUATION_PACKET_WRITTEN = "CONTINUATION_PACKET_WRITTEN",
|
|
28
|
-
CONTINUATION_PACKET_FAILED = "CONTINUATION_PACKET_FAILED"
|
|
29
|
+
CONTINUATION_PACKET_FAILED = "CONTINUATION_PACKET_FAILED",
|
|
30
|
+
TEAM_DECOMPOSED = "TEAM_DECOMPOSED",
|
|
31
|
+
TEAM_TRACK_STATUS = "TEAM_TRACK_STATUS",
|
|
32
|
+
TEAM_GROUP_RESOLVED = "TEAM_GROUP_RESOLVED",
|
|
33
|
+
ADAPTER_PROGRESS = "ADAPTER_PROGRESS",
|
|
34
|
+
TOOL_ACTIVITY = "TOOL_ACTIVITY"
|
|
29
35
|
}
|
|
30
36
|
export declare enum EventSource {
|
|
31
37
|
DESKTOP = "DESKTOP",
|
|
@@ -66,6 +72,16 @@ export interface Event {
|
|
|
66
72
|
deliveredAt?: string;
|
|
67
73
|
executedAt?: string;
|
|
68
74
|
isEncrypted?: boolean;
|
|
75
|
+
encryptionVersion?: number;
|
|
76
|
+
writerAuthenticated?: boolean | null;
|
|
77
|
+
writerEventNonce?: string | null;
|
|
78
|
+
}
|
|
79
|
+
export interface WriterEventAttestationInput {
|
|
80
|
+
schema: 'codevibe.encrypted_desktop_event.writer.v1';
|
|
81
|
+
writerEventNonce: string;
|
|
82
|
+
contentCiphertextSha256: string;
|
|
83
|
+
metadataCiphertextSha256: string;
|
|
84
|
+
signatureB64: string;
|
|
69
85
|
}
|
|
70
86
|
/**
|
|
71
87
|
* GraphQL input for creating events
|
|
@@ -79,6 +95,10 @@ export interface CreateEventInput {
|
|
|
79
95
|
promptId?: string;
|
|
80
96
|
timestamp?: string;
|
|
81
97
|
isEncrypted?: boolean;
|
|
98
|
+
clientEventId?: string;
|
|
99
|
+
expectedSessionKeyGen?: string;
|
|
100
|
+
encryptionVersion?: number;
|
|
101
|
+
writerAttestation?: WriterEventAttestationInput;
|
|
82
102
|
}
|
|
83
103
|
/**
|
|
84
104
|
* GraphQL input for updating event status
|
package/dist/types/session.d.ts
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import { EncryptedSessionKey } from './encryption';
|
|
2
|
+
/**
|
|
3
|
+
* Tool-event consolidation (codevibe-backend/docs/2.0/TOOL-EVENT-CONSOLIDATION-DESIGN.md
|
|
4
|
+
* §4.9). Distinguished sentinel a client stamps as `expectedSessionKeyGen` when it
|
|
5
|
+
* observes a session whose `sessionKeyGen` attribute is ABSENT (a LEGACY session
|
|
6
|
+
* created before sessionKeyGen shipped). The backend resolver maps this sentinel to
|
|
7
|
+
* the absence-aware, TTL-delete-safe ConditionCheck
|
|
8
|
+
* `attribute_exists(sessionId) AND attribute_not_exists(sessionKeyGen)` (never a
|
|
9
|
+
* literal `sessionKeyGen = :0`, which would wedge every legacy session).
|
|
10
|
+
*
|
|
11
|
+
* MUST stay byte-identical to the backend Lambda literal
|
|
12
|
+
* (codevibe-backend/lambda/event-management/index.ts `SESSION_KEY_GEN_ABSENT_SENTINEL`).
|
|
13
|
+
* The chosen value can never collide with a real server-minted nonce (a UUID).
|
|
14
|
+
*/
|
|
15
|
+
export declare const SESSION_KEY_GEN_ABSENT_SENTINEL = "__CODEVIBE_SESSION_KEY_GEN_ABSENT__";
|
|
2
16
|
/**
|
|
3
17
|
* Session status enum
|
|
4
18
|
*/
|
|
@@ -14,6 +28,7 @@ export declare enum AgentType {
|
|
|
14
28
|
CLAUDE = "CLAUDE",
|
|
15
29
|
GEMINI = "GEMINI",
|
|
16
30
|
CODEX = "CODEX",
|
|
31
|
+
ANTIGRAVITY = "ANTIGRAVITY",
|
|
17
32
|
CODEVIBE = "CODEVIBE"
|
|
18
33
|
}
|
|
19
34
|
/**
|
|
@@ -33,18 +48,33 @@ export interface Session {
|
|
|
33
48
|
creatorDeviceId?: string;
|
|
34
49
|
encryptionVersion?: number;
|
|
35
50
|
lastHeartbeatAt?: string;
|
|
51
|
+
/** True only for the immutable registered desktop creator key snapshot. */
|
|
52
|
+
writerAttestationEligible?: boolean | null;
|
|
53
|
+
/** SHA-256 of the raw 64-byte creator signing public key. */
|
|
54
|
+
creatorSigningKeySha256?: string | null;
|
|
36
55
|
/**
|
|
37
56
|
* Quorum 2.0 opt-in flag (2f.0.a.3). True routes the session to the
|
|
38
57
|
* 2.0 orchestration flow once 2f.3 Lambda is live; null/false keeps
|
|
39
58
|
* the 1.0 companion flow.
|
|
40
59
|
*/
|
|
41
60
|
orchestrationEnabled?: boolean | null;
|
|
61
|
+
/**
|
|
62
|
+
* Tool-event consolidation (TOOL-EVENT-CONSOLIDATION-DESIGN.md §4.9).
|
|
63
|
+
* Server-minted random nonce written by createSession; advances ONLY on a
|
|
64
|
+
* genuine createSession (never updateSession/resume/grantSessionKey). The
|
|
65
|
+
* client reads it to stamp/refresh `expectedSessionKeyGen` on TOOL_ACTIVITY
|
|
66
|
+
* sends. OPTIONAL — a LEGACY session created before this shipped lacks it, in
|
|
67
|
+
* which case the client stamps SESSION_KEY_GEN_ABSENT_SENTINEL.
|
|
68
|
+
*/
|
|
69
|
+
sessionKeyGen?: string;
|
|
42
70
|
}
|
|
43
71
|
/**
|
|
44
72
|
* GraphQL input for creating sessions
|
|
45
73
|
*/
|
|
46
74
|
export interface CreateSessionInput {
|
|
47
75
|
sessionId?: string;
|
|
76
|
+
/** Stable UUIDv4 used to retry one sealed create request byte-for-byte. */
|
|
77
|
+
creationRequestId?: string;
|
|
48
78
|
userId: string;
|
|
49
79
|
agentType?: AgentType;
|
|
50
80
|
projectPath: string;
|
|
@@ -69,8 +99,8 @@ export interface UpdateSessionInput {
|
|
|
69
99
|
metadata?: Record<string, any>;
|
|
70
100
|
lastHeartbeatAt?: string;
|
|
71
101
|
/**
|
|
72
|
-
* Quorum 2.0
|
|
73
|
-
*
|
|
102
|
+
* Legacy Quorum 2.0 compatibility field. Public per-session override flags
|
|
103
|
+
* were retired by A6; current clients do not set this from the CLI.
|
|
74
104
|
*/
|
|
75
105
|
orchestrationEnabled?: boolean;
|
|
76
106
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quantiya/codevibe-core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7",
|
|
4
4
|
"description": "Core library for CodeVibe plugins - shared keychain, crypto, AppSync, and auth functionality",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -37,13 +37,14 @@
|
|
|
37
37
|
"react": "^19.2.0",
|
|
38
38
|
"react-devtools-core": "^6.1.2",
|
|
39
39
|
"ulid": "^3.0.0",
|
|
40
|
-
"uuid": "^
|
|
40
|
+
"uuid": "^11.1.1",
|
|
41
41
|
"ws": "^8.14.0",
|
|
42
42
|
"yaml": "^2.9.0",
|
|
43
43
|
"zod": "^3.23.0"
|
|
44
44
|
},
|
|
45
45
|
"optionalDependencies": {
|
|
46
|
-
"keytar": "^7.9.0"
|
|
46
|
+
"keytar": "^7.9.0",
|
|
47
|
+
"fs-ext": "^2.0.0"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
50
|
"@types/gradient-string": "^1.1.6",
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
"vitest": "^1.6.1"
|
|
58
59
|
},
|
|
59
60
|
"engines": {
|
|
60
|
-
"node": ">=
|
|
61
|
+
"node": ">=22.0.0"
|
|
61
62
|
},
|
|
62
63
|
"author": "Quantiya",
|
|
63
64
|
"license": "MIT",
|
|
@@ -70,7 +71,7 @@
|
|
|
70
71
|
"quantiya",
|
|
71
72
|
"claude",
|
|
72
73
|
"codex",
|
|
73
|
-
"
|
|
74
|
+
"antigravity",
|
|
74
75
|
"ai",
|
|
75
76
|
"coding",
|
|
76
77
|
"encryption"
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Dispatch for the `orchestration` subcommand. Called by runAuthCli
|
|
3
|
-
* when it sees `argv[2] === 'orchestration'`. Supports five sub-actions:
|
|
4
|
-
* enable — set orchestrationEnabledDefault = true
|
|
5
|
-
* disable — set orchestrationEnabledDefault = false
|
|
6
|
-
* status — print current policy snapshot + installed agents
|
|
7
|
-
* configure — interactive wizard (toggle + panel customization)
|
|
8
|
-
* setup — Phase 3.a (#190) 3-step locked setup wizard with Test
|
|
9
|
-
* My Agents (locked role taxonomy: architecture /
|
|
10
|
-
* correctness / security)
|
|
11
|
-
*/
|
|
12
|
-
export declare function runOrchestrationCli(argv: string[]): Promise<void>;
|