@vibesdotdev/agent-execution 0.0.0-stage → 1.0.0-rc.1
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/LICENSE +18 -0
- package/README.md +53 -2
- package/dist/code-session/agent-code-session.consumer.descriptor.d.ts +68 -0
- package/dist/code-session/agent-code-session.consumer.descriptor.d.ts.map +1 -0
- package/dist/code-session/agent-code-session.consumer.descriptor.js +31 -0
- package/dist/code-session/agent-code-session.consumer.descriptor.js.map +1 -0
- package/dist/code-session/agent-code-session.consumer.plugin.d.ts +18 -0
- package/dist/code-session/agent-code-session.consumer.plugin.d.ts.map +1 -0
- package/dist/code-session/agent-code-session.consumer.plugin.js +47 -0
- package/dist/code-session/agent-code-session.consumer.plugin.js.map +1 -0
- package/dist/code-session/agent-code-session.descriptor.d.ts +163 -0
- package/dist/code-session/agent-code-session.descriptor.d.ts.map +1 -0
- package/dist/code-session/agent-code-session.descriptor.js +129 -0
- package/dist/code-session/agent-code-session.descriptor.js.map +1 -0
- package/dist/code-session/agent-code-session.impl.consumer.d.ts +224 -0
- package/dist/code-session/agent-code-session.impl.consumer.d.ts.map +1 -0
- package/dist/code-session/agent-code-session.impl.consumer.js +2131 -0
- package/dist/code-session/agent-code-session.impl.consumer.js.map +1 -0
- package/dist/code-session/agent-code-session.kind.d.ts +15 -0
- package/dist/code-session/agent-code-session.kind.d.ts.map +1 -0
- package/dist/code-session/agent-code-session.kind.js +17 -0
- package/dist/code-session/agent-code-session.kind.js.map +1 -0
- package/dist/code-session/agent-code-session.plugin.d.ts +17 -0
- package/dist/code-session/agent-code-session.plugin.d.ts.map +1 -0
- package/dist/code-session/agent-code-session.plugin.js +28 -0
- package/dist/code-session/agent-code-session.plugin.js.map +1 -0
- package/dist/code-session/billing/gates.d.ts +52 -0
- package/dist/code-session/billing/gates.d.ts.map +1 -0
- package/dist/code-session/billing/gates.js +75 -0
- package/dist/code-session/billing/gates.js.map +1 -0
- package/dist/code-session/client/index.d.ts +2 -0
- package/dist/code-session/client/index.d.ts.map +1 -0
- package/dist/code-session/client/index.js +2 -0
- package/dist/code-session/client/index.js.map +1 -0
- package/dist/code-session/client/resolve.d.ts +20 -0
- package/dist/code-session/client/resolve.d.ts.map +1 -0
- package/dist/code-session/client/resolve.js +145 -0
- package/dist/code-session/client/resolve.js.map +1 -0
- package/dist/code-session/docs/agent-code-session.docs.descriptor.d.ts +4 -0
- package/dist/code-session/docs/agent-code-session.docs.descriptor.d.ts.map +1 -0
- package/dist/code-session/docs/agent-code-session.docs.descriptor.js +109 -0
- package/dist/code-session/docs/agent-code-session.docs.descriptor.js.map +1 -0
- package/dist/code-session/git-credential.d.ts +87 -0
- package/dist/code-session/git-credential.d.ts.map +1 -0
- package/dist/code-session/git-credential.js +107 -0
- package/dist/code-session/git-credential.js.map +1 -0
- package/dist/code-session/host-target.d.ts +76 -0
- package/dist/code-session/host-target.d.ts.map +1 -0
- package/dist/code-session/host-target.js +81 -0
- package/dist/code-session/host-target.js.map +1 -0
- package/dist/code-session/index.d.ts +20 -0
- package/dist/code-session/index.d.ts.map +1 -0
- package/dist/code-session/index.js +20 -0
- package/dist/code-session/index.js.map +1 -0
- package/dist/code-session/interfaces/code-session.d.ts +448 -0
- package/dist/code-session/interfaces/code-session.d.ts.map +1 -0
- package/dist/code-session/interfaces/code-session.js +373 -0
- package/dist/code-session/interfaces/code-session.js.map +1 -0
- package/dist/code-session/operation-lease.d.ts +48 -0
- package/dist/code-session/operation-lease.d.ts.map +1 -0
- package/dist/code-session/operation-lease.js +73 -0
- package/dist/code-session/operation-lease.js.map +1 -0
- package/dist/code-session/remote-setup-custody.d.ts +59 -0
- package/dist/code-session/remote-setup-custody.d.ts.map +1 -0
- package/dist/code-session/remote-setup-custody.js +78 -0
- package/dist/code-session/remote-setup-custody.js.map +1 -0
- package/dist/code-session/remote-workspace-fs.d.ts +119 -0
- package/dist/code-session/remote-workspace-fs.d.ts.map +1 -0
- package/dist/code-session/remote-workspace-fs.js +257 -0
- package/dist/code-session/remote-workspace-fs.js.map +1 -0
- package/dist/code-session/session-metadata.d.ts +40 -0
- package/dist/code-session/session-metadata.d.ts.map +1 -0
- package/dist/code-session/session-metadata.js +69 -0
- package/dist/code-session/session-metadata.js.map +1 -0
- package/dist/code-session-relay/agent-code-session-relay.descriptor.d.ts +78 -0
- package/dist/code-session-relay/agent-code-session-relay.descriptor.d.ts.map +1 -0
- package/dist/code-session-relay/agent-code-session-relay.descriptor.js +38 -0
- package/dist/code-session-relay/agent-code-session-relay.descriptor.js.map +1 -0
- package/dist/code-session-relay/agent-code-session-relay.impl.d.ts +120 -0
- package/dist/code-session-relay/agent-code-session-relay.impl.d.ts.map +1 -0
- package/dist/code-session-relay/agent-code-session-relay.impl.js +1392 -0
- package/dist/code-session-relay/agent-code-session-relay.impl.js.map +1 -0
- package/dist/code-session-relay/agent-code-session-relay.plugin.d.ts +14 -0
- package/dist/code-session-relay/agent-code-session-relay.plugin.d.ts.map +1 -0
- package/dist/code-session-relay/agent-code-session-relay.plugin.js +25 -0
- package/dist/code-session-relay/agent-code-session-relay.plugin.js.map +1 -0
- package/dist/code-session-relay/index.d.ts +13 -0
- package/dist/code-session-relay/index.d.ts.map +1 -0
- package/dist/code-session-relay/index.js +13 -0
- package/dist/code-session-relay/index.js.map +1 -0
- package/dist/code-session-relay/relay-dial.d.ts +72 -0
- package/dist/code-session-relay/relay-dial.d.ts.map +1 -0
- package/dist/code-session-relay/relay-dial.js +177 -0
- package/dist/code-session-relay/relay-dial.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/sandbox/agent-sandbox.consumer.descriptor.d.ts +35 -0
- package/dist/sandbox/agent-sandbox.consumer.descriptor.d.ts.map +1 -0
- package/dist/sandbox/agent-sandbox.consumer.descriptor.js +19 -0
- package/dist/sandbox/agent-sandbox.consumer.descriptor.js.map +1 -0
- package/dist/sandbox/agent-sandbox.consumer.plugin.d.ts +9 -0
- package/dist/sandbox/agent-sandbox.consumer.plugin.d.ts.map +1 -0
- package/dist/sandbox/agent-sandbox.consumer.plugin.js +33 -0
- package/dist/sandbox/agent-sandbox.consumer.plugin.js.map +1 -0
- package/dist/sandbox/agent-sandbox.descriptor.d.ts +76 -0
- package/dist/sandbox/agent-sandbox.descriptor.d.ts.map +1 -0
- package/dist/sandbox/agent-sandbox.descriptor.js +57 -0
- package/dist/sandbox/agent-sandbox.descriptor.js.map +1 -0
- package/dist/sandbox/agent-sandbox.impl.consumer.d.ts +15 -0
- package/dist/sandbox/agent-sandbox.impl.consumer.d.ts.map +1 -0
- package/dist/sandbox/agent-sandbox.impl.consumer.js +23 -0
- package/dist/sandbox/agent-sandbox.impl.consumer.js.map +1 -0
- package/dist/sandbox/agent-sandbox.kind.d.ts +14 -0
- package/dist/sandbox/agent-sandbox.kind.d.ts.map +1 -0
- package/dist/sandbox/agent-sandbox.kind.js +16 -0
- package/dist/sandbox/agent-sandbox.kind.js.map +1 -0
- package/dist/sandbox/agent-sandbox.plugin.d.ts +15 -0
- package/dist/sandbox/agent-sandbox.plugin.d.ts.map +1 -0
- package/dist/sandbox/agent-sandbox.plugin.js +25 -0
- package/dist/sandbox/agent-sandbox.plugin.js.map +1 -0
- package/dist/sandbox/client/resolve.d.ts +21 -0
- package/dist/sandbox/client/resolve.d.ts.map +1 -0
- package/dist/sandbox/client/resolve.js +103 -0
- package/dist/sandbox/client/resolve.js.map +1 -0
- package/dist/sandbox/docs/agent-sandbox.docs.descriptor.d.ts +4 -0
- package/dist/sandbox/docs/agent-sandbox.docs.descriptor.d.ts.map +1 -0
- package/dist/sandbox/docs/agent-sandbox.docs.descriptor.js +75 -0
- package/dist/sandbox/docs/agent-sandbox.docs.descriptor.js.map +1 -0
- package/dist/sandbox/index.d.ts +15 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/index.js +14 -0
- package/dist/sandbox/index.js.map +1 -0
- package/dist/sandbox/interfaces/sandbox.d.ts +61 -0
- package/dist/sandbox/interfaces/sandbox.d.ts.map +1 -0
- package/dist/sandbox/interfaces/sandbox.js +54 -0
- package/dist/sandbox/interfaces/sandbox.js.map +1 -0
- package/dist/schemas/code-session-resolution.d.ts +20 -0
- package/dist/schemas/code-session-resolution.d.ts.map +1 -0
- package/dist/schemas/code-session-resolution.js +11 -0
- package/dist/schemas/code-session-resolution.js.map +1 -0
- package/dist/schemas/session-operation.d.ts +73 -0
- package/dist/schemas/session-operation.d.ts.map +1 -0
- package/dist/schemas/session-operation.js +47 -0
- package/dist/schemas/session-operation.js.map +1 -0
- package/dist/schemas/voice.d.ts +87 -0
- package/dist/schemas/voice.d.ts.map +1 -0
- package/dist/schemas/voice.js +70 -0
- package/dist/schemas/voice.js.map +1 -0
- package/dist/voice/agent-voice.consumer.descriptor.d.ts +43 -0
- package/dist/voice/agent-voice.consumer.descriptor.d.ts.map +1 -0
- package/dist/voice/agent-voice.consumer.descriptor.js +20 -0
- package/dist/voice/agent-voice.consumer.descriptor.js.map +1 -0
- package/dist/voice/agent-voice.consumer.plugin.d.ts +4 -0
- package/dist/voice/agent-voice.consumer.plugin.d.ts.map +1 -0
- package/dist/voice/agent-voice.consumer.plugin.js +13 -0
- package/dist/voice/agent-voice.consumer.plugin.js.map +1 -0
- package/dist/voice/agent-voice.descriptor.d.ts +82 -0
- package/dist/voice/agent-voice.descriptor.d.ts.map +1 -0
- package/dist/voice/agent-voice.descriptor.js +79 -0
- package/dist/voice/agent-voice.descriptor.js.map +1 -0
- package/dist/voice/agent-voice.impl.consumer.d.ts +35 -0
- package/dist/voice/agent-voice.impl.consumer.d.ts.map +1 -0
- package/dist/voice/agent-voice.impl.consumer.js +50 -0
- package/dist/voice/agent-voice.impl.consumer.js.map +1 -0
- package/dist/voice/agent-voice.kind.d.ts +67 -0
- package/dist/voice/agent-voice.kind.d.ts.map +1 -0
- package/dist/voice/agent-voice.kind.js +26 -0
- package/dist/voice/agent-voice.kind.js.map +1 -0
- package/dist/voice/agent-voice.plugin.d.ts +4 -0
- package/dist/voice/agent-voice.plugin.d.ts.map +1 -0
- package/dist/voice/agent-voice.plugin.js +18 -0
- package/dist/voice/agent-voice.plugin.js.map +1 -0
- package/dist/voice/client.d.ts +38 -0
- package/dist/voice/client.d.ts.map +1 -0
- package/dist/voice/client.js +29 -0
- package/dist/voice/client.js.map +1 -0
- package/dist/voice/index.d.ts +14 -0
- package/dist/voice/index.d.ts.map +1 -0
- package/dist/voice/index.js +14 -0
- package/dist/voice/index.js.map +1 -0
- package/dist/voice/pipeline.d.ts +66 -0
- package/dist/voice/pipeline.d.ts.map +1 -0
- package/dist/voice/pipeline.js +330 -0
- package/dist/voice/pipeline.js.map +1 -0
- package/dist/voice/session.d.ts +29 -0
- package/dist/voice/session.d.ts.map +1 -0
- package/dist/voice/session.js +78 -0
- package/dist/voice/session.js.map +1 -0
- package/package.json +279 -4
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consumer Agent Code Session — runtime-routed impl (WS3)
|
|
3
|
+
*
|
|
4
|
+
* A *persistent* code session: unlike the throwaway `agent/sandbox`, the
|
|
5
|
+
* workspace under the active Vibes profile SURVIVES across calls until
|
|
6
|
+
* an explicit `teardown`. Lifecycle:
|
|
7
|
+
*
|
|
8
|
+
* initialize → clone repo (git CLI) into the persistent workspace, register
|
|
9
|
+
* session metadata so `attach` can resume.
|
|
10
|
+
* attach → resume a known session (rehydrate from the metadata store).
|
|
11
|
+
* runCommand→ foreground (capture stdout/stderr/exit) OR background (a
|
|
12
|
+
* long-lived process handle kept in an in-process registry).
|
|
13
|
+
* read/write/patch → file ops scoped under the workspace root.
|
|
14
|
+
* gitStatus/Commit/Push → git CLI in the workspace.
|
|
15
|
+
* exposePort → record a port + return a localhost preview URL.
|
|
16
|
+
* teardown → kill background procs, remove the persistent workspace.
|
|
17
|
+
*
|
|
18
|
+
* All file ops route through the `filesystem/adapter` kind and all command
|
|
19
|
+
* execution through the `runtime/execution` kind (consumer impls back both):
|
|
20
|
+
* one-shot git/foreground commands use `execute()`; a long-lived background
|
|
21
|
+
* process uses `spawn()` and keeps its `ProcessHandle` live in an in-process
|
|
22
|
+
* registry. Raw `node:fs` / `Bun.spawn` are NOT used here — the impl stays
|
|
23
|
+
* swappable.
|
|
24
|
+
*
|
|
25
|
+
* Env is composed through the handed runtime's `composeChildEnv`: only host essentials +
|
|
26
|
+
* the caller's explicit env are forwarded; nothing from the host's own environment leaks
|
|
27
|
+
* into session processes.
|
|
28
|
+
*
|
|
29
|
+
* MVP host routing: a `{ kind:'host', hostId }` target runs LOCALLY (on this
|
|
30
|
+
* consumer worker/daemon). Dispatching to a *specific remote* Host daemon by
|
|
31
|
+
* `hostId` is a documented follow-up — the `hostId` is recorded on the session
|
|
32
|
+
* handle so a future remote-dispatch layer can target it.
|
|
33
|
+
*/
|
|
34
|
+
import { type RuntimeRef } from '@vibesdotdev/kernel';
|
|
35
|
+
import type { RuntimeDescriptor } from '@vibesdotdev/kernel/schemas/descriptor';
|
|
36
|
+
import type { KindContext } from '@vibesdotdev/kernel/schemas/kind';
|
|
37
|
+
import { type AgentCodeSessionDescriptor } from './agent-code-session.descriptor.ts';
|
|
38
|
+
import type { BackgroundProcessInfo, BackgroundProcessOutput, BackgroundProcessReadInput, BackgroundProcessWaitInput, CodeSessionCreateOrGetInput, CodeSessionHandle, CodeSessionInterface, CodeSessionInitializeInput, GitApplyInput, GitApplyResult, GitCommitInput, GitCommitOptions, GitCommitResult, GitPushInput, GitStatusResult, ExposePortInput, ExposePortResult, PatchFileInput, PushCredentialResolver, RunCommandInput, RunCommandResult } from './interfaces/code-session.ts';
|
|
39
|
+
export declare class ConsumerCodeSession implements CodeSessionInterface {
|
|
40
|
+
readonly descriptor: AgentCodeSessionDescriptor;
|
|
41
|
+
/** In-process session registry, keyed by sessionId — backs `attach`. */
|
|
42
|
+
private readonly sessions;
|
|
43
|
+
/** Live background procs per session. */
|
|
44
|
+
private readonly background;
|
|
45
|
+
/** Host-supplied resolver for a push credential keyed by repositoryId. */
|
|
46
|
+
private pushCredentialResolver?;
|
|
47
|
+
/** In-flight attach-on-demand attempts, keyed by sessionId — collapses concurrent callers onto one attach. */
|
|
48
|
+
private readonly attachInFlight;
|
|
49
|
+
/** Cached remote execution handles per non-local hostId (fleet wire). */
|
|
50
|
+
private readonly remotes;
|
|
51
|
+
private readonly remoteActiveHomes;
|
|
52
|
+
/** Cached remote workspace filesystem adapters per non-local hostId (fleet wire). */
|
|
53
|
+
private readonly remoteFilesystems;
|
|
54
|
+
/**
|
|
55
|
+
* Same-process create retries collapse before they reach the durable operation
|
|
56
|
+
* ledger. Claims are registered synchronously, keyed by the trimmed operation
|
|
57
|
+
* id, so call order is claim order regardless of when hashing finishes.
|
|
58
|
+
*/
|
|
59
|
+
private readonly operationInFlight;
|
|
60
|
+
/** Serializes git add/commit per git repository root so concurrent sessions never collide on .git/index.lock. */
|
|
61
|
+
private readonly gitCommitQueues;
|
|
62
|
+
private readonly runtime;
|
|
63
|
+
private readonly activeHome;
|
|
64
|
+
constructor(descriptor: AgentCodeSessionDescriptor, runtime: RuntimeRef);
|
|
65
|
+
/** This session's logger, on the runtime that owns it. */
|
|
66
|
+
private get log();
|
|
67
|
+
private now;
|
|
68
|
+
private nowIso;
|
|
69
|
+
/** Local control records stay under this runtime's active profile. */
|
|
70
|
+
private sessionRoot;
|
|
71
|
+
private targetSessionRoot;
|
|
72
|
+
/** The temp root of the host a session runs on, from that host's path roots. */
|
|
73
|
+
private targetTempRoot;
|
|
74
|
+
setPushCredentialResolver(resolver: PushCredentialResolver): void;
|
|
75
|
+
/** Workspace-local process state belongs to the control root, not source files.
|
|
76
|
+
* Keep a private home across reattachments without inheriting host credentials.
|
|
77
|
+
* TMPDIR lives under the host's temp root with a short name, so sockets bound
|
|
78
|
+
* under it fit the platform's socket path limit.
|
|
79
|
+
*/
|
|
80
|
+
private processEnvironment;
|
|
81
|
+
private seedGitAuthorIdentity;
|
|
82
|
+
/**
|
|
83
|
+
* Resolve the `runtime/execution` impl for a session's host target.
|
|
84
|
+
*
|
|
85
|
+
* THE JOIN (D-THE-JOIN): a `{ kind:'host', hostId }` target with a NON-local
|
|
86
|
+
* hostId reaches THAT host's execution impl over the fleet wire via
|
|
87
|
+
* `getVibesRemoteFrom(runtime, hostId)` (the proven path — fleet-daemon
|
|
88
|
+
* `reach-over-daemon.test.ts`). Local + default targets keep resolving the
|
|
89
|
+
* in-process impl exactly as before. There is NO silent local fallback: an
|
|
90
|
+
* unreachable host throws a precise, actionable error.
|
|
91
|
+
*/
|
|
92
|
+
private execution;
|
|
93
|
+
/**
|
|
94
|
+
* Reach a remote host's `runtime/execution` over the fleet `runtime/rpc`
|
|
95
|
+
* wire. A `RemoteRuntime` pins its socket, so one connection per hostId is
|
|
96
|
+
* cached and reused across a session's commands; a failed resolve is dropped
|
|
97
|
+
* from the cache so a later call can retry once the host is paired.
|
|
98
|
+
*/
|
|
99
|
+
private remoteRuntime;
|
|
100
|
+
/**
|
|
101
|
+
* Spawn on the session's host. With `setup`, cancellation is checked after
|
|
102
|
+
* every pre-dispatch await: a cancelled setup returns `null` and dispatches
|
|
103
|
+
* nothing. A remote dispatch is owned by an acquisition retained in this
|
|
104
|
+
* runtime's custody (plugin `onDispose` drains it), so a late port is killed
|
|
105
|
+
* once and observed rather than abandoned.
|
|
106
|
+
*/
|
|
107
|
+
private spawnOnHost;
|
|
108
|
+
private spawnBackground;
|
|
109
|
+
/**
|
|
110
|
+
* Reach a remote host's workspace `filesystem/adapter` over the fleet
|
|
111
|
+
* `runtime/rpc` wire (UNIT-B3 / D-DAEMON-CLIENT), mirroring
|
|
112
|
+
* {@link remoteExecution}. One connection per hostId is cached and reused; a
|
|
113
|
+
* failed resolve is dropped so a later call can retry once the host is paired.
|
|
114
|
+
*/
|
|
115
|
+
private remoteFilesystem;
|
|
116
|
+
private resolveRemoteFilesystem;
|
|
117
|
+
/**
|
|
118
|
+
* Resolve the LOCAL read/write filesystem adapter (the consumer's own disk);
|
|
119
|
+
* throw clearly if absent. This backs the session CONTROL ROOT (persisted
|
|
120
|
+
* metadata, borrowed bookkeeping, discovery) which always lives on THIS host,
|
|
121
|
+
* never a remote workspace. Workspace file ops use {@link workspaceFilesystem}.
|
|
122
|
+
*/
|
|
123
|
+
private filesystem;
|
|
124
|
+
/**
|
|
125
|
+
* Resolve the filesystem that backs a session's WORKSPACE. A `{ kind:'host',
|
|
126
|
+
* hostId }` target with a NON-local hostId reaches THAT host's workspace over
|
|
127
|
+
* the fleet wire (UNIT-B3, mirroring {@link execution}); local + default + cloud
|
|
128
|
+
* targets keep resolving the in-process adapter. There is NO silent local
|
|
129
|
+
* fallback: an unreachable host throws a precise, actionable error.
|
|
130
|
+
*/
|
|
131
|
+
private workspaceFilesystem;
|
|
132
|
+
/**
|
|
133
|
+
* Resolve a session's metadata, attempting attach-on-demand exactly once if
|
|
134
|
+
* the id is unknown IN THIS PROCESS: a session initialized by a prior process
|
|
135
|
+
* on this host persisted its metadata under the profile-owned session root (see
|
|
136
|
+
* `attach()`), so a cold process can still serve it. Concurrent calls for the
|
|
137
|
+
* same unknown id collapse onto a single attach attempt via `attachInFlight`.
|
|
138
|
+
*/
|
|
139
|
+
/**
|
|
140
|
+
* The same trust gate `initialize()` enforces, applied to every path that
|
|
141
|
+
* can hand out a workspace (attach / attach-on-demand). Without it, a
|
|
142
|
+
* below-threshold descriptor that could never CREATE a session could still
|
|
143
|
+
* run commands in one persisted by a higher-trust composition.
|
|
144
|
+
*/
|
|
145
|
+
private requireTrust;
|
|
146
|
+
private ensureSession;
|
|
147
|
+
private requireReadySession;
|
|
148
|
+
private metadataPath;
|
|
149
|
+
private borrowedMetadataPath;
|
|
150
|
+
private operationRoot;
|
|
151
|
+
private operationDirectory;
|
|
152
|
+
private operationRecordPath;
|
|
153
|
+
private operationLeaseDirectory;
|
|
154
|
+
private readOperationLease;
|
|
155
|
+
private withOperationLease;
|
|
156
|
+
private readOperationRecord;
|
|
157
|
+
private writeOperationRecord;
|
|
158
|
+
private prepareOperation;
|
|
159
|
+
private persistSessionMetadata;
|
|
160
|
+
/** Local discovery contains identity only; the remote workspace owns full metadata. */
|
|
161
|
+
private persistRemotePointer;
|
|
162
|
+
private cleanupPath;
|
|
163
|
+
private readControlMetadata;
|
|
164
|
+
private loadPersistedSessionMeta;
|
|
165
|
+
/**
|
|
166
|
+
* Reattach exactly one requested pre-profile local session.
|
|
167
|
+
*
|
|
168
|
+
* This intentionally never participates in discover(): profile isolation
|
|
169
|
+
* remains the default and no new profile absorbs the process-global legacy
|
|
170
|
+
* roster. A successful match is copied into this profile as BORROWED, so
|
|
171
|
+
* teardown cannot delete legacy workspace bytes that may still be referenced
|
|
172
|
+
* by an older process.
|
|
173
|
+
*/
|
|
174
|
+
private reattachLegacyLocalSession;
|
|
175
|
+
/**
|
|
176
|
+
* Run a one-shot command, capturing output. Used internally for git ops.
|
|
177
|
+
*
|
|
178
|
+
* Uses `runtime/execution`'s `spawn()` mode + self-drain rather than
|
|
179
|
+
* `execute()` on purpose: this method owns a distinct timeout contract
|
|
180
|
+
* (SIGTERM kill, forced `exitCode:null`, and an explicit
|
|
181
|
+
* `[code-session] aborted after …` stderr suffix) that `execute()`'s
|
|
182
|
+
* SIGKILL/137 + no-suffix semantics would change. Keeping spawn()+drain
|
|
183
|
+
* preserves the exact consumer-observable behavior the characterization
|
|
184
|
+
* tests pin.
|
|
185
|
+
*/
|
|
186
|
+
private exec;
|
|
187
|
+
initialize(input: CodeSessionInitializeInput): Promise<CodeSessionHandle>;
|
|
188
|
+
createOrGet(input: CodeSessionCreateOrGetInput): Promise<CodeSessionHandle>;
|
|
189
|
+
private createOrGetOnce;
|
|
190
|
+
attach(sessionId: string): Promise<CodeSessionHandle>;
|
|
191
|
+
discover(): Promise<CodeSessionHandle[]>;
|
|
192
|
+
runCommand(sessionId: string, input: RunCommandInput): Promise<RunCommandResult>;
|
|
193
|
+
listBackgroundProcesses(sessionId: string): Promise<BackgroundProcessInfo[]>;
|
|
194
|
+
/**
|
|
195
|
+
* Keep one background stream's chunks in the entry's ring until the stream
|
|
196
|
+
* ends. Disposal joins owned work before plugins tear sessions down, so the
|
|
197
|
+
* read stops when disposal begins instead of holding it for a live process.
|
|
198
|
+
*/
|
|
199
|
+
private drainBackground;
|
|
200
|
+
private backgroundEntry;
|
|
201
|
+
readBackgroundProcess(sessionId: string, procId: string, input?: BackgroundProcessReadInput): Promise<BackgroundProcessOutput>;
|
|
202
|
+
waitBackgroundProcess(sessionId: string, procId: string, input: BackgroundProcessWaitInput): Promise<BackgroundProcessOutput>;
|
|
203
|
+
stopBackgroundProcess(sessionId: string, procId: string, signal?: string): Promise<boolean>;
|
|
204
|
+
pause(sessionId: string): Promise<CodeSessionHandle>;
|
|
205
|
+
resume(sessionId: string): Promise<CodeSessionHandle>;
|
|
206
|
+
readFile(sessionId: string, path: string): Promise<string>;
|
|
207
|
+
writeFile(sessionId: string, path: string, content: string): Promise<void>;
|
|
208
|
+
patchFile(sessionId: string, input: PatchFileInput): Promise<void>;
|
|
209
|
+
gitApply(sessionId: string, input: GitApplyInput): Promise<GitApplyResult>;
|
|
210
|
+
gitStatus(sessionId: string): Promise<GitStatusResult>;
|
|
211
|
+
private withGitRepoLock;
|
|
212
|
+
private resolveGitRootForPaths;
|
|
213
|
+
gitCommit(sessionId: string, input: GitCommitInput, options?: GitCommitOptions): Promise<GitCommitResult>;
|
|
214
|
+
gitPush(sessionId: string, input?: GitPushInput): Promise<void>;
|
|
215
|
+
exposePort(sessionId: string, input: ExposePortInput): Promise<ExposePortResult>;
|
|
216
|
+
teardown(sessionId: string): Promise<void>;
|
|
217
|
+
private toHandle;
|
|
218
|
+
}
|
|
219
|
+
declare class ConsumerCodeSessionImpl extends ConsumerCodeSession {
|
|
220
|
+
constructor(descriptor: RuntimeDescriptor | AgentCodeSessionDescriptor, context: KindContext);
|
|
221
|
+
}
|
|
222
|
+
declare const _default: import("@vibesdotdev/kernel").RuntimeImplementationWrapper<typeof ConsumerCodeSessionImpl>;
|
|
223
|
+
export default _default;
|
|
224
|
+
//# sourceMappingURL=agent-code-session.impl.consumer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-code-session.impl.consumer.d.ts","sourceRoot":"","sources":["../../src/code-session/agent-code-session.impl.consumer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAIH,OAAO,EAWN,KAAK,UAAU,EAEf,MAAM,qBAAqB,CAAC;AAU7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAUpE,OAAO,EAGN,KAAK,0BAA0B,EAE/B,MAAM,oCAAoC,CAAC;AAI5C,OAAO,KAAK,EACX,qBAAqB,EACrB,uBAAuB,EACvB,0BAA0B,EAC1B,0BAA0B,EAC1B,2BAA2B,EAC3B,iBAAiB,EACjB,oBAAoB,EACpB,0BAA0B,EAC1B,aAAa,EACb,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,cAAc,EAEd,sBAAsB,EACtB,eAAe,EACf,gBAAgB,EAChB,MAAM,8BAA8B,CAAC;AA+StC,qBAAa,mBAAoB,YAAW,oBAAoB;IA8B9D,QAAQ,CAAC,UAAU,EAAE,0BAA0B;IA7BhD,wEAAwE;IACxE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkC;IAC3D,yCAAyC;IACzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAuC;IAClE,0EAA0E;IAC1E,OAAO,CAAC,sBAAsB,CAAC,CAAyB;IACxD,8GAA8G;IAC9G,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAkD;IACjF,yEAAyE;IACzE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA6C;IACrE,OAAO,CAAC,QAAQ,CA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