@quantiya/codevibe-core 2.0.7 → 2.0.9
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/appsync/__tests__/dispose-watcher-socket.test.d.ts +1 -0
- package/dist/appsync/__tests__/refresh-open-prompt-ttl-chunk.test.d.ts +1 -0
- package/dist/appsync/appsync-client.d.ts +232 -30
- package/dist/appsync/queries.d.ts +2 -0
- package/dist/auth/__tests__/keychain-cli-nudge.test.d.ts +1 -0
- package/dist/auth/__tests__/keychain-cli.test.d.ts +1 -0
- package/dist/auth/keychain-cli.d.ts +14 -0
- package/dist/companion-mode/index.d.ts +14 -0
- package/dist/credential-broker/oauth-account-lock.d.ts +47 -1
- package/dist/crypto/__tests__/open-prompt-id.test.d.ts +1 -0
- package/dist/crypto/index.d.ts +1 -0
- package/dist/crypto/open-prompt-id.d.ts +36 -0
- package/dist/e1/__tests__/prompt-raise.test.d.ts +1 -0
- package/dist/e1/index.d.ts +2 -0
- package/dist/e1/prompt-raise.d.ts +65 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4652 -252
- package/dist/keychain/__tests__/keychain-manager.test.d.ts +1 -0
- package/dist/keychain/__tests__/keychain-migrate.test.d.ts +1 -0
- package/dist/keychain/__tests__/migrate-nudge.test.d.ts +1 -0
- package/dist/keychain/keychain-backend.d.ts +105 -0
- package/dist/keychain/keychain-manager.d.ts +17 -3
- package/dist/keychain/keychain-migrate.d.ts +63 -0
- package/dist/keychain/migrate-nudge.d.ts +38 -0
- package/dist/local-executor/__tests__/anchored-fs.test.d.ts +1 -0
- package/dist/local-executor/__tests__/bounded-directory.test.d.ts +1 -0
- package/dist/local-executor/__tests__/bounded-output.test.d.ts +1 -0
- package/dist/local-executor/__tests__/durable-directory.test.d.ts +1 -0
- package/dist/local-executor/__tests__/hosted-class-a-sink.test.d.ts +1 -0
- package/dist/local-executor/__tests__/process-identity.test.d.ts +1 -0
- package/dist/local-executor/__tests__/process-tree.test.d.ts +1 -0
- package/dist/local-executor/__tests__/protocol-backlog-wiring.test.d.ts +1 -0
- package/dist/local-executor/__tests__/protocol-backlog.test.d.ts +1 -0
- package/dist/local-executor/__tests__/publication-authority-capability.test.d.ts +1 -0
- package/dist/local-executor/__tests__/snapshot-merge.test.d.ts +1 -0
- package/dist/local-executor/__tests__/workspace-authority-fixture.d.ts +3 -0
- package/dist/local-executor/__tests__/workspace-authority.test.d.ts +1 -0
- package/dist/local-executor/__tests__/workspace-cleanup-audit.test.d.ts +1 -0
- package/dist/local-executor/__tests__/workspace-materializer.test.d.ts +1 -0
- package/dist/local-executor/agentic-disposable-repo.d.ts +23 -6
- package/dist/local-executor/agentic-resolve.d.ts +16 -0
- package/dist/local-executor/anchored-fs.d.ts +250 -0
- package/dist/local-executor/bounded-directory.d.ts +78 -0
- package/dist/local-executor/bounded-helper.d.ts +22 -0
- package/dist/local-executor/bounded-output.d.ts +11 -0
- package/dist/local-executor/class-a-emit.d.ts +13 -1
- package/dist/local-executor/durable-directory.d.ts +25 -0
- package/dist/local-executor/durable-store.d.ts +217 -25
- package/dist/local-executor/hosted-class-a-sink.d.ts +27 -0
- package/dist/local-executor/index.d.ts +3 -2
- package/dist/local-executor/local-executor-impl.d.ts +159 -69
- package/dist/local-executor/process-identity.d.ts +46 -0
- package/dist/local-executor/process-tree.d.ts +123 -0
- package/dist/local-executor/protocol-backlog.d.ts +62 -0
- package/dist/local-executor/revert-reconcile.d.ts +4 -0
- package/dist/local-executor/revert-runner.d.ts +14 -1
- package/dist/local-executor/snapshot-merge.d.ts +124 -0
- package/dist/local-executor/task-group-types.d.ts +7 -6
- package/dist/local-executor/team-execution-flag.d.ts +2 -2
- package/dist/local-executor/track-registry.d.ts +2 -0
- package/dist/local-executor/types.d.ts +33 -2
- package/dist/local-executor/verification-gates/build.d.ts +5 -0
- package/dist/local-executor/verification-gates/deploy-preflight.d.ts +2 -0
- package/dist/local-executor/verification-gates/diff-sanity.d.ts +12 -0
- package/dist/local-executor/verification-gates/hostile-grep.d.ts +2 -0
- package/dist/local-executor/verification-gates/lint.d.ts +2 -0
- package/dist/local-executor/verification-gates/shell-runner.d.ts +5 -0
- package/dist/local-executor/verification-gates/source-traceability.d.ts +2 -0
- package/dist/local-executor/verification-gates/tests.d.ts +3 -0
- package/dist/local-executor/verification-gates/typecheck.d.ts +3 -0
- package/dist/local-executor/verification-runner.d.ts +6 -0
- package/dist/local-executor/workspace-authority.d.ts +45 -0
- package/dist/local-executor/workspace-cleanup-audit.d.ts +3 -0
- package/dist/local-executor/workspace-materializer.d.ts +48 -0
- package/dist/local-executor/workspace-shadow.d.ts +380 -85
- package/dist/orchestration-shell/__tests__/advisory-attachment-journal.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/direct-file-delete.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/flag-command.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/halt-message-wire-content.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/planner-offer-e1.test.d.ts +1 -0
- package/dist/orchestration-shell/__tests__/workspace-shutdown.test.d.ts +1 -0
- package/dist/orchestration-shell/advisory-attachment-journal.d.ts +165 -0
- package/dist/orchestration-shell/attachments.d.ts +47 -58
- package/dist/orchestration-shell/audit-browser.d.ts +54 -1
- package/dist/orchestration-shell/bounded-shutdown.d.ts +6 -0
- package/dist/orchestration-shell/cli.d.ts +10 -0
- package/dist/orchestration-shell/cli.js +38355 -27300
- package/dist/orchestration-shell/context-items.d.ts +3 -0
- package/dist/orchestration-shell/declared-test-runner.d.ts +21 -2
- package/dist/orchestration-shell/direct-file-delete.d.ts +22 -0
- package/dist/orchestration-shell/emit-shell-event.d.ts +7 -0
- package/dist/orchestration-shell/explicit-tty-exit.d.ts +1 -2
- package/dist/orchestration-shell/flag-command.d.ts +81 -0
- package/dist/orchestration-shell/gate-decision-submit.d.ts +11 -0
- package/dist/orchestration-shell/gate-prompts.d.ts +116 -0
- package/dist/orchestration-shell/index.d.ts +34 -6
- package/dist/orchestration-shell/planner-offer-e1.d.ts +97 -0
- package/dist/orchestration-shell/quorum-loop.d.ts +312 -61
- package/dist/orchestration-shell/reducer.d.ts +9 -0
- package/dist/orchestration-shell/task-progress.d.ts +18 -4
- package/dist/orchestration-shell/team-decompose.d.ts +10 -10
- package/dist/orchestration-shell/types.d.ts +90 -2
- package/dist/orchestration-shell/workspace-shutdown.d.ts +47 -0
- package/dist/reviewer/output-parser.d.ts +19 -0
- package/dist/reviewer/providers/codex.d.ts +5 -3
- package/dist/reviewer/token-usage.d.ts +41 -12
- package/dist/reviewer/types.d.ts +6 -0
- package/dist/reviewer/verdict-classifier.d.ts +1 -0
- package/dist/session/session-rekey.d.ts +4 -3
- package/dist/substrate/__tests__/command-runner.test.d.ts +1 -0
- package/dist/substrate/command-runner.d.ts +2 -0
- package/dist/substrate/docker.d.ts +7 -32
- package/dist/substrate/index.d.ts +0 -1
- package/dist/substrate/sandbox-exec.d.ts +0 -13
- package/dist/substrate/types.d.ts +15 -2
- package/dist/substrate-launch/__tests__/reviewer-credential-preflight.test.d.ts +1 -0
- package/dist/substrate-launch/engage-substrate.d.ts +3 -0
- package/dist/substrate-launch/index.d.ts +2 -0
- package/dist/substrate-launch/reviewer-credential-preflight.d.ts +50 -0
- package/dist/test-publication-authority-setup.d.ts +1 -0
- package/dist/tool-activity/replay-cursor.d.ts +42 -8
- package/dist/track-presentation.d.ts +2 -0
- package/dist/track-presentation.test.d.ts +1 -0
- package/dist/types/encryption.d.ts +5 -0
- package/dist/types/events.d.ts +5 -0
- package/package.json +3 -3
- package/dist/substrate/git-proxy.d.ts +0 -35
- /package/dist/{substrate/__tests__/git-proxy.test.d.ts → appsync/__tests__/appsync-client-flag-locator.test.d.ts} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Readable, Writable } from "node:stream";
|
|
2
|
+
import type { WorkspaceRootAuthority } from "../local-executor/workspace-authority";
|
|
2
3
|
/**
|
|
3
4
|
* Isolation backend for a substrate. `firecracker` is [DEF →
|
|
4
5
|
* A3-after-C2] — declared so the union admits the hosted runner without
|
|
@@ -24,10 +25,12 @@ export type EgressFidelity = "strict" | "coarse";
|
|
|
24
25
|
export interface SubstrateSpec {
|
|
25
26
|
isolationTech: IsolationTech;
|
|
26
27
|
/**
|
|
27
|
-
* Canonical host path of the session
|
|
28
|
-
* mounted
|
|
28
|
+
* Canonical host path of the session workspace — the only mutable filesystem
|
|
29
|
+
* mounted; repository metadata is hidden by the substrate.
|
|
29
30
|
*/
|
|
30
31
|
workdir: string;
|
|
32
|
+
/** Exact host workdir incarnation for task-scoped mutable launches. */
|
|
33
|
+
workdirAuthority?: WorkspaceRootAuthority;
|
|
31
34
|
/**
|
|
32
35
|
* Where the broker actually listens on the HOST (e.g.
|
|
33
36
|
* `127.0.0.1:<ephemeral>`).
|
|
@@ -133,6 +136,14 @@ export interface SubstrateProc {
|
|
|
133
136
|
readonly stdin: Writable | null;
|
|
134
137
|
readonly stdout: Readable | null;
|
|
135
138
|
readonly stderr: Readable | null;
|
|
139
|
+
/**
|
|
140
|
+
* The host command runner advertises this only when the returned process is
|
|
141
|
+
* itself wrapped by CodeVibe's authenticated POSIX process host. The Local
|
|
142
|
+
* Executor must then await that host's cleanup proof before retiring a
|
|
143
|
+
* workspace. Docker-backed substrate processes omit it because the
|
|
144
|
+
* container, rather than a host POSIX group, owns their lifecycle.
|
|
145
|
+
*/
|
|
146
|
+
readonly hostProcessTreeOwnership?: "posix-host";
|
|
136
147
|
kill(signal?: NodeJS.Signals): boolean;
|
|
137
148
|
on(event: "close" | "error" | "exit", cb: (...a: unknown[]) => void): this;
|
|
138
149
|
}
|
|
@@ -243,5 +254,7 @@ export interface CommandRunner {
|
|
|
243
254
|
env?: Readonly<Record<string, string>>;
|
|
244
255
|
/** Child working directory. Absent → inherit the parent's cwd. */
|
|
245
256
|
cwd?: string;
|
|
257
|
+
/** Exact cwd incarnation held through native process creation. */
|
|
258
|
+
cwdAuthority?: WorkspaceRootAuthority;
|
|
246
259
|
}): RunnerProc;
|
|
247
260
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,6 +2,7 @@ import { type RotationHandle } from "../credential-broker";
|
|
|
2
2
|
import type { BrokerDeps } from "../credential-broker/broker";
|
|
3
3
|
import type { ModelGatewayBroker, UpstreamClient, VendorProvider } from "../credential-broker/types";
|
|
4
4
|
import type { ProcessRole } from "../local-executor/types";
|
|
5
|
+
import type { WorkspaceRootAuthority } from "../local-executor/workspace-authority";
|
|
5
6
|
import type { SubstrateHandle } from "../substrate/types";
|
|
6
7
|
import { type FallbackLadderDeps } from "./fallback-ladder";
|
|
7
8
|
/** Map the implementor agent to the broker provider (Claude+Codex only, §6 Q4). */
|
|
@@ -21,6 +22,8 @@ export interface EngageSubstrateInput {
|
|
|
21
22
|
agentKind: "CLAUDE" | "GEMINI" | "CODEX" | "ANTIGRAVITY";
|
|
22
23
|
/** Canonical host path of the session worktree (the only fs mounted). */
|
|
23
24
|
workdir: string;
|
|
25
|
+
/** Exact workdir incarnation for task-scoped mutable dispatch. */
|
|
26
|
+
workdirAuthority?: WorkspaceRootAuthority;
|
|
24
27
|
/** The implementor role marker value (always 'implementor' here). */
|
|
25
28
|
role: ProcessRole;
|
|
26
29
|
/**
|
|
@@ -6,6 +6,8 @@ export { buildSanitizedBaseEnv, assertNoAmbientCreds, SAFE_ENV_ALLOWLIST, SANDBO
|
|
|
6
6
|
export type { SanitizedEnvInput } from "./sanitized-env";
|
|
7
7
|
export { ApiKeyBootstrap, SANDBOX_BOOTSTRAP_DIR, HELPER_SCRIPT_NAME, TOKEN_FILE_NAME, CODEX_PROVIDER_ID, } from "./apikey-bootstrap";
|
|
8
8
|
export type { ApiKeyBootstrapInput } from "./apikey-bootstrap";
|
|
9
|
+
export { assertReviewerVendorCredential, reviewerProviderFor, withReviewerCredentialPreflight, ReviewerCredentialMissingError, REVIEWER_CREDENTIAL_MISSING, } from "./reviewer-credential-preflight";
|
|
10
|
+
export type { ReviewerCredentialStore } from "./reviewer-credential-preflight";
|
|
9
11
|
export { scrubLeEnvOrReexec, buildScrubbedLeEnv, findCredShapedKeys, isCredShapedEnvKey, LE_ENV_SCRUBBED_MARKER, } from "./le-env-scrub";
|
|
10
12
|
export type { LeEnvScrubDeps } from "./le-env-scrub";
|
|
11
13
|
export { Cp7AuditWriter, CP7_CANONICAL_FORM_VERSION, GENESIS_PREV_HASH, canonicalJson, canonicalEntryBytes, computeEntryHash, verifyChain, } from "../local-executor/cp7-audit-writer";
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { VendorProvider } from "../credential-broker";
|
|
2
|
+
/**
|
|
3
|
+
* Typed marker for the missing-credential failure so the loop can surface the
|
|
4
|
+
* remediation on the user-facing NOTIFICATION channel (Stage-2 r2 Codex MED-1)
|
|
5
|
+
* without string-matching. Identified by `name` (survives bundling) — callers
|
|
6
|
+
* check `err.name === REVIEWER_CREDENTIAL_MISSING` rather than instanceof.
|
|
7
|
+
*/
|
|
8
|
+
export declare const REVIEWER_CREDENTIAL_MISSING = "ReviewerCredentialMissingError";
|
|
9
|
+
export declare class ReviewerCredentialMissingError extends Error {
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The minimal store surface the preflight needs (structurally satisfied by
|
|
14
|
+
* `KeychainVendorKeyStore`); narrow so tests can stub it without keychain IO.
|
|
15
|
+
*/
|
|
16
|
+
export interface ReviewerCredentialStore {
|
|
17
|
+
getVendorKey(provider: VendorProvider): Promise<string | null>;
|
|
18
|
+
getVendorOAuthBundle(provider: VendorProvider): Promise<unknown | null>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Map a reviewer agent kind (lowercase, as the loop's engager input carries it)
|
|
22
|
+
* to its broker vendor provider. Non-Trusted agents (gemini/antigravity) have
|
|
23
|
+
* no broker provider — they never sandbox, so the preflight is a no-op for
|
|
24
|
+
* them (the loop pre-routes them to legacy+badge before engaging anyway).
|
|
25
|
+
*/
|
|
26
|
+
export declare function reviewerProviderFor(agent: string): VendorProvider | null;
|
|
27
|
+
/**
|
|
28
|
+
* Throw (fail-closed) when a Trusted reviewer is about to substrate-engage but
|
|
29
|
+
* no vendor credential exists for its provider. The message is the user-facing
|
|
30
|
+
* remediation — it propagates verbatim through the loop's engage-failure
|
|
31
|
+
* ESCALATE (`spawnOneSeat`) and the Wave-B fall-through WARN.
|
|
32
|
+
*/
|
|
33
|
+
export declare function assertReviewerVendorCredential(agent: string, store: ReviewerCredentialStore): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Wrap a reviewer substrate engager with the credential preflight, ordered
|
|
36
|
+
* AFTER tier selection (Stage-2 r2 Codex MED-2): the underlying engage runs
|
|
37
|
+
* first, and the credential check applies ONLY when the ladder actually chose
|
|
38
|
+
* the `substrate` (broker) mode — a `reduced_trust` selection never consults
|
|
39
|
+
* credentials, preserving the pre-flip legacy-plus-badge fallback on hosts
|
|
40
|
+
* with no establishable sandbox tier. On substrate + missing credential the
|
|
41
|
+
* engaged substrate is torn down and the actionable
|
|
42
|
+
* `ReviewerCredentialMissingError` propagates (fail-closed, no ambient
|
|
43
|
+
* fallback).
|
|
44
|
+
*/
|
|
45
|
+
export declare function withReviewerCredentialPreflight<I extends {
|
|
46
|
+
agent: string;
|
|
47
|
+
}, R extends {
|
|
48
|
+
mode: string;
|
|
49
|
+
teardown: () => Promise<void>;
|
|
50
|
+
}>(engage: (input: I) => Promise<R>, store: ReviewerCredentialStore): (input: I) => Promise<R>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { Logger } from '../logger';
|
|
3
|
+
/** Keep every ordinary replay read comfortably below Node/Buffer's platform limits. */
|
|
4
|
+
export declare const DEFAULT_REPLAY_READ_BYTES: number;
|
|
5
|
+
/**
|
|
6
|
+
* A JSONL record may be larger than the ordinary batch, so the reader extends in
|
|
7
|
+
* fixed-size chunks until it finds the terminating newline. This cap bounds the
|
|
8
|
+
* one-record memory cost without imposing any limit on the transcript FILE size.
|
|
9
|
+
*/
|
|
10
|
+
export declare const DEFAULT_REPLAY_MAX_FRAME_BYTES: number;
|
|
11
|
+
export declare class ReplayFrameTooLargeError extends Error {
|
|
12
|
+
readonly startOffset: number;
|
|
13
|
+
readonly maxFrameBytes: number;
|
|
14
|
+
readonly code = "REPLAY_FRAME_TOO_LARGE";
|
|
15
|
+
constructor(startOffset: number, maxFrameBytes: number);
|
|
16
|
+
}
|
|
3
17
|
export declare const ReplayCursorStateSchema: z.ZodObject<{
|
|
4
18
|
version: z.ZodLiteral<1>;
|
|
5
19
|
/** The transcript path this cursor tracks (a change ⇒ rescan from 0). */
|
|
@@ -23,8 +37,8 @@ export declare const ReplayCursorStateSchema: z.ZodObject<{
|
|
|
23
37
|
carryover: z.ZodString;
|
|
24
38
|
}, "strip", z.ZodTypeAny, {
|
|
25
39
|
version: 1;
|
|
26
|
-
byteOffset: number;
|
|
27
40
|
canonicalPath: string;
|
|
41
|
+
byteOffset: number;
|
|
28
42
|
fileIdentity: {
|
|
29
43
|
dev: number;
|
|
30
44
|
ino: number;
|
|
@@ -33,8 +47,8 @@ export declare const ReplayCursorStateSchema: z.ZodObject<{
|
|
|
33
47
|
carryover: string;
|
|
34
48
|
}, {
|
|
35
49
|
version: 1;
|
|
36
|
-
byteOffset: number;
|
|
37
50
|
canonicalPath: string;
|
|
51
|
+
byteOffset: number;
|
|
38
52
|
fileIdentity: {
|
|
39
53
|
dev: number;
|
|
40
54
|
ino: number;
|
|
@@ -57,7 +71,7 @@ export interface ReplayFrame {
|
|
|
57
71
|
}
|
|
58
72
|
/** A pure read snapshot — no persisted state is mutated by {@link ToolReplayCursor.readFrames}. */
|
|
59
73
|
export interface ReadFramesResult {
|
|
60
|
-
/** Complete lines from the checkpoint (or 0 after a rotation)
|
|
74
|
+
/** Complete lines in this bounded batch from the checkpoint (or 0 after a rotation). */
|
|
61
75
|
frames: ReplayFrame[];
|
|
62
76
|
/** True when the file rotated/truncated and was rescanned from 0. */
|
|
63
77
|
rotated: boolean;
|
|
@@ -67,6 +81,14 @@ export interface ReadFramesResult {
|
|
|
67
81
|
carryover: string;
|
|
68
82
|
/** Byte offset just past the last COMPLETE line — the max checkpoint candidate. */
|
|
69
83
|
endOfComplete: number;
|
|
84
|
+
/**
|
|
85
|
+
* True when this stat snapshot contains bytes beyond the bounded read. The
|
|
86
|
+
* caller may immediately run another batch after checkpointing this one.
|
|
87
|
+
* False at the snapshot EOF, including when EOF is an incomplete trailing line.
|
|
88
|
+
*/
|
|
89
|
+
hasMore: boolean;
|
|
90
|
+
/** Bytes actually read from disk for this batch (diagnostics/tests). */
|
|
91
|
+
bytesRead: number;
|
|
70
92
|
/** The identity + size captured AT read time — pass to {@link ToolReplayCursor.checkpoint} for a consistent snapshot. */
|
|
71
93
|
fileIdentity: {
|
|
72
94
|
dev: number;
|
|
@@ -81,6 +103,10 @@ export interface ToolReplayCursorOptions {
|
|
|
81
103
|
canonicalPath: string;
|
|
82
104
|
logger: Logger;
|
|
83
105
|
root?: string;
|
|
106
|
+
/** Ordinary bounded batch size. Defaults to 4 MiB. */
|
|
107
|
+
readBytes?: number;
|
|
108
|
+
/** Maximum bytes allowed in one unterminated JSONL record. Defaults to 64 MiB. */
|
|
109
|
+
maxFrameBytes?: number;
|
|
84
110
|
}
|
|
85
111
|
/**
|
|
86
112
|
* The durable tool-replay cursor for ONE session's transcript. Split into a PURE
|
|
@@ -94,6 +120,8 @@ export declare class ToolReplayCursor {
|
|
|
94
120
|
private readonly canonicalPath;
|
|
95
121
|
private readonly logger;
|
|
96
122
|
private readonly rootDir;
|
|
123
|
+
private readonly readBytes;
|
|
124
|
+
private readonly maxFrameBytes;
|
|
97
125
|
private state;
|
|
98
126
|
constructor(opts: ToolReplayCursorOptions);
|
|
99
127
|
private filePath;
|
|
@@ -105,11 +133,17 @@ export declare class ToolReplayCursor {
|
|
|
105
133
|
/** The current durable checkpoint (0 when fresh). */
|
|
106
134
|
byteOffset(): number;
|
|
107
135
|
/**
|
|
108
|
-
* Read + byte-frame
|
|
109
|
-
* rotation)
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
136
|
+
* Read + byte-frame ONE BOUNDED transcript batch from the durable checkpoint
|
|
137
|
+
* (or 0 after a rotation). PURE — persists nothing. File positions are ordinary
|
|
138
|
+
* safe JS integers, so offsets above Node's signed 32-bit Buffer length remain
|
|
139
|
+
* valid; no allocation is based on `(fileSize - checkpoint)`.
|
|
140
|
+
*
|
|
141
|
+
* Frames on `\n` (0x0A), an ASCII byte that never appears mid-UTF-8-char, so
|
|
142
|
+
* every complete-line boundary is a safe UTF-8 (and byte-offset) boundary. If
|
|
143
|
+
* the ordinary batch contains no newline, fixed-size reads extend only until
|
|
144
|
+
* the first record terminator or `maxFrameBytes`. Thus transcript FILE size is
|
|
145
|
+
* unbounded while one malformed/huge JSONL RECORD has a controlled bound.
|
|
146
|
+
* The trailing partial is returned as `carryover` and re-read next cycle.
|
|
113
147
|
*/
|
|
114
148
|
readFrames(): Promise<ReadFramesResult>;
|
|
115
149
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -55,4 +55,9 @@ export interface GrantSessionKeyInput {
|
|
|
55
55
|
ephemeralPublicKey: string;
|
|
56
56
|
/** SHA-256 of the exact registered public-key string used to wrap the key. */
|
|
57
57
|
recipientPublicKeySha256: string;
|
|
58
|
+
/**
|
|
59
|
+
* Exact session-key generation used to produce `encryptedKey`, or the
|
|
60
|
+
* generation-absent sentinel for a legacy row.
|
|
61
|
+
*/
|
|
62
|
+
expectedSessionKeyGen: string;
|
|
58
63
|
}
|
package/dist/types/events.d.ts
CHANGED
|
@@ -95,6 +95,11 @@ export interface CreateEventInput {
|
|
|
95
95
|
promptId?: string;
|
|
96
96
|
timestamp?: string;
|
|
97
97
|
isEncrypted?: boolean;
|
|
98
|
+
ownerToken?: string;
|
|
99
|
+
producerKind?: string;
|
|
100
|
+
mobileActionable?: boolean;
|
|
101
|
+
resolvedPromptId?: string;
|
|
102
|
+
resolutionAt?: string;
|
|
98
103
|
clientEventId?: string;
|
|
99
104
|
expectedSessionKeyGen?: string;
|
|
100
105
|
encryptionVersion?: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quantiya/codevibe-core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
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",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"scripts": {
|
|
17
17
|
"typecheck": "tsc --noEmit",
|
|
18
18
|
"emit-types": "tsc --emitDeclarationOnly",
|
|
19
|
-
"build": "rm -rf dist && npm run emit-types && esbuild src/index.ts --bundle --platform=node --target=node18 --minify --packages=external --outfile=dist/index.js && esbuild src/orchestration-shell/cli.ts --bundle --platform=node --target=node18 --packages=external --outfile=dist/orchestration-shell/cli.js --banner:js=\"#!/usr/bin/env node\" && npm run verify-no-test-hooks",
|
|
20
|
-
"verify-no-test-hooks": "if grep -
|
|
19
|
+
"build": "rm -rf dist && npm run emit-types && esbuild src/index.ts --bundle --platform=node --target=node18 --minify --packages=external --define:__CODEVIBE_TEST_BUILD__=false --outfile=dist/index.js && esbuild src/orchestration-shell/cli.ts --bundle --platform=node --target=node18 --minify-syntax --packages=external --define:__CODEVIBE_TEST_BUILD__=false --outfile=dist/orchestration-shell/cli.js --banner:js=\"#!/usr/bin/env node\" && npm run verify-no-test-hooks",
|
|
20
|
+
"verify-no-test-hooks": "if grep -ERl 'CODEVIBE_TEST_FORCE_QUOTA_FAIL|CODEVIBE_TEST_FORCE_IMPLEMENTOR_AGENT|CODEVIBE_ANCHORED_PUBLICATION_AUTHORITY_ROOT|codevibe-anchored-publications-|cv-publication-authority-vitest-|codevibe\\.test\\.publication-authority-|setPublicationAuthorityRootForTestBuild|__CODEVIBE_TEST_BUILD__' dist; then echo 'ERROR: a test-only hook leaked into a published artifact (prod-unreachability invariant)'; exit 1; fi; echo 'OK — no test-only hooks in published artifacts'",
|
|
21
21
|
"clean": "rm -rf dist",
|
|
22
22
|
"prepublishOnly": "npm run build",
|
|
23
23
|
"test": "vitest run",
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A minimal synthetic `config` written into the proxy. Repository-format
|
|
3
|
-
* version + bare=false ONLY — explicitly NO `[remote ...]`, NO `[credential]`,
|
|
4
|
-
* NO `core.hooksPath`, NO `[user]` (which could carry a signing key path). This
|
|
5
|
-
* is the credential-scrub: the real repo's config never enters the sandbox.
|
|
6
|
-
*/
|
|
7
|
-
export declare const SCRUBBED_CONFIG: string;
|
|
8
|
-
/**
|
|
9
|
-
* Resolve the real parent `.git` directory for a worktree. In a worktree the
|
|
10
|
-
* `<workdir>/.git` is a FILE: `gitdir: /abs/path/to/parent/.git/worktrees/<n>`.
|
|
11
|
-
* The commit objects live in the parent repo's top-level `.git` (i.e. two
|
|
12
|
-
* levels up from `worktrees/<n>`). For a NON-worktree checkout `<workdir>/.git`
|
|
13
|
-
* is already the real dir. Returns the directory that holds `objects/` +
|
|
14
|
-
* `refs/`.
|
|
15
|
-
*
|
|
16
|
-
* @returns the resolved real git-common-dir, or `null` if `<workdir>/.git` is
|
|
17
|
-
* absent/unreadable (the caller skips proxying — a non-git workdir is fine).
|
|
18
|
-
*/
|
|
19
|
-
export declare function resolveGitCommonDir(workdir: string): Promise<string | null>;
|
|
20
|
-
/**
|
|
21
|
-
* Build a read-only, credential-scrubbed `.git` proxy at `destDir` from the
|
|
22
|
-
* resolved git-common-dir. **[W2-min]** — copies only {@link COPIED_GIT_ENTRIES}
|
|
23
|
-
* + a synthetic stripped {@link SCRUBBED_CONFIG}; NO remotes/creds/hooks/reflog.
|
|
24
|
-
*
|
|
25
|
-
* The substrate bind-mounts `destDir` READ-ONLY into the sandbox at
|
|
26
|
-
* `<workdir>/.git`. Returns the proxy path on success, or `null` if `workdir`
|
|
27
|
-
* is not a resolvable git checkout (the substrate then mounts only the worktree
|
|
28
|
-
* with no `.git`, and git read commands simply report "not a repository" — no
|
|
29
|
-
* ambient exposure either way).
|
|
30
|
-
*/
|
|
31
|
-
export declare function buildScrubbedGitProxy(workdir: string, destDir: string): Promise<string | null>;
|
|
32
|
-
export declare const __testing: {
|
|
33
|
-
COPIED_GIT_ENTRIES: readonly ["HEAD", "refs", "packed-refs", "objects"];
|
|
34
|
-
SCRUBBED_CONFIG: string;
|
|
35
|
-
};
|
|
File without changes
|