@celljs/ta-protocol 4.6.1 → 4.8.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.en.md +11 -0
- package/README.md +4 -3
- package/esm/common/index.d.ts +2 -0
- package/esm/common/index.js +2 -0
- package/esm/common/index.js.map +1 -1
- package/esm/common/location.d.ts +45 -0
- package/esm/common/location.js +175 -0
- package/esm/common/location.js.map +1 -0
- package/esm/common/remote-protocol.d.ts +85 -0
- package/esm/common/remote-protocol.js +3 -0
- package/esm/common/remote-protocol.js.map +1 -0
- package/esm/common/settings-protocol.d.ts +7 -0
- package/esm/common/ta-extension-host.d.ts +33 -3
- package/esm/common/ta-extension-host.js +7 -0
- package/esm/common/ta-extension-host.js.map +1 -1
- package/esm/common/ta-protocol.d.ts +14 -2
- package/esm/common/ta-protocol.js.map +1 -1
- package/esm/common/workspace-protocol.d.ts +16 -0
- package/esm/common/workspace-protocol.js +5 -0
- package/esm/common/workspace-protocol.js.map +1 -1
- package/lib/common/index.d.ts +2 -0
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +2 -0
- package/lib/common/index.js.map +1 -1
- package/lib/common/location.d.ts +46 -0
- package/lib/common/location.d.ts.map +1 -0
- package/lib/common/location.js +178 -0
- package/lib/common/location.js.map +1 -0
- package/lib/common/location.spec.d.ts +2 -0
- package/lib/common/location.spec.d.ts.map +1 -0
- package/lib/common/location.spec.js +58 -0
- package/lib/common/location.spec.js.map +1 -0
- package/lib/common/remote-protocol.d.ts +86 -0
- package/lib/common/remote-protocol.d.ts.map +1 -0
- package/lib/common/remote-protocol.js +6 -0
- package/lib/common/remote-protocol.js.map +1 -0
- package/lib/common/settings-protocol.d.ts +7 -0
- package/lib/common/settings-protocol.d.ts.map +1 -1
- package/lib/common/ta-extension-host.d.ts +33 -3
- package/lib/common/ta-extension-host.d.ts.map +1 -1
- package/lib/common/ta-extension-host.js +8 -1
- package/lib/common/ta-extension-host.js.map +1 -1
- package/lib/common/ta-protocol.d.ts +14 -2
- package/lib/common/ta-protocol.d.ts.map +1 -1
- package/lib/common/ta-protocol.js.map +1 -1
- package/lib/common/ta-protocol.spec.js +2 -0
- package/lib/common/ta-protocol.spec.js.map +1 -1
- package/lib/common/workspace-protocol.d.ts +16 -0
- package/lib/common/workspace-protocol.d.ts.map +1 -1
- package/lib/common/workspace-protocol.js +6 -1
- package/lib/common/workspace-protocol.js.map +1 -1
- package/package.json +1 -1
- package/src/common/index.ts +2 -0
- package/src/common/location.spec.ts +62 -0
- package/src/common/location.ts +177 -0
- package/src/common/remote-protocol.ts +76 -0
- package/src/common/settings-protocol.ts +7 -0
- package/src/common/ta-extension-host.ts +48 -3
- package/src/common/ta-protocol.spec.ts +2 -0
- package/src/common/ta-protocol.ts +14 -2
- package/src/common/workspace-protocol.ts +18 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ta-protocol.d.ts","sourceRoot":"","sources":["../../src/common/ta-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,UAAU,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ta-protocol.d.ts","sourceRoot":"","sources":["../../src/common/ta-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,qBAAqB,EAAE,UAAU,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC7J,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,eAAO,MAAM,QAAQ,eAAqB,CAAC;AAC3C,eAAO,MAAM,QAAQ,eAAqB,CAA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AAE,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;IAChE,+FAA+F;IAC/F,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD"}
|
|
@@ -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":";;;AAIa,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;AAwB1C,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"}
|
|
@@ -4,6 +4,7 @@ const bun_test_1 = require("bun:test");
|
|
|
4
4
|
const auth_protocol_1 = require("./auth-protocol");
|
|
5
5
|
const package_protocol_1 = require("./package-protocol");
|
|
6
6
|
const relay_protocol_1 = require("./relay-protocol");
|
|
7
|
+
const remote_protocol_1 = require("./remote-protocol");
|
|
7
8
|
const settings_protocol_1 = require("./settings-protocol");
|
|
8
9
|
const ta_protocol_1 = require("./ta-protocol");
|
|
9
10
|
const workspace_protocol_1 = require("./workspace-protocol");
|
|
@@ -25,6 +26,7 @@ const everyPiCommand = true;
|
|
|
25
26
|
(0, bun_test_1.expect)(package_protocol_1.TaPackageServer.description).toBe(package_protocol_1.TA_PACKAGE_SERVICE);
|
|
26
27
|
(0, bun_test_1.expect)(auth_protocol_1.TaAuthServer.description).toBe(auth_protocol_1.TA_AUTH_SERVICE);
|
|
27
28
|
(0, bun_test_1.expect)(relay_protocol_1.TaRelayServer.description).toBe(relay_protocol_1.TA_RELAY_SERVICE);
|
|
29
|
+
(0, bun_test_1.expect)(remote_protocol_1.TaRemoteServer.description).toBe(remote_protocol_1.TA_REMOTE_SERVICE);
|
|
28
30
|
});
|
|
29
31
|
(0, bun_test_1.it)('has a method of TaServer for each command of pi', () => {
|
|
30
32
|
(0, bun_test_1.expect)(everyPiCommand).toBe(true);
|
|
@@ -1 +1 @@
|
|
|
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,EAAC,kDAAkD,EAAE,GAAG,EAAE;QACxD,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,yBAAW,CAAC,CAAC;QACzC,IAAA,iBAAM,EAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC/C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACvB,IAAA,iBAAM,EAAC,IAAI,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QACzC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAA,aAAE,EAAC,6DAA6D,EAAE,GAAG,EAAE;QACnE,IAAA,iBAAM,EAAC,sBAAQ,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,+BAAiB,CAAC,CAAC;QACrD,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yB,EAAE,cAAc,CAAC,CAAC;QACjF,IAAA,iBAAM,EAAC,OAAO,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QAC3C,IAAA,iBAAM,EAAC,8BAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC7D,IAAA,iBAAM,EAAC,8BAAgB,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAClF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -31,6 +31,17 @@ export interface TaRunCommandOptions {
|
|
|
31
31
|
/** Of each of stdout and stderr; default 1 MB, at most 8 MB. */
|
|
32
32
|
maxBytes?: number;
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* The most bytes of a part of {@link TaWorkspaceServer.uploadFile}: a larger file goes in parts of this size,
|
|
36
|
+
* well within what a message of the WebSocket may hold once in base64.
|
|
37
|
+
*/
|
|
38
|
+
export declare const TA_UPLOAD_PART_BYTES: number;
|
|
39
|
+
export interface TaUploadOptions {
|
|
40
|
+
/** Default: the server's directory. */
|
|
41
|
+
cwd?: string;
|
|
42
|
+
/** After what the file holds: each part of a file sent in parts but the first. */
|
|
43
|
+
append?: boolean;
|
|
44
|
+
}
|
|
34
45
|
export interface TaCommandOutput {
|
|
35
46
|
stdout: string;
|
|
36
47
|
stderr: string;
|
|
@@ -51,6 +62,11 @@ export interface TaWorkspaceServer {
|
|
|
51
62
|
readFile(path: string, cwd?: string): Promise<TaFileContent>;
|
|
52
63
|
/** Writes the text of a file; its directory must be there. */
|
|
53
64
|
writeFile(path: string, text: string, cwd?: string): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* Writes bytes, in base64, to a file (one uploaded): the folders on its way are made, and a file there is
|
|
67
|
+
* replaced. A file larger than {@link TA_UPLOAD_PART_BYTES} goes in parts, each after the first with `append`.
|
|
68
|
+
*/
|
|
69
|
+
uploadFile(path: string, data: string, options?: TaUploadOptions): Promise<void>;
|
|
54
70
|
/**
|
|
55
71
|
* A URL of this server, under {@link TA_FILES_PATH}, that answers the bytes of a file of `cwd`, for
|
|
56
72
|
* what the page shows as it is: an image, a video, a page with what it loads next to it. The URL needs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-protocol.d.ts","sourceRoot":"","sources":["../../src/common/workspace-protocol.ts"],"names":[],"mappings":"AAEA,qGAAqG;AACrG,eAAO,MAAM,aAAa,eAAe,CAAC;AAE1C,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,eAAO,MAAM,oBAAoB,sBAAsB,CAAC;AACxD,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAC3D,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AAEtD,gDAAgD;AAChD,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,4DAA4D;IAC5D,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAChC,uCAAuC;IACvC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAA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C"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TA_TERMINAL_SERVICE = exports.TaTerminalServer = exports.TA_WORKSPACE_SERVICE = exports.TaWorkspaceServer = exports.TA_FILES_PATH = void 0;
|
|
3
|
+
exports.TA_UPLOAD_PART_BYTES = exports.TA_TERMINAL_SERVICE = exports.TaTerminalServer = exports.TA_WORKSPACE_SERVICE = exports.TaWorkspaceServer = exports.TA_FILES_PATH = void 0;
|
|
4
4
|
/** Where the page loads the bytes of workspace files from: see {@link TaWorkspaceServer.fileUrl}. */
|
|
5
5
|
exports.TA_FILES_PATH = '/api/files';
|
|
6
6
|
exports.TaWorkspaceServer = Symbol('TaWorkspaceServer');
|
|
7
7
|
exports.TA_WORKSPACE_SERVICE = 'TaWorkspaceServer';
|
|
8
8
|
exports.TaTerminalServer = Symbol('TaTerminalServer');
|
|
9
9
|
exports.TA_TERMINAL_SERVICE = 'TaTerminalServer';
|
|
10
|
+
/**
|
|
11
|
+
* The most bytes of a part of {@link TaWorkspaceServer.uploadFile}: a larger file goes in parts of this size,
|
|
12
|
+
* well within what a message of the WebSocket may hold once in base64.
|
|
13
|
+
*/
|
|
14
|
+
exports.TA_UPLOAD_PART_BYTES = 4 * 1024 * 1024;
|
|
10
15
|
//# sourceMappingURL=workspace-protocol.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-protocol.js","sourceRoot":"","sources":["../../src/common/workspace-protocol.ts"],"names":[],"mappings":";;;AAEA,qGAAqG;AACxF,QAAA,aAAa,GAAG,YAAY,CAAC;AAE7B,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAChD,QAAA,oBAAoB,GAAG,mBAAmB,CAAC;AAC3C,QAAA,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAC9C,QAAA,mBAAmB,GAAG,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"workspace-protocol.js","sourceRoot":"","sources":["../../src/common/workspace-protocol.ts"],"names":[],"mappings":";;;AAEA,qGAAqG;AACxF,QAAA,aAAa,GAAG,YAAY,CAAC;AAE7B,QAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAChD,QAAA,oBAAoB,GAAG,mBAAmB,CAAC;AAC3C,QAAA,gBAAgB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAC9C,QAAA,mBAAmB,GAAG,kBAAkB,CAAC;AAgCtD;;;GAGG;AACU,QAAA,oBAAoB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC"}
|
package/package.json
CHANGED
package/src/common/index.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from './auth-protocol';
|
|
2
|
+
export * from './location';
|
|
2
3
|
export * from './package-protocol';
|
|
3
4
|
export * from './pi-types';
|
|
4
5
|
export * from './relay-protocol';
|
|
6
|
+
export * from './remote-protocol';
|
|
5
7
|
export * from './settings-protocol';
|
|
6
8
|
export * from './ta-extension-host';
|
|
7
9
|
export * from './ta-protocol';
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { describe, expect, it } from 'bun:test';
|
|
2
|
+
import { TaLocation } from './location';
|
|
3
|
+
|
|
4
|
+
describe('TaLocation', () => {
|
|
5
|
+
it('reads a path of this machine as no remote location', () => {
|
|
6
|
+
expect(TaLocation.parse('/home/me/app')).toBeUndefined();
|
|
7
|
+
expect(TaLocation.path('/home/me/app')).toBe('/home/me/app');
|
|
8
|
+
expect(TaLocation.host('C:\\work')).toBeUndefined();
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
it('reads the host and the path of an ssh location', () => {
|
|
12
|
+
expect(TaLocation.parse('ssh://dev/home/me/app')).toEqual({ host: 'dev', path: '/home/me/app' });
|
|
13
|
+
expect(TaLocation.parse('ssh://me@10.0.0.2:2222//srv//app/')).toEqual({ host: 'me@10.0.0.2:2222', path: '/srv/app' });
|
|
14
|
+
expect(TaLocation.parse('ssh://dev')).toEqual({ host: 'dev', path: '' });
|
|
15
|
+
expect(TaLocation.parse('ssh://dev/')).toEqual({ host: 'dev', path: '/' });
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('refuses a host that ssh would read as an option, or none', () => {
|
|
19
|
+
expect(() => TaLocation.parse('ssh://-oProxyCommand=x/tmp')).toThrow();
|
|
20
|
+
expect(() => TaLocation.parse('ssh:///tmp')).toThrow();
|
|
21
|
+
expect(() => TaLocation.parse('ssh://a b/tmp')).toThrow();
|
|
22
|
+
expect(TaLocation.isHost('dev.example.com')).toBe(true);
|
|
23
|
+
expect(TaLocation.isHost('-p')).toBe(false);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('walks up and down remote directories as it does local ones', () => {
|
|
27
|
+
expect(TaLocation.parent('ssh://dev/home/me')).toBe('ssh://dev/home');
|
|
28
|
+
expect(TaLocation.parent('ssh://dev/home')).toBe('ssh://dev/');
|
|
29
|
+
expect(TaLocation.parent('ssh://dev/')).toBeUndefined();
|
|
30
|
+
expect(TaLocation.parent('ssh://dev')).toBeUndefined();
|
|
31
|
+
expect(TaLocation.child('ssh://dev/', 'srv')).toBe('ssh://dev/srv');
|
|
32
|
+
expect(TaLocation.child('ssh://dev/srv', 'app')).toBe('ssh://dev/srv/app');
|
|
33
|
+
expect(TaLocation.parent('/home/me')).toBe('/home');
|
|
34
|
+
expect(TaLocation.parent('/')).toBeUndefined();
|
|
35
|
+
expect(TaLocation.parent('C:\\work')).toBe('C:\\');
|
|
36
|
+
expect(TaLocation.child('C:\\work', 'app')).toBe('C:\\work\\app');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('names a directory by its last name, the home of a host by the host', () => {
|
|
40
|
+
expect(TaLocation.basename('ssh://dev/home/me/app/')).toBe('app');
|
|
41
|
+
expect(TaLocation.basename('ssh://dev')).toBe('dev');
|
|
42
|
+
expect(TaLocation.basename('/work/app')).toBe('app');
|
|
43
|
+
expect(TaLocation.ssh('dev', 'srv/app')).toBe('ssh://dev/srv/app');
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it('reads a host as the user writes it, the command line of ssh too', () => {
|
|
47
|
+
expect(TaLocation.readHost('dev')).toEqual({ host: 'dev' });
|
|
48
|
+
expect(TaLocation.readHost(' ssh://me@dev:2222/srv ')).toEqual({ host: 'me@dev:2222' });
|
|
49
|
+
expect(TaLocation.readHost('ssh root@suboyang.devcloud.woa.com -p 36000')).toEqual({ host: 'root@suboyang.devcloud.woa.com:36000' });
|
|
50
|
+
expect(TaLocation.readHost('ssh -p36000 -A -l root box')).toEqual({ host: 'root@box:36000' });
|
|
51
|
+
expect(TaLocation.readHost('ssh -o Port=2200 -o User=me box')).toEqual({ host: 'me@box:2200' });
|
|
52
|
+
expect(TaLocation.readHost('me@box -p 22')).toEqual({ host: 'me@box' });
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
it('says which options of ssh belong in ~/.ssh/config, and refuses what is no host', () => {
|
|
56
|
+
expect(TaLocation.readHost('ssh -i ~/.ssh/key -J jump me@box')).toEqual({ error: 'options', options: ['-i ~/.ssh/key', '-J jump'] });
|
|
57
|
+
expect(TaLocation.readHost('ssh -o ProxyCommand=nc box')).toEqual({ error: 'options', options: ['-o ProxyCommand=nc'] });
|
|
58
|
+
expect(TaLocation.readHost('ssh')).toEqual({ error: 'empty' });
|
|
59
|
+
expect(TaLocation.readHost('ssh box ls -la')).toEqual({ error: 'invalid' });
|
|
60
|
+
expect(TaLocation.readHost('box -p abc')).toEqual({ error: 'invalid' });
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a conversation works: a directory of the machine of ta serve, as a path, or a directory of another
|
|
3
|
+
* machine that ta serve reaches with ssh, as `ssh://<host>/<absolute path>`. `<host>` is what ssh takes:
|
|
4
|
+
* a Host of ~/.ssh/config, or `[user@]host[:port]`. Without a path (`ssh://<host>`) it is the home
|
|
5
|
+
* directory there, which TaRemoteServer.resolveLocation turns into a path.
|
|
6
|
+
*/
|
|
7
|
+
export namespace TaLocation {
|
|
8
|
+
export const SSH = 'ssh://';
|
|
9
|
+
|
|
10
|
+
/** A directory of another machine. */
|
|
11
|
+
export interface Remote {
|
|
12
|
+
host: string;
|
|
13
|
+
/** Absolute, with `/`; empty for the home directory. */
|
|
14
|
+
path: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Letters, digits and `_ . @ : % + - [ ]`, not first a `-`: ssh must not read a host as an option. */
|
|
18
|
+
const HOST = /^(?!-)[\w.@:%+[\]-]+$/;
|
|
19
|
+
|
|
20
|
+
export function isRemote(location: string): boolean {
|
|
21
|
+
return location.startsWith(SSH);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** undefined for a path of the machine of ta serve; throws for an `ssh://` location that is not one. */
|
|
25
|
+
export function parse(location: string): Remote | undefined {
|
|
26
|
+
if (!isRemote(location)) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
const rest = location.slice(SSH.length);
|
|
30
|
+
const slash = rest.indexOf('/');
|
|
31
|
+
const host = slash < 0 ? rest : rest.slice(0, slash);
|
|
32
|
+
const path = slash < 0 ? '' : normalize(rest.slice(slash));
|
|
33
|
+
if (!isHost(host)) {
|
|
34
|
+
throw new Error(`${JSON.stringify(location)} names no host: write ssh://<host>/<path>, the host as ssh takes it.`);
|
|
35
|
+
}
|
|
36
|
+
return { host, path };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function isHost(host: string): boolean {
|
|
40
|
+
return HOST.test(host);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** What {@link readHost} makes of what the user typed. */
|
|
44
|
+
export type HostInput = { host: string } | { error: 'empty' | 'invalid' } | { error: 'options'; options: string[] };
|
|
45
|
+
|
|
46
|
+
/** Options of ssh without a value, which change nothing for Ta. */
|
|
47
|
+
const FLAGS = /^-[46AaCfGgKkMNnqsTtVvXxYy]+$/;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* A host as the user may write it: `dev`, `me@dev`, `me@dev:2222`, `ssh://me@dev:2222/path`, or the
|
|
51
|
+
* command line they use (`ssh -p 2222 me@dev`, `ssh me@dev -p 2222 -l root`). Options that a host
|
|
52
|
+
* cannot hold (`-i`, `-J`, `-o ProxyCommand=…`) belong in ~/.ssh/config: they come back as `options`.
|
|
53
|
+
*/
|
|
54
|
+
export function readHost(input: string): HostInput {
|
|
55
|
+
const words = input.trim().split(/\s+/).filter(Boolean);
|
|
56
|
+
if (words[0] === 'ssh') {
|
|
57
|
+
words.shift();
|
|
58
|
+
}
|
|
59
|
+
let destination: string | undefined;
|
|
60
|
+
let port: string | undefined;
|
|
61
|
+
let user: string | undefined;
|
|
62
|
+
const options: string[] = [];
|
|
63
|
+
for (let i = 0; i < words.length; i++) {
|
|
64
|
+
const word = words[i];
|
|
65
|
+
const glued = /^-([pl])(.+)$/.exec(word);
|
|
66
|
+
if (word === '-p' || word === '-l' || glued) {
|
|
67
|
+
const value = glued ? glued[2] : words[++i];
|
|
68
|
+
if (value === undefined) {
|
|
69
|
+
return { error: 'invalid' };
|
|
70
|
+
}
|
|
71
|
+
if ((glued ? glued[1] : word[1]) === 'p') {
|
|
72
|
+
port = value;
|
|
73
|
+
} else {
|
|
74
|
+
user = value;
|
|
75
|
+
}
|
|
76
|
+
} else if (word === '-o' || word.startsWith('-o')) {
|
|
77
|
+
const value = word === '-o' ? words[++i] : word.slice(2);
|
|
78
|
+
const option = /^(port|user)\s*=?\s*(.+)$/i.exec(value ?? '');
|
|
79
|
+
if (!option) {
|
|
80
|
+
options.push(`-o ${value ?? ''}`.trim());
|
|
81
|
+
} else if (option[1].toLowerCase() === 'port') {
|
|
82
|
+
port = option[2];
|
|
83
|
+
} else {
|
|
84
|
+
user = option[2];
|
|
85
|
+
}
|
|
86
|
+
} else if (FLAGS.test(word)) {
|
|
87
|
+
// No value, nothing for Ta.
|
|
88
|
+
} else if (word.startsWith('-')) {
|
|
89
|
+
options.push(/^-[bBcDeEFiIJLmOQRSwW]$/.test(word) && words[i + 1] !== undefined ? `${word} ${words[++i]}` : word);
|
|
90
|
+
} else if (destination === undefined) {
|
|
91
|
+
destination = word;
|
|
92
|
+
} else {
|
|
93
|
+
// A command to run there: not a host.
|
|
94
|
+
return { error: 'invalid' };
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (options.length > 0) {
|
|
98
|
+
return { error: 'options', options };
|
|
99
|
+
}
|
|
100
|
+
if (!destination) {
|
|
101
|
+
return { error: 'empty' };
|
|
102
|
+
}
|
|
103
|
+
let host = destination.replace(/^ssh:\/\//, '').replace(/\/.*$/, '');
|
|
104
|
+
if (user && !host.includes('@')) {
|
|
105
|
+
host = `${user}@${host}`;
|
|
106
|
+
}
|
|
107
|
+
if (port) {
|
|
108
|
+
if (!/^\d{1,5}$/.test(port) || /:\d+$/.test(host)) {
|
|
109
|
+
return { error: 'invalid' };
|
|
110
|
+
}
|
|
111
|
+
host = port === '22' ? host : `${host}:${port}`;
|
|
112
|
+
}
|
|
113
|
+
return isHost(host) ? { host } : { error: 'invalid' };
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** `ssh://<host><path>`; `path` absolute, or empty for the home directory. */
|
|
117
|
+
export function ssh(host: string, path = ''): string {
|
|
118
|
+
return `${SSH}${host}${path ? normalize(path) : ''}`;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** The host of a remote location; undefined for this machine. */
|
|
122
|
+
export function host(location: string): string | undefined {
|
|
123
|
+
return isRemote(location) ? parse(location)?.host : undefined;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** The path inside its machine. */
|
|
127
|
+
export function path(location: string): string {
|
|
128
|
+
return parse(location)?.path ?? location;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** The directory above; undefined at a root (`/`, `C:\\`, the root of a host). */
|
|
132
|
+
export function parent(location: string): string | undefined {
|
|
133
|
+
const remote = parse(location);
|
|
134
|
+
if (remote) {
|
|
135
|
+
const above = remote.path ? parentPath(remote.path) : undefined;
|
|
136
|
+
return above === undefined ? undefined : ssh(remote.host, above);
|
|
137
|
+
}
|
|
138
|
+
return parentPath(location);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function child(location: string, name: string): string {
|
|
142
|
+
const remote = parse(location);
|
|
143
|
+
if (remote) {
|
|
144
|
+
return ssh(remote.host, childPath(remote.path || '/', name));
|
|
145
|
+
}
|
|
146
|
+
return childPath(location, name);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** The last name of the path; the host for its home directory. */
|
|
150
|
+
export function basename(location: string): string {
|
|
151
|
+
const remote = parse(location);
|
|
152
|
+
const path = (remote ? remote.path : location).replace(/[\\/]+$/, '');
|
|
153
|
+
const name = path.slice(Math.max(path.lastIndexOf('/'), path.lastIndexOf('\\')) + 1);
|
|
154
|
+
return name || remote?.host || location;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function parentPath(path: string): string | undefined {
|
|
158
|
+
const trimmed = path.replace(/[\\/]+$/, '');
|
|
159
|
+
const at = Math.max(trimmed.lastIndexOf('/'), trimmed.lastIndexOf('\\'));
|
|
160
|
+
if (at < 0) {
|
|
161
|
+
return undefined;
|
|
162
|
+
}
|
|
163
|
+
const head = trimmed.slice(0, at);
|
|
164
|
+
return head === '' || /^[A-Za-z]:$/.test(head) ? head + trimmed[at] : head;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function childPath(path: string, name: string): string {
|
|
168
|
+
const separator = path.includes('/') || !path.includes('\\') ? '/' : '\\';
|
|
169
|
+
return path.endsWith(separator) ? path + name : path + separator + name;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** One `/` between names, none at the end but for the root. */
|
|
173
|
+
function normalize(path: string): string {
|
|
174
|
+
const squeezed = `/${path}`.replace(/\/+/g, '/');
|
|
175
|
+
return squeezed.length > 1 ? squeezed.replace(/\/$/, '') : squeezed;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export const TaRemoteServer = Symbol('TaRemoteServer');
|
|
2
|
+
export const TA_REMOTE_SERVICE = 'TaRemoteServer';
|
|
3
|
+
|
|
4
|
+
/** A machine ta serve can reach with ssh. */
|
|
5
|
+
export interface TaRemoteHost {
|
|
6
|
+
/** What follows `ssh://` in a location (TaLocation). */
|
|
7
|
+
host: string;
|
|
8
|
+
/** A Host of ~/.ssh/config, or one opened before. */
|
|
9
|
+
source: 'config' | 'recent';
|
|
10
|
+
/** ta serve is connected to it now. */
|
|
11
|
+
connected: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* What ssh asks while it connects (a password, a passphrase, whether to trust a new host key), for
|
|
16
|
+
* whoever is there to answer: `confirm` takes `yes` or `no`, `secret` is not shown as typed.
|
|
17
|
+
*/
|
|
18
|
+
export interface TaRemotePrompt {
|
|
19
|
+
promptId: string;
|
|
20
|
+
host: string;
|
|
21
|
+
kind: 'secret' | 'confirm' | 'text';
|
|
22
|
+
message: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** What happens with the remote machines, to the connections that called TaRemoteServer.watch. */
|
|
26
|
+
export type TaRemoteEvent =
|
|
27
|
+
| { type: 'prompt'; prompt: TaRemotePrompt }
|
|
28
|
+
/** Answered, by this client or another, or ssh no longer waits. */
|
|
29
|
+
| { type: 'prompt_closed'; promptId: string }
|
|
30
|
+
/** A step of connecting that takes a while: the first connection installs things there. */
|
|
31
|
+
| { type: 'progress'; host: string; step: TaRemoteStep; detail?: string }
|
|
32
|
+
/** Connected to the host, or no longer. */
|
|
33
|
+
| { type: 'connection'; host: string; connected: boolean; error?: string };
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The steps of connecting to a host: ssh signs in, then Ta looks at what the host has, installs Node.js
|
|
37
|
+
* there when it has none (`detail`: the version), copies its small server, and starts it.
|
|
38
|
+
*/
|
|
39
|
+
export type TaRemoteStep = 'connecting' | 'checking' | 'installing-node' | 'copying-server' | 'starting';
|
|
40
|
+
|
|
41
|
+
/** A port of another machine, reachable on the machine of ta serve. */
|
|
42
|
+
export interface TaForwardedPort {
|
|
43
|
+
host: string;
|
|
44
|
+
/** On the other machine. */
|
|
45
|
+
remotePort: number;
|
|
46
|
+
/** On the machine of ta serve, at 127.0.0.1. */
|
|
47
|
+
localPort: number;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Other machines that conversations work on, as VS Code's Remote SSH: the agent runs with ta serve, and
|
|
52
|
+
* its commands and files are there, through the `ssh` of the machine of ta serve with its configuration.
|
|
53
|
+
*/
|
|
54
|
+
export interface TaRemoteServer {
|
|
55
|
+
/** The Hosts of ~/.ssh/config without wildcards, and those added or opened before, the latest first. */
|
|
56
|
+
listHosts(): Promise<TaRemoteHost[]>;
|
|
57
|
+
/** Keeps a host in the list (`recent`), without connecting to it. */
|
|
58
|
+
addHost(host: string): Promise<void>;
|
|
59
|
+
/** Disconnects from a host and drops it from the list; one of ~/.ssh/config stays there. */
|
|
60
|
+
removeHost(host: string): Promise<void>;
|
|
61
|
+
/** The location with the path of the home directory when it has none; connects to the host. */
|
|
62
|
+
resolveLocation(location: string): Promise<string>;
|
|
63
|
+
/**
|
|
64
|
+
* A port of the machine of `cwd` on the machine of ta serve, for a page served there: the same port
|
|
65
|
+
* when `cwd` is a directory of this machine. It stays open while ta serve runs.
|
|
66
|
+
*/
|
|
67
|
+
forwardPort(port: number, cwd?: string): Promise<TaForwardedPort>;
|
|
68
|
+
listForwardedPorts(): Promise<TaForwardedPort[]>;
|
|
69
|
+
closeForwardedPort(host: string, remotePort: number): Promise<void>;
|
|
70
|
+
/** This connection hears TaClient.onRemoteEvent from now; resolves to the prompts that wait. */
|
|
71
|
+
watch(): Promise<TaRemotePrompt[]>;
|
|
72
|
+
/** The answer to a prompt; `null` cancels it. False when it no longer waits. */
|
|
73
|
+
answer(promptId: string, value: string | null): Promise<boolean>;
|
|
74
|
+
/** Ends the connection to the host, its processes and forwarded ports there. */
|
|
75
|
+
disconnect(host: string): Promise<void>;
|
|
76
|
+
}
|
|
@@ -51,6 +51,8 @@ export interface TaSettingsSnapshot {
|
|
|
51
51
|
projectTrusted: boolean;
|
|
52
52
|
/** `<provider>/<model id>` of the models with credentials, for the model setting. */
|
|
53
53
|
models: string[];
|
|
54
|
+
/** The names of those of `models` that have one other than their id. */
|
|
55
|
+
modelNames?: Record<string, string>;
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
/** The settings of ta in pi's `settings.json` files, on the same WebSocket as {@link TaServer}. */
|
|
@@ -63,4 +65,9 @@ export interface TaSettingsServer {
|
|
|
63
65
|
* level are for new sessions.
|
|
64
66
|
*/
|
|
65
67
|
updateSettings(scope: TaSettingsScope, changes: Record<string, unknown>, cwd?: string): Promise<TaSettingsSnapshot>;
|
|
68
|
+
/**
|
|
69
|
+
* The language the user reads (`zh-CN`, `en-US`), for what the server and the pi packages it runs say:
|
|
70
|
+
* it is `TA_LANGUAGE` of the process of ta serve, which they read. The client that set it last wins.
|
|
71
|
+
*/
|
|
72
|
+
setLanguage(language: string): Promise<void>;
|
|
66
73
|
}
|
|
@@ -3,14 +3,28 @@ import type { TaServer } from './ta-protocol';
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* What `ta serve` gives the server side of a package: the sessions and the data of packages, in its own
|
|
6
|
-
* process, without a token. A subset of TaServer and TaPackageServer: it can open
|
|
7
|
-
*
|
|
6
|
+
* process, without a token. A subset of TaServer and TaPackageServer: it can open, drive, stop and close
|
|
7
|
+
* sessions (best those it opened: closing one takes it from every client), not remove anything.
|
|
8
8
|
*/
|
|
9
9
|
export interface TaExtensionHost
|
|
10
|
-
extends Pick<
|
|
10
|
+
extends Pick<
|
|
11
|
+
TaServer,
|
|
12
|
+
| 'getServerInfo'
|
|
13
|
+
| 'listSessions'
|
|
14
|
+
| 'openSession'
|
|
15
|
+
| 'closeSession'
|
|
16
|
+
| 'setSessionName'
|
|
17
|
+
| 'prompt'
|
|
18
|
+
| 'followUp'
|
|
19
|
+
| 'abort'
|
|
20
|
+
| 'getState'
|
|
21
|
+
| 'getLastAssistantText'
|
|
22
|
+
>,
|
|
11
23
|
Pick<TaPackageServer, 'getExtensionData' | 'setExtensionData' | 'listPackages'> {
|
|
12
24
|
/** The agent directory of Ta (`~/.ta/agent`): its `extensions/` holds the packages of the user. */
|
|
13
25
|
readonly agentDir: string;
|
|
26
|
+
/** Where the conversation of a session file works, as clients name it (a path or an `ssh://` location), without opening it; undefined when it cannot be read. */
|
|
27
|
+
sessionCwd(sessionFile: string): Promise<string | undefined>;
|
|
14
28
|
/** 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. */
|
|
15
29
|
onExtensionData(listener: (name: string, key: string, cwd?: string) => void): () => void;
|
|
16
30
|
}
|
|
@@ -39,6 +53,21 @@ export type TaPackageHostFactory = (host: TaExtensionHost) => TaPackageService |
|
|
|
39
53
|
*/
|
|
40
54
|
export const TA_HOST_EVENT = 'ta:host';
|
|
41
55
|
|
|
56
|
+
/**
|
|
57
|
+
* The event of pi's `pi.events` by which an extension whose tools change files without pi's `edit` and
|
|
58
|
+
* `write` (another coding agent's own tools, ta-agents) says which, as soon as it knows and before the
|
|
59
|
+
* write if it can: `pi.events.emit(TA_FILE_WRITE_EVENT, file)`. The list of changed files (ta-changes)
|
|
60
|
+
* keeps what the file holds then.
|
|
61
|
+
*/
|
|
62
|
+
export const TA_FILE_WRITE_EVENT = 'ta:file-write';
|
|
63
|
+
|
|
64
|
+
export interface TaFileWrite {
|
|
65
|
+
/** Absolute, on the machine where the session's tools work. */
|
|
66
|
+
path: string;
|
|
67
|
+
/** Its text before the change, when known (a diff of the agent); null: there was no file. */
|
|
68
|
+
before?: string | null;
|
|
69
|
+
}
|
|
70
|
+
|
|
42
71
|
export interface TaHostRequest {
|
|
43
72
|
/** The `name` of the package.json. */
|
|
44
73
|
name: string;
|
|
@@ -49,4 +78,20 @@ export interface TaHostAnswer {
|
|
|
49
78
|
host: TaExtensionHost;
|
|
50
79
|
/** What the module of `pi.host` of the package returned; undefined when it has none or failed. */
|
|
51
80
|
service?: TaPackageService;
|
|
81
|
+
/** The files of the session that asked, where its tools read and write. */
|
|
82
|
+
files: TaSessionFiles;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The files of a session where its tools work: on the machine of `ta serve`, or on the one of an
|
|
87
|
+
* `ssh://` directory (ExecEnvironment). Paths are those {@link resolve} gives.
|
|
88
|
+
*/
|
|
89
|
+
export interface TaSessionFiles {
|
|
90
|
+
/** The path a tool of the session (read, edit, write) works on for a path of its arguments. */
|
|
91
|
+
resolve(path: string): string;
|
|
92
|
+
/** The bytes of a file; undefined when there is no file there. */
|
|
93
|
+
read(path: string): Promise<Uint8Array | undefined>;
|
|
94
|
+
/** Writes a file, and the directories it needs. */
|
|
95
|
+
write(path: string, data: Uint8Array): Promise<void>;
|
|
96
|
+
remove(path: string): Promise<void>;
|
|
52
97
|
}
|
|
@@ -2,6 +2,7 @@ import { describe, expect, it } from 'bun:test';
|
|
|
2
2
|
import { TA_AUTH_SERVICE, TaAuthServer } from './auth-protocol';
|
|
3
3
|
import { TA_PACKAGE_SERVICE, TaPackageServer } from './package-protocol';
|
|
4
4
|
import { TA_RELAY_SERVICE, TaRelayServer } from './relay-protocol';
|
|
5
|
+
import { TA_REMOTE_SERVICE, TaRemoteServer } from './remote-protocol';
|
|
5
6
|
import { TA_SETTINGS_SERVICE, TaSettingsServer } from './settings-protocol';
|
|
6
7
|
import { type PiCommandMethod, TA_CLIENT_SERVICE, TA_SERVER_SERVICE, TaClient, TaErrorCode, TaMessageContext, TaServer } from './ta-protocol';
|
|
7
8
|
import { TA_TERMINAL_SERVICE, TA_WORKSPACE_SERVICE, TaTerminalServer, TaWorkspaceServer } from './workspace-protocol';
|
|
@@ -31,6 +32,7 @@ describe('ta protocol', () => {
|
|
|
31
32
|
expect(TaPackageServer.description).toBe(TA_PACKAGE_SERVICE);
|
|
32
33
|
expect(TaAuthServer.description).toBe(TA_AUTH_SERVICE);
|
|
33
34
|
expect(TaRelayServer.description).toBe(TA_RELAY_SERVICE);
|
|
35
|
+
expect(TaRemoteServer.description).toBe(TA_REMOTE_SERVICE);
|
|
34
36
|
});
|
|
35
37
|
|
|
36
38
|
it('has a method of TaServer for each command of pi', () => {
|