@celljs/ta-protocol 4.5.0 → 4.6.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/README.md +6 -5
- package/esm/common/auth-protocol.d.ts +89 -0
- package/esm/common/auth-protocol.js +3 -0
- package/esm/common/auth-protocol.js.map +1 -0
- package/esm/common/index.d.ts +6 -0
- package/esm/common/index.js +6 -0
- package/esm/common/index.js.map +1 -1
- package/esm/common/package-protocol.d.ts +92 -0
- package/esm/common/package-protocol.js +3 -0
- package/esm/common/package-protocol.js.map +1 -0
- package/esm/common/pi-types.d.ts +1 -0
- package/esm/common/relay-protocol.d.ts +28 -0
- package/esm/common/relay-protocol.js +3 -0
- package/esm/common/relay-protocol.js.map +1 -0
- package/esm/common/settings-protocol.d.ts +42 -0
- package/esm/common/settings-protocol.js +22 -0
- package/esm/common/settings-protocol.js.map +1 -0
- package/esm/common/ta-extension-host.d.ts +44 -0
- package/esm/common/ta-extension-host.js +8 -0
- package/esm/common/ta-extension-host.js.map +1 -0
- package/esm/common/ta-protocol.d.ts +110 -8
- package/esm/common/ta-protocol.js +21 -0
- package/esm/common/ta-protocol.js.map +1 -1
- package/esm/common/workspace-protocol.d.ts +91 -0
- package/esm/common/workspace-protocol.js +7 -0
- package/esm/common/workspace-protocol.js.map +1 -0
- package/lib/common/auth-protocol.d.ts +90 -0
- package/lib/common/auth-protocol.d.ts.map +1 -0
- package/lib/common/auth-protocol.js +6 -0
- package/lib/common/auth-protocol.js.map +1 -0
- package/lib/common/index.d.ts +6 -0
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +6 -0
- package/lib/common/index.js.map +1 -1
- package/lib/common/package-protocol.d.ts +93 -0
- package/lib/common/package-protocol.d.ts.map +1 -0
- package/lib/common/package-protocol.js +6 -0
- package/lib/common/package-protocol.js.map +1 -0
- package/lib/common/pi-types.d.ts +1 -0
- package/lib/common/pi-types.d.ts.map +1 -1
- package/lib/common/relay-protocol.d.ts +29 -0
- package/lib/common/relay-protocol.d.ts.map +1 -0
- package/lib/common/relay-protocol.js +6 -0
- package/lib/common/relay-protocol.js.map +1 -0
- package/lib/common/settings-protocol.d.ts +43 -0
- package/lib/common/settings-protocol.d.ts.map +1 -0
- package/lib/common/settings-protocol.js +25 -0
- package/lib/common/settings-protocol.js.map +1 -0
- package/lib/common/ta-extension-host.d.ts +45 -0
- package/lib/common/ta-extension-host.d.ts.map +1 -0
- package/lib/common/ta-extension-host.js +11 -0
- package/lib/common/ta-extension-host.js.map +1 -0
- package/lib/common/ta-protocol.d.ts +110 -8
- package/lib/common/ta-protocol.d.ts.map +1 -1
- package/lib/common/ta-protocol.js +22 -1
- package/lib/common/ta-protocol.js.map +1 -1
- package/lib/common/ta-protocol.spec.js +21 -0
- package/lib/common/ta-protocol.spec.js.map +1 -1
- package/lib/common/workspace-protocol.d.ts +92 -0
- package/lib/common/workspace-protocol.d.ts.map +1 -0
- package/lib/common/workspace-protocol.js +10 -0
- package/lib/common/workspace-protocol.js.map +1 -0
- package/package.json +1 -1
- package/src/common/auth-protocol.ts +56 -0
- package/src/common/index.ts +6 -0
- package/src/common/package-protocol.ts +99 -0
- package/src/common/pi-types.ts +1 -0
- package/src/common/relay-protocol.ts +28 -0
- package/src/common/settings-protocol.ts +66 -0
- package/src/common/ta-extension-host.ts +52 -0
- package/src/common/ta-protocol.spec.ts +30 -1
- package/src/common/ta-protocol.ts +123 -7
- package/src/common/workspace-protocol.ts +102 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pi-types.d.ts","sourceRoot":"","sources":["../../src/common/pi-types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GAAG,OAAO,uBAAuB,EAAU,UAAE,iBAAiB,EAAE,QAAQ,IAAE,EAAG,YAAY,CAAC;AAClH,MAAM,MAAM,qBAAqB,GAAG,OAAO,iCAAiC,EAAU,UAAE,iBAAiB,EAAE,QAAQ,IAAE,EAAG,qBAAqB,CAAC;AAC9I,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CAAiC,EAAU,UAAE,iBAAiB,EAAE,QAAQ,IAAE,EAAG,WAAW,CAAC;AAC1H,MAAM,MAAM,eAAe,GAAG,OAAO,iCAAiC,EAAU,UAAE,iBAAiB,EAAE,QAAQ,IAAE,EAAG,eAAe,CAAC;AAClI,MAAM,MAAM,YAAY,GAAG,OAAO,iCAAiC,EAAU,UAAE,iBAAiB,EAAE,QAAQ,IAAE,EAAG,YAAY,CAAC;AAC5H,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const TaRelayServer: unique symbol;
|
|
2
|
+
export declare const TA_RELAY_SERVICE = "TaRelayServer";
|
|
3
|
+
/** A device paired with this ta serve, which reaches it through a relay (@celljs/ta-relay). */
|
|
4
|
+
export interface TaRelayDevice {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
createdAt: number;
|
|
8
|
+
}
|
|
9
|
+
export interface TaRelayInfo {
|
|
10
|
+
/** The relay of the devices; none before the first is paired. */
|
|
11
|
+
relay?: string;
|
|
12
|
+
/** The relay a new pairing uses when the user names none. */
|
|
13
|
+
defaultRelay: string;
|
|
14
|
+
/** ta serve is connected to the relay now: the devices can reach it. */
|
|
15
|
+
online: boolean;
|
|
16
|
+
devices: TaRelayDevice[];
|
|
17
|
+
}
|
|
18
|
+
/** Pairing devices from a client, as `ta pair` does in a terminal. */
|
|
19
|
+
export interface TaRelayServer {
|
|
20
|
+
getRelay(): Promise<TaRelayInfo>;
|
|
21
|
+
/** A new device; `link` holds its key, for the device only: show it once (a QR code), do not keep it. */
|
|
22
|
+
pair(relay: string, name: string): Promise<{
|
|
23
|
+
link: string;
|
|
24
|
+
device: TaRelayDevice;
|
|
25
|
+
}>;
|
|
26
|
+
/** The device can no longer reach this ta serve, at once. */
|
|
27
|
+
unpair(deviceId: string): Promise<void>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=relay-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-protocol.d.ts","sourceRoot":"","sources":["../../src/common/relay-protocol.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,eAA0B,CAAC;AACrD,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAEhD,+FAA+F;AAC/F,MAAM,WAAW,aAAa;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,WAAW;IACxB,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,YAAY,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED,sEAAsE;AACtE,MAAM,WAAW,aAAa;IAC1B,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;IACjC,yGAAyG;IACzG,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,aAAa,CAAA;KAAE,CAAC,CAAC;IACpF,6DAA6D;IAC7D,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TA_RELAY_SERVICE = exports.TaRelayServer = void 0;
|
|
4
|
+
exports.TaRelayServer = Symbol('TaRelayServer');
|
|
5
|
+
exports.TA_RELAY_SERVICE = 'TaRelayServer';
|
|
6
|
+
//# sourceMappingURL=relay-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relay-protocol.js","sourceRoot":"","sources":["../../src/common/relay-protocol.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AACxC,QAAA,gBAAgB,GAAG,eAAe,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const TaSettingsServer: unique symbol;
|
|
2
|
+
export declare const TA_SETTINGS_SERVICE = "TaSettingsServer";
|
|
3
|
+
/** Where a setting of ta is kept: pi's `settings.json` of the user (the agent directory), or of a project (`.ta/` of its directory), which wins. */
|
|
4
|
+
export type TaSettingsScope = 'user' | 'project';
|
|
5
|
+
/** A setting of ta that clients show and change; the key is its path in pi's `settings.json`. */
|
|
6
|
+
export interface TaSettingSpec {
|
|
7
|
+
key: string;
|
|
8
|
+
/** `model`: `<provider>/<model id>`, kept by pi as `defaultProvider` and `defaultModel`. */
|
|
9
|
+
type: 'boolean' | 'number' | 'string' | 'enum' | 'model';
|
|
10
|
+
values?: readonly string[];
|
|
11
|
+
/** What pi does when no file sets it; none when pi decides by itself (the model, a thinking level). */
|
|
12
|
+
default?: boolean | number | string;
|
|
13
|
+
}
|
|
14
|
+
/** The settings of ta that clients change, as pi names them; other keys of the files are left as they are. */
|
|
15
|
+
export declare const TA_SETTINGS: readonly TaSettingSpec[];
|
|
16
|
+
/** The settings of ta (TA_SETTINGS) in the files of the user and of a project: only the keys each file sets. */
|
|
17
|
+
export interface TaSettingsSnapshot {
|
|
18
|
+
user: Record<string, unknown>;
|
|
19
|
+
project: Record<string, unknown>;
|
|
20
|
+
/** The directory of the project. */
|
|
21
|
+
cwd: string;
|
|
22
|
+
userFile: string;
|
|
23
|
+
projectFile: string;
|
|
24
|
+
/**
|
|
25
|
+
* pi reads the settings of a project only when the user trusts it. Changing them from a client trusts a
|
|
26
|
+
* project that has nothing else to trust yet; one with extensions or skills of its own is trusted in `ta`.
|
|
27
|
+
*/
|
|
28
|
+
projectTrusted: boolean;
|
|
29
|
+
/** `<provider>/<model id>` of the models with credentials, for the model setting. */
|
|
30
|
+
models: string[];
|
|
31
|
+
}
|
|
32
|
+
/** The settings of ta in pi's `settings.json` files, on the same WebSocket as {@link TaServer}. */
|
|
33
|
+
export interface TaSettingsServer {
|
|
34
|
+
/** The settings of ta (TA_SETTINGS) of the user and of the project in `cwd` (default: the server's directory). */
|
|
35
|
+
getSettings(cwd?: string): Promise<TaSettingsSnapshot>;
|
|
36
|
+
/**
|
|
37
|
+
* Sets settings of ta in one file, by key of TA_SETTINGS; `null` removes a key, so that the project
|
|
38
|
+
* follows the user and the user pi's default. Open sessions read them again; the model and the thinking
|
|
39
|
+
* level are for new sessions.
|
|
40
|
+
*/
|
|
41
|
+
updateSettings(scope: TaSettingsScope, changes: Record<string, unknown>, cwd?: string): Promise<TaSettingsSnapshot>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=settings-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-protocol.d.ts","sourceRoot":"","sources":["../../src/common/settings-protocol.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAC3D,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AAEtD,oJAAoJ;AACpJ,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,SAAS,CAAC;AAEjD,iGAAiG;AACjG,MAAM,WAAW,aAAa;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,4FAA4F;IAC5F,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IACzD,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,uGAAuG;IACvG,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;CACvC;AAED,8GAA8G;AAC9G,eAAO,MAAM,WAAW,EAAE,SAAS,aAAa,EAiB/C,CAAC;AAEF,gHAAgH;AAChH,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,oCAAoC;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,cAAc,EAAE,OAAO,CAAC;IACxB,qFAAqF;IACrF,MAAM,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,mGAAmG;AACnG,MAAM,WAAW,gBAAgB;IAC7B,kHAAkH;IAClH,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACvD;;;;OAIG;IACH,cAAc,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CACvH"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TA_SETTINGS = exports.TA_SETTINGS_SERVICE = exports.TaSettingsServer = void 0;
|
|
4
|
+
exports.TaSettingsServer = Symbol('TaSettingsServer');
|
|
5
|
+
exports.TA_SETTINGS_SERVICE = 'TaSettingsServer';
|
|
6
|
+
/** The settings of ta that clients change, as pi names them; other keys of the files are left as they are. */
|
|
7
|
+
exports.TA_SETTINGS = [
|
|
8
|
+
{ key: 'model', type: 'model' },
|
|
9
|
+
{ key: 'defaultThinkingLevel', type: 'enum', values: ['off', 'minimal', 'low', 'medium', 'high', 'xhigh', 'max'] },
|
|
10
|
+
{ key: 'transport', type: 'enum', values: ['auto', 'sse', 'websocket', 'websocket-cached'], default: 'auto' },
|
|
11
|
+
{ key: 'steeringMode', type: 'enum', values: ['one-at-a-time', 'all'], default: 'one-at-a-time' },
|
|
12
|
+
{ key: 'followUpMode', type: 'enum', values: ['one-at-a-time', 'all'], default: 'one-at-a-time' },
|
|
13
|
+
{ key: 'compaction.enabled', type: 'boolean', default: true },
|
|
14
|
+
{ key: 'compaction.reserveTokens', type: 'number', default: 16384 },
|
|
15
|
+
{ key: 'compaction.keepRecentTokens', type: 'number', default: 20000 },
|
|
16
|
+
{ key: 'retry.enabled', type: 'boolean', default: true },
|
|
17
|
+
{ key: 'retry.maxRetries', type: 'number', default: 3 },
|
|
18
|
+
{ key: 'codemode.mode', type: 'enum', values: ['only', 'on'], default: 'only' },
|
|
19
|
+
{ key: 'enableSkillCommands', type: 'boolean', default: true },
|
|
20
|
+
{ key: 'images.autoResize', type: 'boolean', default: true },
|
|
21
|
+
{ key: 'images.blockImages', type: 'boolean', default: false },
|
|
22
|
+
{ key: 'shellPath', type: 'string' },
|
|
23
|
+
{ key: 'shellCommandPrefix', type: 'string' },
|
|
24
|
+
];
|
|
25
|
+
//# sourceMappingURL=settings-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-protocol.js","sourceRoot":"","sources":["../../src/common/settings-protocol.ts"],"names":[],"mappings":";;;AAEa,QAAA,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAC9C,QAAA,mBAAmB,GAAG,kBAAkB,CAAC;AAetD,8GAA8G;AACjG,QAAA,WAAW,GAA6B;IACjD,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE;IAC/B,EAAE,GAAG,EAAE,sBAAsB,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE;IAClH,EAAE,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,kBAAkB,CAAC,EAAE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AE,QAAQ,EAAE;CAChD,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { TaPackageServer } from './package-protocol';
|
|
2
|
+
import type { TaServer } from './ta-protocol';
|
|
3
|
+
/**
|
|
4
|
+
* What `ta serve` gives the server side of a package: the sessions and the data of packages, in its own
|
|
5
|
+
* process, without a token. A subset of TaServer and TaPackageServer: it can open and drive sessions, not
|
|
6
|
+
* close or remove anything.
|
|
7
|
+
*/
|
|
8
|
+
export interface TaExtensionHost extends Pick<TaServer, 'getServerInfo' | 'listSessions' | 'openSession' | 'setSessionName' | 'prompt' | 'followUp' | 'getState' | 'getLastAssistantText'>, Pick<TaPackageServer, 'getExtensionData' | 'setExtensionData' | 'listPackages'> {
|
|
9
|
+
/** The agent directory of Ta (`~/.ta/agent`): its `extensions/` holds the packages of the user. */
|
|
10
|
+
readonly agentDir: string;
|
|
11
|
+
/** Keys of the data of a package that changed, by a page or by the server, as they change; `cwd` for a key of a directory. */
|
|
12
|
+
onExtensionData(listener: (name: string, key: string, cwd?: string) => void): () => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* What the module of `pi.host` returns: anything the package's pi extensions should reach. Its web
|
|
16
|
+
* extension calls its methods with TaPackageServer.callPackageHost, with JSON values.
|
|
17
|
+
*/
|
|
18
|
+
export interface TaPackageService {
|
|
19
|
+
/** `ta serve` stops, or the package is turned off. */
|
|
20
|
+
dispose?(): void | Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The default export of a module that a package names in `pi.host` of its package.json. `ta serve` runs it
|
|
24
|
+
* once when it starts (or when the package is turned on), for built-in packages; `ta` without `serve`
|
|
25
|
+
* does not run it.
|
|
26
|
+
*/
|
|
27
|
+
export type TaPackageHostFactory = (host: TaExtensionHost) => TaPackageService | undefined | Promise<TaPackageService | undefined>;
|
|
28
|
+
/**
|
|
29
|
+
* The event of pi's `pi.events` by which a pi extension asks for the host of its package:
|
|
30
|
+
* `pi.events.emit(TA_HOST_EVENT, { name, resolve })`. Under `ta serve` `resolve` is called at once, if
|
|
31
|
+
* the extension asks after loading (on `session_start`, or in a tool); under `ta` alone nobody answers,
|
|
32
|
+
* and the extension should say its tools need `ta serve`.
|
|
33
|
+
*/
|
|
34
|
+
export declare const TA_HOST_EVENT = "ta:host";
|
|
35
|
+
export interface TaHostRequest {
|
|
36
|
+
/** The `name` of the package.json. */
|
|
37
|
+
name: string;
|
|
38
|
+
resolve(answer: TaHostAnswer): void;
|
|
39
|
+
}
|
|
40
|
+
export interface TaHostAnswer {
|
|
41
|
+
host: TaExtensionHost;
|
|
42
|
+
/** What the module of `pi.host` of the package returned; undefined when it has none or failed. */
|
|
43
|
+
service?: TaPackageService;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=ta-extension-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ta-extension-host.d.ts","sourceRoot":"","sources":["../../src/common/ta-extension-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;GAIG;AACH,MAAM,WAAW,eACb,SAAQ,IAAI,CAAC,QAAQ,EAAE,eAAe,GAAG,cAAc,GAAG,aAAa,GAAG,gBAAgB,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,sBAAsB,CAAC,EACrJ,IAAI,CAAC,eAAe,EAAE,kBAAkB,GAAG,kBAAkB,GAAG,cAAc,CAAC;IACnF,mGAAmG;IACnG,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,8HAA8H;IAC9H,eAAe,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CAC5F;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC7B,sDAAsD;IACtD,OAAO,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpC;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE,eAAe,KAAK,gBAAgB,GAAG,SAAS,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAAC;AAEnI;;;;;GAKG;AACH,eAAO,MAAM,aAAa,YAAY,CAAC;AAEvC,MAAM,WAAW,aAAa;IAC1B,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,eAAe,CAAC;IACtB,kGAAkG;IAClG,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC9B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TA_HOST_EVENT = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The event of pi's `pi.events` by which a pi extension asks for the host of its package:
|
|
6
|
+
* `pi.events.emit(TA_HOST_EVENT, { name, resolve })`. Under `ta serve` `resolve` is called at once, if
|
|
7
|
+
* the extension asks after loading (on `session_start`, or in a tool); under `ta` alone nobody answers,
|
|
8
|
+
* and the extension should say its tools need `ta serve`.
|
|
9
|
+
*/
|
|
10
|
+
exports.TA_HOST_EVENT = 'ta:host';
|
|
11
|
+
//# sourceMappingURL=ta-extension-host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ta-extension-host.js","sourceRoot":"","sources":["../../src/common/ta-extension-host.ts"],"names":[],"mappings":";;;AAiCA;;;;;GAKG;AACU,QAAA,aAAa,GAAG,SAAS,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TaAuthEvent } from './auth-protocol';
|
|
2
|
+
import type { ImageContent, JsonAgentSessionEvent, RpcCommand, RpcExtensionUIRequest, RpcExtensionUIResponse, RpcResponse, ThinkingLevel } from './pi-types';
|
|
2
3
|
export declare const TaServer: unique symbol;
|
|
3
4
|
export declare const TaClient: unique symbol;
|
|
4
5
|
/** Path of the WebSocket endpoint of `ta serve`, and the JSON-RPC method prefixes of both sides. */
|
|
@@ -13,6 +14,16 @@ export interface TaServeInfo {
|
|
|
13
14
|
token: string;
|
|
14
15
|
pid: number;
|
|
15
16
|
}
|
|
17
|
+
/** What a client needs to know of the server before it opens a session. */
|
|
18
|
+
export interface TaServerInfo {
|
|
19
|
+
/** The version of ta. */
|
|
20
|
+
version: string;
|
|
21
|
+
/**
|
|
22
|
+
* Where a client opens a session when the user names no directory: the one set with
|
|
23
|
+
* `setWorkingDirectory`, else the working directory of `ta serve`, or of its execution environment.
|
|
24
|
+
*/
|
|
25
|
+
cwd: string;
|
|
26
|
+
}
|
|
16
27
|
/** The stable `code` of each failure of a {@link TaServer} call. */
|
|
17
28
|
export declare const TaErrorCode: {
|
|
18
29
|
readonly SESSION_NOT_FOUND: 'CELL_TA_SESSION_NOT_FOUND';
|
|
@@ -22,6 +33,10 @@ export declare const TaErrorCode: {
|
|
|
22
33
|
readonly MODEL_NOT_FOUND: 'CELL_TA_MODEL_NOT_FOUND';
|
|
23
34
|
readonly INVALID_ARGUMENT: 'CELL_TA_INVALID_ARGUMENT';
|
|
24
35
|
readonly COMMAND_FAILED: 'CELL_TA_COMMAND_FAILED';
|
|
36
|
+
/** No provider of models is signed in for the model, or there is no model: sign in (TaAuthServer) first. */
|
|
37
|
+
readonly NOT_SIGNED_IN: 'CELL_TA_NOT_SIGNED_IN';
|
|
38
|
+
/** Raised by the client, not the server: the call could not reach ta serve, or its answer was lost with the connection. */
|
|
39
|
+
readonly CONNECTION_LOST: 'CELL_TA_CONNECTION_LOST';
|
|
25
40
|
};
|
|
26
41
|
export type TaErrorCode = (typeof TaErrorCode)[keyof typeof TaErrorCode];
|
|
27
42
|
/** The JSON-RPC error code of every failure of a {@link TaServer} call; `data.code` tells them apart. */
|
|
@@ -35,6 +50,22 @@ export interface TaErrorData {
|
|
|
35
50
|
export type TaCommand = Extract<RpcResponse, {
|
|
36
51
|
success: true;
|
|
37
52
|
}>['command'];
|
|
53
|
+
/** The answer to `forkToFile`. */
|
|
54
|
+
export interface TaForkFileResult {
|
|
55
|
+
/** The new conversation; none when nothing comes before the message: then a new conversation starts. */
|
|
56
|
+
sessionFile?: string;
|
|
57
|
+
/** The message of the user left out (`before`), for the box of the new conversation. */
|
|
58
|
+
text?: string;
|
|
59
|
+
}
|
|
60
|
+
/** The answer to `navigateTree`, which pi's RPC mode does not have. */
|
|
61
|
+
export interface TaNavigateResult {
|
|
62
|
+
cancelled: boolean;
|
|
63
|
+
editorText?: string;
|
|
64
|
+
}
|
|
65
|
+
/** `get_state` → `getState`. */
|
|
66
|
+
type CamelCase<S extends string> = S extends `${infer Head}_${infer Tail}` ? `${Head}${Capitalize<CamelCase<Tail>>}` : S;
|
|
67
|
+
/** The method of TaServer for each command of pi's RPC mode: TaServer has one for each (see its spec). */
|
|
68
|
+
export type PiCommandMethod = CamelCase<RpcCommand['type']>;
|
|
38
69
|
/** What pi's RPC mode answers to a command. */
|
|
39
70
|
export type TaCommandResult<C extends TaCommand> = Extract<RpcResponse, {
|
|
40
71
|
command: C;
|
|
@@ -42,10 +73,12 @@ export type TaCommandResult<C extends TaCommand> = Extract<RpcResponse, {
|
|
|
42
73
|
}> extends {
|
|
43
74
|
data: infer D;
|
|
44
75
|
} ? D : undefined;
|
|
76
|
+
/** A tool the client runs: the model calls it like any other tool, the server asks the client for the result. */
|
|
45
77
|
export interface TaClientToolDefinition {
|
|
78
|
+
/** Letters, digits, `_` and `-`, starting with a letter; best not the name of another tool of the session. */
|
|
46
79
|
name: string;
|
|
47
80
|
description: string;
|
|
48
|
-
/** JSON schema of the arguments. */
|
|
81
|
+
/** JSON schema of the arguments, an object schema. */
|
|
49
82
|
parameters: Record<string, unknown>;
|
|
50
83
|
}
|
|
51
84
|
export interface TaOpenSessionOptions {
|
|
@@ -58,6 +91,10 @@ export interface TaOpenSessionOptions {
|
|
|
58
91
|
thinkingLevel?: ThinkingLevel;
|
|
59
92
|
/** Tools the client runs; fixed when the session opens, so the tool list stays stable for prompt caching. */
|
|
60
93
|
clientTools?: TaClientToolDefinition[];
|
|
94
|
+
/** Added to the system prompt, as pi's `--append-system-prompt`: a role the client gives the agent. */
|
|
95
|
+
appendSystemPrompt?: string;
|
|
96
|
+
/** Sessions a package opens for its own work (the name of the package): clients list them apart, folded. */
|
|
97
|
+
group?: string;
|
|
61
98
|
}
|
|
62
99
|
export interface TaSessionInfo {
|
|
63
100
|
/** The id of this open session; stays the same through `newSession`, `switchSession` and `fork`. */
|
|
@@ -67,6 +104,8 @@ export interface TaSessionInfo {
|
|
|
67
104
|
cwd: string;
|
|
68
105
|
sessionFile?: string;
|
|
69
106
|
sessionName?: string;
|
|
107
|
+
/** The first line of the first message of the user, which a list shows when the session has no name. */
|
|
108
|
+
firstMessage?: string;
|
|
70
109
|
/** `<provider>/<model id>`. */
|
|
71
110
|
model?: string;
|
|
72
111
|
isStreaming: boolean;
|
|
@@ -74,8 +113,13 @@ export interface TaSessionInfo {
|
|
|
74
113
|
/** Number of clients attached. */
|
|
75
114
|
attached: number;
|
|
76
115
|
createdAt: number;
|
|
116
|
+
/** When the last message came; `createdAt` before the first. */
|
|
117
|
+
updatedAt: number;
|
|
118
|
+
/** TaOpenSessionOptions.group. */
|
|
119
|
+
group?: string;
|
|
77
120
|
}
|
|
78
121
|
export interface TaPromptInput {
|
|
122
|
+
/** May start with a block of context for the model, which clients do not show: see {@link TaMessageContext}. */
|
|
79
123
|
message: string;
|
|
80
124
|
images?: ImageContent[];
|
|
81
125
|
/** Chosen by the client, unique per message: sending the same one again does not run it again. */
|
|
@@ -83,6 +127,15 @@ export interface TaPromptInput {
|
|
|
83
127
|
/** What to do when the agent is running; only for `prompt`. Default: `followUp`. */
|
|
84
128
|
streamingBehavior?: 'steer' | 'followUp';
|
|
85
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* A message of the user may start with a `<context>` block: what the model reads besides the message
|
|
132
|
+
* (where it is said, who is there, what was said before), which a client leaves out when it shows it.
|
|
133
|
+
*/
|
|
134
|
+
export declare namespace TaMessageContext {
|
|
135
|
+
function wrap(context: string, message: string): string;
|
|
136
|
+
/** The message without its context: what the user sees of it. */
|
|
137
|
+
function strip(message: string): string;
|
|
138
|
+
}
|
|
86
139
|
/**
|
|
87
140
|
* The server has taken the message; it says nothing about the run. A run is finished at the
|
|
88
141
|
* `agent_settled` event, when its history is on disk.
|
|
@@ -104,7 +157,7 @@ export interface TaExtensionError {
|
|
|
104
157
|
event: string;
|
|
105
158
|
error: string;
|
|
106
159
|
}
|
|
107
|
-
/** The open session now shows another conversation (`newSession`, `switchSession`, `fork`, `clone`): read it again. */
|
|
160
|
+
/** The open session now shows another conversation (`newSession`, `switchSession`, `fork`, `clone`, `navigateTree`): read it again. */
|
|
108
161
|
export interface TaSessionReplaced {
|
|
109
162
|
type: 'session_replaced';
|
|
110
163
|
info: TaSessionInfo;
|
|
@@ -113,14 +166,23 @@ export interface TaSessionReplaced {
|
|
|
113
166
|
export interface TaSessionClosed {
|
|
114
167
|
type: 'session_closed';
|
|
115
168
|
}
|
|
116
|
-
/**
|
|
169
|
+
/**
|
|
170
|
+
* The model called a tool of `clientTools`: a client that runs it answers with `respondClientTool`.
|
|
171
|
+
* It goes to every attached client; the first answer counts, and `client_tool_resolved` tells the others.
|
|
172
|
+
*/
|
|
117
173
|
export interface TaClientToolRequest {
|
|
118
174
|
type: 'client_tool_request';
|
|
175
|
+
/** The id of the tool call. */
|
|
119
176
|
id: string;
|
|
120
177
|
toolName: string;
|
|
121
178
|
input: unknown;
|
|
122
179
|
}
|
|
123
|
-
|
|
180
|
+
/** A call of a client tool was answered, or ended because the run was aborted or the session closed. */
|
|
181
|
+
export interface TaClientToolResolved {
|
|
182
|
+
type: 'client_tool_resolved';
|
|
183
|
+
id: string;
|
|
184
|
+
}
|
|
185
|
+
export type TaEvent = JsonAgentSessionEvent | RpcExtensionUIRequest | TaUiRequestResolved | TaExtensionError | TaClientToolRequest | TaClientToolResolved | TaSessionReplaced | TaSessionClosed;
|
|
124
186
|
export interface TaEventEnvelope {
|
|
125
187
|
sessionId: string;
|
|
126
188
|
/** Increases by one per event of the session. */
|
|
@@ -133,21 +195,34 @@ export interface TaAttachResult {
|
|
|
133
195
|
events: TaEventEnvelope[];
|
|
134
196
|
/** The dialogs still waiting for an answer. */
|
|
135
197
|
pendingUi: RpcExtensionUIRequest[];
|
|
198
|
+
/** The calls of client tools still waiting for a result. */
|
|
199
|
+
pendingClientTools: TaClientToolRequest[];
|
|
136
200
|
/** Seq of the last event of the session. */
|
|
137
201
|
lastSeq: number;
|
|
138
202
|
/** Some events after `afterSeq` are gone: read the conversation again with `getMessages`. */
|
|
139
203
|
gap: boolean;
|
|
140
204
|
}
|
|
141
205
|
export interface TaClientToolResult {
|
|
206
|
+
/** The `id` of the request. */
|
|
142
207
|
id: string;
|
|
208
|
+
/** What the model reads. */
|
|
143
209
|
output: string;
|
|
210
|
+
/** The tool failed: `output` says why. */
|
|
144
211
|
isError?: boolean;
|
|
145
212
|
}
|
|
146
213
|
/**
|
|
147
|
-
* `ta serve`, over JSON-RPC 2.0 on a WebSocket. Besides opening, attaching and answering,
|
|
148
|
-
* is the command of pi's RPC mode with the same name in camelCase, on the open session
|
|
214
|
+
* The sessions of `ta serve`, over JSON-RPC 2.0 on a WebSocket. Besides opening, attaching and answering,
|
|
215
|
+
* each method is the command of pi's RPC mode with the same name in camelCase, on the open session
|
|
216
|
+
* `sessionId` (see PiCommandMethod). The same WebSocket carries the other services of ta serve, each
|
|
217
|
+
* under its own name: TaWorkspaceServer, TaTerminalServer, TaSettingsServer and TaPackageServer.
|
|
149
218
|
*/
|
|
150
219
|
export interface TaServer {
|
|
220
|
+
getServerInfo(): Promise<TaServerInfo>;
|
|
221
|
+
/**
|
|
222
|
+
* Makes `cwd` the working directory of the server (TaServerInfo.cwd), for every client, and across
|
|
223
|
+
* restarts: where conversations open when the user names no directory. Sessions already open stay where they are.
|
|
224
|
+
*/
|
|
225
|
+
setWorkingDirectory(cwd: string): Promise<TaServerInfo>;
|
|
151
226
|
openSession(options: TaOpenSessionOptions): Promise<TaSessionInfo>;
|
|
152
227
|
closeSession(sessionId: string): Promise<void>;
|
|
153
228
|
listSessions(): Promise<TaSessionInfo[]>;
|
|
@@ -182,18 +257,45 @@ export interface TaServer {
|
|
|
182
257
|
getSessionStats(sessionId: string): Promise<TaCommandResult<'get_session_stats'>>;
|
|
183
258
|
exportHtml(sessionId: string, outputPath?: string): Promise<TaCommandResult<'export_html'>>;
|
|
184
259
|
switchSession(sessionId: string, sessionPath: string): Promise<TaCommandResult<'switch_session'>>;
|
|
185
|
-
|
|
260
|
+
/**
|
|
261
|
+
* A new conversation from an entry, as pi's `/fork`: `before` (the default) a message of the user, which
|
|
262
|
+
* it leaves out and gives back as `text`; `at` any entry, which it keeps.
|
|
263
|
+
*/
|
|
264
|
+
fork(sessionId: string, entryId: string, position?: 'before' | 'at'): Promise<TaCommandResult<'fork'>>;
|
|
265
|
+
/**
|
|
266
|
+
* The new conversation of `fork` in a file of its own, with pi's `createBranchedSession`; the session
|
|
267
|
+
* stays where it is. Open the file with `openSession` to go on with it.
|
|
268
|
+
*/
|
|
269
|
+
forkToFile(sessionId: string, entryId: string, position?: 'before' | 'at'): Promise<TaForkFileResult>;
|
|
186
270
|
clone(sessionId: string): Promise<TaCommandResult<'clone'>>;
|
|
187
271
|
getForkMessages(sessionId: string): Promise<TaCommandResult<'get_fork_messages'>>;
|
|
188
272
|
getEntries(sessionId: string, since?: string): Promise<TaCommandResult<'get_entries'>>;
|
|
189
273
|
getTree(sessionId: string): Promise<TaCommandResult<'get_tree'>>;
|
|
274
|
+
/**
|
|
275
|
+
* Goes to an entry in the same conversation, as pi's `/tree`: the branch left stays in the tree. To a
|
|
276
|
+
* message of the user, it goes to what came before and gives the message back as `editorText`.
|
|
277
|
+
*/
|
|
278
|
+
navigateTree(sessionId: string, targetId: string): Promise<TaNavigateResult>;
|
|
190
279
|
getLastAssistantText(sessionId: string): Promise<TaCommandResult<'get_last_assistant_text'>>;
|
|
191
280
|
setSessionName(sessionId: string, name: string): Promise<void>;
|
|
192
281
|
getMessages(sessionId: string): Promise<TaCommandResult<'get_messages'>>;
|
|
193
282
|
getCommands(sessionId: string): Promise<TaCommandResult<'get_commands'>>;
|
|
283
|
+
/** Loads extensions, skills, prompts and themes again, as pi's `/reload` does. */
|
|
284
|
+
reload(sessionId: string): Promise<void>;
|
|
194
285
|
}
|
|
195
286
|
/** What a client implements. Events come in batches: one message per frame, however fast the model streams. */
|
|
196
287
|
export interface TaClient {
|
|
197
288
|
onEvents(events: TaEventEnvelope[]): Promise<void>;
|
|
289
|
+
/** Output of a terminal of this connection; with `exitCode`, the terminal has ended. */
|
|
290
|
+
onTerminalData(terminalId: string, data: string, exitCode?: number): Promise<void>;
|
|
291
|
+
/**
|
|
292
|
+
* Keys of the data of a package (setExtensionData) that changed, by this client or another, or by the
|
|
293
|
+
* package on the server; with `cwd`, keys of that directory. It comes for the data this connection
|
|
294
|
+
* read, at most every few hundred milliseconds, with the keys of that time together.
|
|
295
|
+
*/
|
|
296
|
+
onExtensionData(name: string, keys: string[], cwd?: string): Promise<void>;
|
|
297
|
+
/** What happens during a sign-in this connection started (TaAuthServer.login). */
|
|
298
|
+
onAuthEvent(loginId: string, event: TaAuthEvent): Promise<void>;
|
|
198
299
|
}
|
|
300
|
+
export {};
|
|
199
301
|
//# sourceMappingURL=ta-protocol.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ta-protocol.d.ts","sourceRoot":"","sources":["../../src/common/ta-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE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AAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/D,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC,CAAC;IACzE,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC,CAAC;IACzE,kFAAkF;IAClF,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5C;AAED,+GAA+G;AAC/G,MAAM,WAAW,QAAQ;IACrB,QAAQ,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,wFAAwF;IACxF,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnF;;;;OAIG;IACH,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3E,kFAAkF;IAClF,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnE"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TA_RPC_ERROR_CODE = exports.TaErrorCode = exports.TA_SERVE_FILE = exports.TA_CLIENT_SERVICE = exports.TA_SERVER_SERVICE = exports.TA_WEBSOCKET_PATH = exports.TaClient = exports.TaServer = void 0;
|
|
3
|
+
exports.TaMessageContext = exports.TA_RPC_ERROR_CODE = exports.TaErrorCode = exports.TA_SERVE_FILE = exports.TA_CLIENT_SERVICE = exports.TA_SERVER_SERVICE = exports.TA_WEBSOCKET_PATH = exports.TaClient = exports.TaServer = void 0;
|
|
4
4
|
exports.TaServer = Symbol('TaServer');
|
|
5
5
|
exports.TaClient = Symbol('TaClient');
|
|
6
6
|
/** Path of the WebSocket endpoint of `ta serve`, and the JSON-RPC method prefixes of both sides. */
|
|
@@ -18,7 +18,28 @@ exports.TaErrorCode = {
|
|
|
18
18
|
MODEL_NOT_FOUND: 'CELL_TA_MODEL_NOT_FOUND',
|
|
19
19
|
INVALID_ARGUMENT: 'CELL_TA_INVALID_ARGUMENT',
|
|
20
20
|
COMMAND_FAILED: 'CELL_TA_COMMAND_FAILED',
|
|
21
|
+
/** No provider of models is signed in for the model, or there is no model: sign in (TaAuthServer) first. */
|
|
22
|
+
NOT_SIGNED_IN: 'CELL_TA_NOT_SIGNED_IN',
|
|
23
|
+
/** Raised by the client, not the server: the call could not reach ta serve, or its answer was lost with the connection. */
|
|
24
|
+
CONNECTION_LOST: 'CELL_TA_CONNECTION_LOST',
|
|
21
25
|
};
|
|
22
26
|
/** The JSON-RPC error code of every failure of a {@link TaServer} call; `data.code` tells them apart. */
|
|
23
27
|
exports.TA_RPC_ERROR_CODE = -32050;
|
|
28
|
+
/**
|
|
29
|
+
* A message of the user may start with a `<context>` block: what the model reads besides the message
|
|
30
|
+
* (where it is said, who is there, what was said before), which a client leaves out when it shows it.
|
|
31
|
+
*/
|
|
32
|
+
var TaMessageContext;
|
|
33
|
+
(function (TaMessageContext) {
|
|
34
|
+
const BLOCK = /^<context>\n?[\s\S]*?\n?<\/context>\n?/;
|
|
35
|
+
function wrap(context, message) {
|
|
36
|
+
return `<context>\n${context}\n</context>\n${message}`;
|
|
37
|
+
}
|
|
38
|
+
TaMessageContext.wrap = wrap;
|
|
39
|
+
/** The message without its context: what the user sees of it. */
|
|
40
|
+
function strip(message) {
|
|
41
|
+
return message.replace(BLOCK, '');
|
|
42
|
+
}
|
|
43
|
+
TaMessageContext.strip = strip;
|
|
44
|
+
})(TaMessageContext || (exports.TaMessageContext = TaMessageContext = {}));
|
|
24
45
|
//# sourceMappingURL=ta-protocol.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ta-protocol.js","sourceRoot":"","sources":["../../src/common/ta-protocol.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"ta-protocol.js","sourceRoot":"","sources":["../../src/common/ta-protocol.ts"],"names":[],"mappings":";;;AAGa,QAAA,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAC9B,QAAA,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAE3C,oGAAoG;AACvF,QAAA,iBAAiB,GAAG,SAAS,CAAC;AAC9B,QAAA,iBAAiB,GAAG,UAAU,CAAC;AAC/B,QAAA,iBAAiB,GAAG,UAAU,CAAC;AAE5C,oFAAoF;AACvE,QAAA,aAAa,GAAG,YAAY,CAAC;AAoB1C,oEAAoE;AACvD,QAAA,WAAW,GAAG;IACvB,iBAAiB,EAAE,2BAA2B;IAC9C,cAAc,EAAE,wBAAwB;IACxC,iBAAiB,EAAE,2BAA2B;IAC9C,gBAAgB,EAAE,0BAA0B;IAC5C,eAAe,EAAE,yBAAyB;IAC1C,gBAAgB,EAAE,0BAA0B;IAC5C,cAAc,EAAE,wBAAwB;IACxC,4GAA4G;IAC5G,aAAa,EAAE,uBAAuB;IACtC,2HAA2H;IAC3H,eAAe,EAAE,yBAAyB;CACpC,CAAC;AAGX,yGAAyG;AAC5F,QAAA,iBAAiB,GAAG,CAAC,KAAK,CAAC;AA4FxC;;;GAGG;AACH,IAAiB,gBAAgB,CAWhC;AAXD,WAAiB,gBAAgB;IAC7B,MAAM,KAAK,GAAG,wCAAwC,CAAC;IAEvD,SAAgB,IAAI,CAAC,OAAe,EAAE,OAAe;QACjD,OAAO,cAAc,OAAO,iBAAiB,OAAO,EAAE,CAAC;IAC3D,CAAC;IAFe,iBAAA,IAAI,OAEnB,CAAA;IAED,iEAAiE;IACjE,SAAgB,KAAK,CAAC,OAAe;QACjC,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACtC,CAAC;IAFe,iBAAA,KAAK,QAEpB,CAAA;AACL,CAAC,EAXgB,gBAAgB,aAAhB,gBAAgB,GAAhB,gBAAgB,QAWhC"}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const bun_test_1 = require("bun:test");
|
|
4
|
+
const auth_protocol_1 = require("./auth-protocol");
|
|
5
|
+
const package_protocol_1 = require("./package-protocol");
|
|
6
|
+
const relay_protocol_1 = require("./relay-protocol");
|
|
7
|
+
const settings_protocol_1 = require("./settings-protocol");
|
|
4
8
|
const ta_protocol_1 = require("./ta-protocol");
|
|
9
|
+
const workspace_protocol_1 = require("./workspace-protocol");
|
|
10
|
+
const everyPiCommand = true;
|
|
5
11
|
(0, bun_test_1.describe)('ta protocol', () => {
|
|
6
12
|
(0, bun_test_1.it)('names each failure with a distinct CELL_TA_ code', () => {
|
|
7
13
|
const codes = Object.values(ta_protocol_1.TaErrorCode);
|
|
@@ -13,6 +19,21 @@ const ta_protocol_1 = require("./ta-protocol");
|
|
|
13
19
|
(0, bun_test_1.it)('routes JSON-RPC methods by the names of the service symbols', () => {
|
|
14
20
|
(0, bun_test_1.expect)(ta_protocol_1.TaServer.description).toBe(ta_protocol_1.TA_SERVER_SERVICE);
|
|
15
21
|
(0, bun_test_1.expect)(ta_protocol_1.TaClient.description).toBe(ta_protocol_1.TA_CLIENT_SERVICE);
|
|
22
|
+
(0, bun_test_1.expect)(workspace_protocol_1.TaWorkspaceServer.description).toBe(workspace_protocol_1.TA_WORKSPACE_SERVICE);
|
|
23
|
+
(0, bun_test_1.expect)(workspace_protocol_1.TaTerminalServer.description).toBe(workspace_protocol_1.TA_TERMINAL_SERVICE);
|
|
24
|
+
(0, bun_test_1.expect)(settings_protocol_1.TaSettingsServer.description).toBe(settings_protocol_1.TA_SETTINGS_SERVICE);
|
|
25
|
+
(0, bun_test_1.expect)(package_protocol_1.TaPackageServer.description).toBe(package_protocol_1.TA_PACKAGE_SERVICE);
|
|
26
|
+
(0, bun_test_1.expect)(auth_protocol_1.TaAuthServer.description).toBe(auth_protocol_1.TA_AUTH_SERVICE);
|
|
27
|
+
(0, bun_test_1.expect)(relay_protocol_1.TaRelayServer.description).toBe(relay_protocol_1.TA_RELAY_SERVICE);
|
|
28
|
+
});
|
|
29
|
+
(0, bun_test_1.it)('has a method of TaServer for each command of pi', () => {
|
|
30
|
+
(0, bun_test_1.expect)(everyPiCommand).toBe(true);
|
|
31
|
+
});
|
|
32
|
+
(0, bun_test_1.it)('leaves the context of a message out of what is shown', () => {
|
|
33
|
+
const message = ta_protocol_1.TaMessageContext.wrap('[#test]\nMembers:\n- @a', '@a hi\nthere');
|
|
34
|
+
(0, bun_test_1.expect)(message).toStartWith('<context>\n');
|
|
35
|
+
(0, bun_test_1.expect)(ta_protocol_1.TaMessageContext.strip(message)).toBe('@a hi\nthere');
|
|
36
|
+
(0, bun_test_1.expect)(ta_protocol_1.TaMessageContext.strip('no <context> here')).toBe('no <context> here');
|
|
16
37
|
});
|
|
17
38
|
});
|
|
18
39
|
//# sourceMappingURL=ta-protocol.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ta-protocol.spec.js","sourceRoot":"","sources":["../../src/common/ta-protocol.spec.ts"],"names":[],"mappings":";;AAAA,uCAAgD;AAChD,+
|
|
1
|
+
{"version":3,"file":"ta-protocol.spec.js","sourceRoot":"","sources":["../../src/common/ta-protocol.spec.ts"],"names":[],"mappings":";;AAAA,uCAAgD;AAChD,mDAAgE;AAChE,yDAAyE;AACzE,qDAAmE;AACnE,2DAA4E;AAC5E,+CAA8I;AAC9I,6DAAsH;AAOtH,MAAM,cAAc,GAAmE,IAAI,CAAC;AAE5F,IAAA,mBAAQ,EAAC,aAAa,EAAE,GAAG,EAAE;IACzB,IAAA,aAAE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