session-peer 0.3.6 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +6 -4
- package/PARITY.md +431 -6
- package/README.ja.md +14 -8
- package/README.ko.md +14 -8
- package/README.md +14 -8
- package/README.zh-CN.md +14 -8
- package/RELEASING.md +109 -0
- package/VALIDATION.md +806 -1
- package/dist/app-server.d.ts +207 -0
- package/dist/app-server.js +1044 -0
- package/dist/cli.js +229 -39
- package/dist/handoff-ledger.d.ts +103 -0
- package/dist/handoff-ledger.js +791 -0
- package/dist/handoff-observer-probe.d.ts +1 -0
- package/dist/handoff-observer-probe.js +170 -0
- package/dist/handoff-operations.d.ts +29 -0
- package/dist/handoff-operations.js +496 -0
- package/dist/handoff-writer-probe.d.ts +1 -0
- package/dist/handoff-writer-probe.js +146 -0
- package/dist/handoff.d.ts +112 -0
- package/dist/handoff.js +261 -0
- package/dist/help.js +18 -0
- package/dist/linux-native-probe.d.ts +1 -0
- package/dist/linux-native-probe.js +51 -0
- package/dist/linux-proc.d.ts +55 -0
- package/dist/linux-proc.js +150 -0
- package/dist/metadata-observation.d.ts +49 -0
- package/dist/metadata-observation.js +250 -0
- package/dist/native-profiles.d.ts +25 -0
- package/dist/native-profiles.js +62 -0
- package/dist/output.js +7 -1
- package/dist/process.d.ts +28 -0
- package/dist/process.js +284 -2
- package/dist/protocol.d.ts +2 -2
- package/dist/protocol.js +1 -1
- package/dist/send.d.ts +18 -1
- package/dist/send.js +91 -6
- package/dist/skill-metadata.js +7 -4
- package/dist/ssh-response.d.ts +11 -0
- package/dist/ssh-response.js +78 -2
- package/dist/ssh.d.ts +2 -1
- package/dist/ssh.js +37 -2
- package/dist/windows.d.ts +28 -0
- package/dist/windows.js +149 -1
- package/docs/api.md +255 -4
- package/docs/design/typescript-skill-compatibility.md +55 -2
- package/docs/guide.ja.md +36 -16
- package/docs/guide.ko.md +39 -19
- package/docs/guide.md +46 -20
- package/docs/guide.zh-CN.md +36 -16
- package/docs/shorthand.md +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import type { Readable, Writable } from 'node:stream';
|
|
2
|
+
import { type NativeProfile } from './native-profiles.js';
|
|
3
|
+
import { type ProcReader } from './linux-proc.js';
|
|
4
|
+
export declare const APP_SERVER_EVIDENCE: Readonly<{
|
|
5
|
+
version: "0.160.1";
|
|
6
|
+
inspectedPlatform: "darwin-arm64";
|
|
7
|
+
officialSourceCommit: "d27764b82f7118f674371e6d6e76271d9d606edb";
|
|
8
|
+
scope: "generated_schema_only";
|
|
9
|
+
queueAddParamsSha256: "60f25b7d3e3357c215bef9d2fe7047200f545e030dca9e00527ac0620cd0c88f";
|
|
10
|
+
queueAddResponseSha256: "c11b9772788427b19c9f9decf0765e2b41cbdead1aa9c3d39f42fdd70b339314";
|
|
11
|
+
itemStartedSha256: "7574788d2a352747f50d44be3ef649011cb8de8069da4c655faff14d0aee32c4";
|
|
12
|
+
turnCompletedSha256: "016870158603b0f84bd9f8f65f927161c9fd5128e5ec632087616462dc44e085";
|
|
13
|
+
}>;
|
|
14
|
+
export declare const APP_SERVER_QUEUE_EVIDENCE: readonly (Readonly<{
|
|
15
|
+
version: "0.160.1";
|
|
16
|
+
inspectedPlatform: "darwin-arm64";
|
|
17
|
+
officialSourceCommit: "d27764b82f7118f674371e6d6e76271d9d606edb";
|
|
18
|
+
scope: "generated_schema_only";
|
|
19
|
+
queueAddParamsSha256: "60f25b7d3e3357c215bef9d2fe7047200f545e030dca9e00527ac0620cd0c88f";
|
|
20
|
+
queueAddResponseSha256: "c11b9772788427b19c9f9decf0765e2b41cbdead1aa9c3d39f42fdd70b339314";
|
|
21
|
+
itemStartedSha256: "7574788d2a352747f50d44be3ef649011cb8de8069da4c655faff14d0aee32c4";
|
|
22
|
+
turnCompletedSha256: "016870158603b0f84bd9f8f65f927161c9fd5128e5ec632087616462dc44e085";
|
|
23
|
+
}> | Readonly<{
|
|
24
|
+
version: "0.162.1";
|
|
25
|
+
inspectedPlatform: "darwin-arm64";
|
|
26
|
+
officialSourceCommit: "092d3acd6bec3e3a14bdc7e7a2810ab628ab759d";
|
|
27
|
+
scope: "generated_schema_only";
|
|
28
|
+
queueAddParamsSha256: "60f25b7d3e3357c215bef9d2fe7047200f545e030dca9e00527ac0620cd0c88f";
|
|
29
|
+
queueAddResponseSha256: "c11b9772788427b19c9f9decf0765e2b41cbdead1aa9c3d39f42fdd70b339314";
|
|
30
|
+
itemStartedSha256: "692c5876f44a4c12a9b9211912860ceddb65d34497ab4fe9aa46cbebe1a63166";
|
|
31
|
+
turnCompletedSha256: "69413578ec3ecd02691424bdeb9d640c7244b4ca4c5c3ef26f69a2efe7c37db8";
|
|
32
|
+
}> | Readonly<{
|
|
33
|
+
version: "0.162.1";
|
|
34
|
+
inspectedPlatform: "linux-arm64";
|
|
35
|
+
officialSourceCommit: "092d3acd6bec3e3a14bdc7e7a2810ab628ab759d";
|
|
36
|
+
scope: "generated_schema_only";
|
|
37
|
+
queueAddParamsSha256: "60f25b7d3e3357c215bef9d2fe7047200f545e030dca9e00527ac0620cd0c88f";
|
|
38
|
+
queueAddResponseSha256: "c11b9772788427b19c9f9decf0765e2b41cbdead1aa9c3d39f42fdd70b339314";
|
|
39
|
+
itemStartedSha256: "692c5876f44a4c12a9b9211912860ceddb65d34497ab4fe9aa46cbebe1a63166";
|
|
40
|
+
turnCompletedSha256: "69413578ec3ecd02691424bdeb9d640c7244b4ca4c5c3ef26f69a2efe7c37db8";
|
|
41
|
+
}>)[];
|
|
42
|
+
export declare const APP_SERVER_LIMITS: Readonly<{
|
|
43
|
+
frameBytes: 65536;
|
|
44
|
+
receivedBytes: number;
|
|
45
|
+
sentBytes: number;
|
|
46
|
+
frames: 512;
|
|
47
|
+
notifications: 256;
|
|
48
|
+
requests: 16;
|
|
49
|
+
observations: 64;
|
|
50
|
+
messageBytes: 32768;
|
|
51
|
+
lifetimeMs: 60000;
|
|
52
|
+
cleanupMs: 250;
|
|
53
|
+
}>;
|
|
54
|
+
export type AppServerScope = Readonly<{
|
|
55
|
+
codexHome: string;
|
|
56
|
+
threadId: string;
|
|
57
|
+
generation: string;
|
|
58
|
+
ownerIdentity: string;
|
|
59
|
+
}>;
|
|
60
|
+
export type AppServerContext = Readonly<{
|
|
61
|
+
version: string;
|
|
62
|
+
platform: string;
|
|
63
|
+
scope: AppServerScope;
|
|
64
|
+
}>;
|
|
65
|
+
export type AppServerCapability = {
|
|
66
|
+
supported: false;
|
|
67
|
+
schema: 'version_qualified' | 'version_unqualified';
|
|
68
|
+
route: 'route_unsupported';
|
|
69
|
+
reason: 'metadata_only_owner_route_unvalidated' | 'version_unqualified';
|
|
70
|
+
attempted: false;
|
|
71
|
+
queueSupported: boolean;
|
|
72
|
+
};
|
|
73
|
+
export declare function appServerCapability(context: AppServerContext): AppServerCapability;
|
|
74
|
+
export declare function connectAppServer(context: AppServerContext, _open: () => Promise<MetadataOnlyTransport>, _deadlineMs: number): Promise<AppServerCapability>;
|
|
75
|
+
export type AppServerFaultCode = 'invalid_scope' | 'invalid_input' | 'unsupported_transport' | 'deadline' | 'owner_changed' | 'frame_invalid' | 'frame_limit' | 'traffic_limit' | 'notification_limit' | 'request_limit' | 'connection_closed' | 'write_failed' | 'remote_refused' | 'already_attempted' | 'unsupported_version' | 'effect_guard_failed' | 'storage_binding_unverified';
|
|
76
|
+
export declare class AppServerFault extends Error {
|
|
77
|
+
readonly code: AppServerFaultCode;
|
|
78
|
+
readonly attempted: boolean;
|
|
79
|
+
readonly fallbackEligible: boolean;
|
|
80
|
+
constructor(code: AppServerFaultCode, attempted: boolean);
|
|
81
|
+
}
|
|
82
|
+
export type MetadataOnlyTransport = {
|
|
83
|
+
qualification: 'hermetic_fixture_only';
|
|
84
|
+
input: Readable;
|
|
85
|
+
output: Writable;
|
|
86
|
+
close: () => Promise<void>;
|
|
87
|
+
};
|
|
88
|
+
type NativeQueueTransport = Omit<MetadataOnlyTransport, 'qualification'> & {
|
|
89
|
+
qualification: 'native_queue_only_stdio';
|
|
90
|
+
pid?: number;
|
|
91
|
+
};
|
|
92
|
+
export type NativeQueuePort = Pick<AppServerPort, 'queueOnce' | 'close'>;
|
|
93
|
+
export type NativeQueueOptions = {
|
|
94
|
+
binary: string;
|
|
95
|
+
scope: AppServerScope;
|
|
96
|
+
message: string;
|
|
97
|
+
clientUserMessageId: string;
|
|
98
|
+
deadlineMs: number;
|
|
99
|
+
verifyOwner: (scope: AppServerScope) => Promise<boolean>;
|
|
100
|
+
beforeEffect: () => Promise<void>;
|
|
101
|
+
env?: NodeJS.ProcessEnv;
|
|
102
|
+
};
|
|
103
|
+
export declare function nativeQueueCapability(context: AppServerContext): {
|
|
104
|
+
queueSupported: boolean;
|
|
105
|
+
observationSupported: false;
|
|
106
|
+
qualification: 'mechanics_from_isolated_fixture' | 'unsupported';
|
|
107
|
+
reason: 'queue_only' | 'version_unqualified';
|
|
108
|
+
};
|
|
109
|
+
export declare const NATIVE_QUEUE_NOTIFICATION_OPTOUTS: readonly string[];
|
|
110
|
+
export declare const NATIVE_QUEUE_01621_NOTIFICATION_OPTOUTS: readonly string[];
|
|
111
|
+
export type MetadataEvent = {
|
|
112
|
+
kind: 'injected';
|
|
113
|
+
scope: AppServerScope;
|
|
114
|
+
clientUserMessageId: string;
|
|
115
|
+
itemId: string;
|
|
116
|
+
turnId: string;
|
|
117
|
+
} | {
|
|
118
|
+
kind: 'turn';
|
|
119
|
+
scope: AppServerScope;
|
|
120
|
+
clientUserMessageId: string;
|
|
121
|
+
turnId: string;
|
|
122
|
+
status: 'running' | 'completed' | 'failed' | 'interrupted' | 'unknown';
|
|
123
|
+
};
|
|
124
|
+
export type MetadataObservation = {
|
|
125
|
+
injectionObserved: boolean;
|
|
126
|
+
clientUserMessageId?: string;
|
|
127
|
+
turn?: {
|
|
128
|
+
id: string;
|
|
129
|
+
status: 'running' | 'completed' | 'failed' | 'interrupted' | 'unknown';
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
export interface AppServerPort {
|
|
133
|
+
queueOnce(input: {
|
|
134
|
+
clientUserMessageId: string;
|
|
135
|
+
message: string;
|
|
136
|
+
}): Promise<{
|
|
137
|
+
queueId: string;
|
|
138
|
+
clientUserMessageId: string;
|
|
139
|
+
}>;
|
|
140
|
+
observe(clientUserMessageId: string): Promise<MetadataObservation>;
|
|
141
|
+
close(): Promise<void>;
|
|
142
|
+
}
|
|
143
|
+
export declare function parseMetadataEvent(value: unknown, original: AppServerScope): MetadataEvent;
|
|
144
|
+
export declare class BoundedAppServerClient implements AppServerPort {
|
|
145
|
+
readonly scope: AppServerScope;
|
|
146
|
+
private readonly transport;
|
|
147
|
+
private readonly deadlineMs;
|
|
148
|
+
private readonly verifyOwner;
|
|
149
|
+
private readonly nativeQueue;
|
|
150
|
+
private readonly beforeEffect;
|
|
151
|
+
private readonly pending;
|
|
152
|
+
private readonly observers;
|
|
153
|
+
private readonly operations;
|
|
154
|
+
private buffer;
|
|
155
|
+
private received;
|
|
156
|
+
private sent;
|
|
157
|
+
private frames;
|
|
158
|
+
private notifications;
|
|
159
|
+
private requests;
|
|
160
|
+
private reserved;
|
|
161
|
+
private attempted;
|
|
162
|
+
private clientId?;
|
|
163
|
+
private observations;
|
|
164
|
+
private observed;
|
|
165
|
+
private injectedItemId?;
|
|
166
|
+
private fault?;
|
|
167
|
+
private closing?;
|
|
168
|
+
private readonly timer;
|
|
169
|
+
private constructor();
|
|
170
|
+
static connectMetadataFixture(scope: AppServerScope, transport: MetadataOnlyTransport, deadlineMs: number, verifyOwner: (scope: AppServerScope) => Promise<boolean>): Promise<BoundedAppServerClient>;
|
|
171
|
+
static connectNativeQueueFixture(scope: AppServerScope, transport: MetadataOnlyTransport, deadlineMs: number, verifyOwner: (scope: AppServerScope) => Promise<boolean>, beforeEffect: () => Promise<void>, nativeVersion?: string, platform?: string, profiles?: readonly NativeProfile[]): Promise<NativeQueuePort>;
|
|
172
|
+
static connectNativeQueueWire(scope: AppServerScope, transport: NativeQueueTransport, deadlineMs: number, verifyOwner: (scope: AppServerScope) => Promise<boolean>, beforeEffect: () => Promise<void>, profile: NativeProfile): Promise<NativeQueuePort>;
|
|
173
|
+
private static connectWire;
|
|
174
|
+
private check;
|
|
175
|
+
private owner;
|
|
176
|
+
private bounded;
|
|
177
|
+
private readonly ended;
|
|
178
|
+
private readonly errored;
|
|
179
|
+
private readonly writeErrored;
|
|
180
|
+
private readonly receive;
|
|
181
|
+
private frame;
|
|
182
|
+
private notification;
|
|
183
|
+
private request;
|
|
184
|
+
queueOnce(input: {
|
|
185
|
+
clientUserMessageId: string;
|
|
186
|
+
message: string;
|
|
187
|
+
}): Promise<{
|
|
188
|
+
queueId: string;
|
|
189
|
+
clientUserMessageId: string;
|
|
190
|
+
}>;
|
|
191
|
+
private snapshot;
|
|
192
|
+
observe(clientUserMessageId: string): Promise<MetadataObservation>;
|
|
193
|
+
private fail;
|
|
194
|
+
close(): Promise<void>;
|
|
195
|
+
}
|
|
196
|
+
export declare function artifactDigest(path: string, deadlineMs: number, maxBytes?: number): Promise<string>;
|
|
197
|
+
export declare function verifyProcfsSqliteBinding(pid: number | undefined, home: string, deadlineMs: number, binary: string, reader?: ProcReader): Promise<void>;
|
|
198
|
+
export declare function nativeQueueOnce(options: NativeQueueOptions): Promise<{
|
|
199
|
+
queueId: string;
|
|
200
|
+
clientUserMessageId: string;
|
|
201
|
+
}>;
|
|
202
|
+
export declare function nativeQueueOnceWithProfiles(options: NativeQueueOptions, table: readonly NativeProfile[]): Promise<{
|
|
203
|
+
queueId: string;
|
|
204
|
+
clientUserMessageId: string;
|
|
205
|
+
}>;
|
|
206
|
+
export declare function spawnOwnedMetadataFixture(binary: string, args: string[], env: NodeJS.ProcessEnv): MetadataOnlyTransport;
|
|
207
|
+
export {};
|