@celljs/ta-host 4.12.0 → 4.13.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/README.en.md +3 -2
- package/README.md +3 -2
- package/esm/node/extension-data-notifier.d.ts +3 -0
- package/esm/node/extension-data-notifier.js +8 -2
- package/esm/node/extension-providers.js +1 -1
- package/esm/node/host-protocol.d.ts +20 -1
- package/esm/node/host-protocol.js +1 -0
- package/esm/node/index.d.ts +3 -0
- package/esm/node/index.js +3 -0
- package/esm/node/keep-awake.d.ts +44 -0
- package/esm/node/keep-awake.js +112 -0
- package/esm/node/package-host-extension.js +2 -0
- package/esm/node/package-hosts.d.ts +23 -1
- package/esm/node/package-hosts.js +61 -3
- package/esm/node/relay-bridge.d.ts +37 -3
- package/esm/node/relay-bridge.js +271 -10
- package/esm/node/rooms-bridge.d.ts +13 -2
- package/esm/node/rooms-bridge.js +34 -4
- package/esm/node/session-catalog.d.ts +1 -1
- package/esm/node/session-catalog.js +5 -0
- package/esm/node/session-list-feed.d.ts +11 -1
- package/esm/node/session-list-feed.js +17 -3
- package/esm/node/session-resume.d.ts +52 -0
- package/esm/node/session-resume.js +174 -0
- package/esm/node/settings-store.d.ts +3 -0
- package/esm/node/settings-store.js +22 -0
- package/esm/node/ta-errors.d.ts +1 -0
- package/esm/node/ta-errors.js +4 -0
- package/esm/node/ta-server-impl.d.ts +9 -0
- package/esm/node/ta-server-impl.js +52 -7
- package/esm/node/ta-session-factory.js +5 -2
- package/esm/node/ta-session-registry.d.ts +12 -1
- package/esm/node/ta-session-registry.js +30 -1
- package/esm/node/ta-session.d.ts +3 -0
- package/esm/node/ta-session.js +16 -0
- package/esm/node/team/authority.d.ts +19 -0
- package/esm/node/team/authority.js +79 -0
- package/esm/node/team/call-util.d.ts +23 -0
- package/esm/node/team/call-util.js +88 -0
- package/esm/node/team/connections.d.ts +15 -0
- package/esm/node/team/connections.js +81 -0
- package/esm/node/team/host-team.d.ts +13 -0
- package/esm/node/team/host-team.js +69 -0
- package/esm/node/team/index.d.ts +13 -0
- package/esm/node/team/index.js +14 -0
- package/esm/node/team/member-devices.d.ts +11 -0
- package/esm/node/team/member-devices.js +56 -0
- package/esm/node/team/package-permissions.d.ts +23 -0
- package/esm/node/team/package-permissions.js +75 -0
- package/esm/node/team/principals.d.ts +22 -0
- package/esm/node/team/principals.js +72 -0
- package/esm/node/team/run-actors.d.ts +21 -0
- package/esm/node/team/run-actors.js +100 -0
- package/esm/node/team/shared-data.d.ts +18 -0
- package/esm/node/team/shared-data.js +55 -0
- package/esm/node/team/team-calls.d.ts +33 -0
- package/esm/node/team/team-calls.js +266 -0
- package/esm/node/team/team-gate.d.ts +31 -0
- package/esm/node/team/team-gate.js +177 -0
- package/esm/node/team/team-protocol.d.ts +89 -0
- package/esm/node/team/team-protocol.js +27 -0
- package/esm/node/team/visibility.d.ts +13 -0
- package/esm/node/team/visibility.js +50 -0
- package/esm/node/terminal-service.d.ts +5 -0
- package/esm/node/terminal-service.js +11 -2
- package/lib/node/extension-data-notifier.d.ts +3 -0
- package/lib/node/extension-data-notifier.js +8 -2
- package/lib/node/extension-providers.js +1 -1
- package/lib/node/host-protocol.d.ts +20 -1
- package/lib/node/host-protocol.js +2 -1
- package/lib/node/index.d.ts +3 -0
- package/lib/node/index.js +3 -0
- package/lib/node/keep-awake.d.ts +45 -0
- package/lib/node/keep-awake.js +115 -0
- package/lib/node/package-host-extension.js +2 -0
- package/lib/node/package-hosts.d.ts +23 -1
- package/lib/node/package-hosts.js +60 -2
- package/lib/node/relay-bridge.d.ts +37 -3
- package/lib/node/relay-bridge.js +269 -8
- package/lib/node/rooms-bridge.d.ts +13 -2
- package/lib/node/rooms-bridge.js +34 -4
- package/lib/node/session-catalog.d.ts +1 -1
- package/lib/node/session-catalog.js +5 -0
- package/lib/node/session-list-feed.d.ts +11 -1
- package/lib/node/session-list-feed.js +17 -3
- package/lib/node/session-resume.d.ts +53 -0
- package/lib/node/session-resume.js +177 -0
- package/lib/node/settings-store.d.ts +3 -0
- package/lib/node/settings-store.js +22 -0
- package/lib/node/ta-errors.d.ts +1 -0
- package/lib/node/ta-errors.js +4 -0
- package/lib/node/ta-server-impl.d.ts +9 -0
- package/lib/node/ta-server-impl.js +52 -7
- package/lib/node/ta-session-factory.js +4 -1
- package/lib/node/ta-session-registry.d.ts +12 -1
- package/lib/node/ta-session-registry.js +30 -1
- package/lib/node/ta-session.d.ts +3 -0
- package/lib/node/ta-session.js +16 -0
- package/lib/node/team/authority.d.ts +20 -0
- package/lib/node/team/authority.js +82 -0
- package/lib/node/team/call-util.d.ts +24 -0
- package/lib/node/team/call-util.js +91 -0
- package/lib/node/team/connections.d.ts +16 -0
- package/lib/node/team/connections.js +84 -0
- package/lib/node/team/host-team.d.ts +14 -0
- package/lib/node/team/host-team.js +72 -0
- package/lib/node/team/index.d.ts +14 -0
- package/lib/node/team/index.js +30 -0
- package/lib/node/team/member-devices.d.ts +12 -0
- package/lib/node/team/member-devices.js +59 -0
- package/lib/node/team/package-permissions.d.ts +24 -0
- package/lib/node/team/package-permissions.js +78 -0
- package/lib/node/team/principals.d.ts +23 -0
- package/lib/node/team/principals.js +75 -0
- package/lib/node/team/run-actors.d.ts +22 -0
- package/lib/node/team/run-actors.js +103 -0
- package/lib/node/team/shared-data.d.ts +19 -0
- package/lib/node/team/shared-data.js +58 -0
- package/lib/node/team/team-calls.d.ts +34 -0
- package/lib/node/team/team-calls.js +270 -0
- package/lib/node/team/team-gate.d.ts +32 -0
- package/lib/node/team/team-gate.js +180 -0
- package/lib/node/team/team-protocol.d.ts +90 -0
- package/lib/node/team/team-protocol.js +30 -0
- package/lib/node/team/visibility.d.ts +14 -0
- package/lib/node/team/visibility.js +53 -0
- package/lib/node/terminal-service.d.ts +5 -0
- package/lib/node/terminal-service.js +11 -2
- package/package.json +14 -10
|
@@ -17,6 +17,7 @@ const host_protocol_1 = require("./host-protocol");
|
|
|
17
17
|
const session_handles_1 = require("./session-handles");
|
|
18
18
|
const session_list_feed_1 = require("./session-list-feed");
|
|
19
19
|
const ta_errors_1 = require("./ta-errors");
|
|
20
|
+
const team_protocol_1 = require("./team/team-protocol");
|
|
20
21
|
/**
|
|
21
22
|
* The open sessions. A session's id outlives its memory: closed while idle or by a restart, it opens again
|
|
22
23
|
* from its file under the same id at the next call (TaSessionHandles), so clients never see it go.
|
|
@@ -25,13 +26,22 @@ let DefaultTaSessionRegistry = class DefaultTaSessionRegistry {
|
|
|
25
26
|
constructor() {
|
|
26
27
|
this.sessions = new Map();
|
|
27
28
|
this.channels = new WeakMap();
|
|
29
|
+
this.eventListeners = new Set();
|
|
28
30
|
/** Sessions being created count against the limit too. */
|
|
29
31
|
this.opening = 0;
|
|
30
32
|
/** The closes under way, by session file: out of the list already, their files locked until they end. */
|
|
31
33
|
this.closing = new Map();
|
|
32
34
|
/** Sessions opening again under their ids: the calls that come meanwhile wait for the same. */
|
|
33
35
|
this.waking = new Map();
|
|
34
|
-
this.feed = new session_list_feed_1.SessionListFeed(() => this.list().map(session => session.info()));
|
|
36
|
+
this.feed = new session_list_feed_1.SessionListFeed(() => this.list().map(session => session.info()), undefined, (connection, list) => this.visibility.sessions(connection, list));
|
|
37
|
+
}
|
|
38
|
+
locate(sessionId) {
|
|
39
|
+
const session = this.sessions.get(sessionId);
|
|
40
|
+
if (session) {
|
|
41
|
+
return { sessionFile: session.pi.sessionFile, cwd: session.cwd };
|
|
42
|
+
}
|
|
43
|
+
const handle = this.handles.get(sessionId);
|
|
44
|
+
return handle && { sessionFile: handle.sessionFile, cwd: handle.cwd };
|
|
35
45
|
}
|
|
36
46
|
open(options) {
|
|
37
47
|
// A file that had a session keeps its id, which pages may still have.
|
|
@@ -73,6 +83,16 @@ let DefaultTaSessionRegistry = class DefaultTaSessionRegistry {
|
|
|
73
83
|
watch(connection) {
|
|
74
84
|
return this.feed.watch(connection);
|
|
75
85
|
}
|
|
86
|
+
get watching() {
|
|
87
|
+
return this.feed.watching;
|
|
88
|
+
}
|
|
89
|
+
get watchedAt() {
|
|
90
|
+
return this.feed.watchedAt;
|
|
91
|
+
}
|
|
92
|
+
onSessionEvent(listener) {
|
|
93
|
+
this.eventListeners.add(listener);
|
|
94
|
+
return () => this.eventListeners.delete(listener);
|
|
95
|
+
}
|
|
76
96
|
async close(sessionId, idle = false) {
|
|
77
97
|
if (!idle) {
|
|
78
98
|
this.handles.delete(sessionId);
|
|
@@ -134,6 +154,11 @@ let DefaultTaSessionRegistry = class DefaultTaSessionRegistry {
|
|
|
134
154
|
const session = await this.factory.create(options, (ended, idle) => void this.close(ended.id, idle), id);
|
|
135
155
|
this.sessions.set(session.id, session);
|
|
136
156
|
session.onInfoChange(() => this.sessions.get(session.id) === session && this.feed.changed());
|
|
157
|
+
session.onEvent(event => {
|
|
158
|
+
for (const listener of this.eventListeners) {
|
|
159
|
+
listener(session, event);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
137
162
|
this.feed.changed();
|
|
138
163
|
const sessionFile = session.pi.sessionFile;
|
|
139
164
|
if (sessionFile) {
|
|
@@ -159,6 +184,10 @@ __decorate([
|
|
|
159
184
|
(0, core_1.Autowired)(session_handles_1.TaSessionHandles),
|
|
160
185
|
__metadata("design:type", Object)
|
|
161
186
|
], DefaultTaSessionRegistry.prototype, "handles", void 0);
|
|
187
|
+
__decorate([
|
|
188
|
+
(0, core_1.Autowired)({ id: team_protocol_1.TaVisibility, detached: true }),
|
|
189
|
+
__metadata("design:type", Object)
|
|
190
|
+
], DefaultTaSessionRegistry.prototype, "visibility", void 0);
|
|
162
191
|
exports.DefaultTaSessionRegistry = DefaultTaSessionRegistry = __decorate([
|
|
163
192
|
(0, core_1.Component)(host_protocol_1.TaSessionRegistry)
|
|
164
193
|
], DefaultTaSessionRegistry);
|
package/lib/node/ta-session.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export declare class TaSession {
|
|
|
45
45
|
protected idleTimer?: ReturnType<typeof setTimeout>;
|
|
46
46
|
protected started: boolean;
|
|
47
47
|
protected readonly infoListeners: Set<() => void>;
|
|
48
|
+
protected readonly eventListeners: Set<(event: TaEvent) => void>;
|
|
48
49
|
constructor(context: TaSessionContext);
|
|
49
50
|
get pi(): AgentSession;
|
|
50
51
|
/** Where the session works, as clients name it: a path, or an `ssh://` location. */
|
|
@@ -52,6 +53,8 @@ export declare class TaSession {
|
|
|
52
53
|
start(): Promise<void>;
|
|
53
54
|
info(): TaSessionInfo;
|
|
54
55
|
/** What `info` gives may have changed (TaServer.watchSessions). */
|
|
56
|
+
/** Every event of the session, as its clients get it. */
|
|
57
|
+
onEvent(listener: (event: TaEvent) => void): () => void;
|
|
55
58
|
onInfoChange(listener: () => void): () => void;
|
|
56
59
|
attach(channel: ClientChannel, afterSeq?: number, options?: TaAttachOptions): TaAttachResult;
|
|
57
60
|
earlierMessages(before: number | undefined, timestamp: number | undefined, budget: number): TaMessagePage;
|
package/lib/node/ta-session.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TaSession = void 0;
|
|
4
4
|
const node_crypto_1 = require("node:crypto");
|
|
5
|
+
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
5
6
|
const event_log_1 = require("./event-log");
|
|
6
7
|
const live_run_1 = require("./live-run");
|
|
7
8
|
const message_page_1 = require("./message-page");
|
|
@@ -34,6 +35,7 @@ class TaSession {
|
|
|
34
35
|
this.live = new live_run_1.LiveRun();
|
|
35
36
|
this.started = false;
|
|
36
37
|
this.infoListeners = new Set();
|
|
38
|
+
this.eventListeners = new Set();
|
|
37
39
|
this.runtime = context.runtime;
|
|
38
40
|
this.id = (_a = context.id) !== null && _a !== void 0 ? _a : (0, node_crypto_1.randomUUID)();
|
|
39
41
|
// Opened again: its seqs start past any the session gave before (fewer than one per millisecond), so a
|
|
@@ -70,6 +72,7 @@ class TaSession {
|
|
|
70
72
|
model: model ? `${model.provider}/${model.id}` : undefined,
|
|
71
73
|
isStreaming: pi.isStreaming,
|
|
72
74
|
waiting: this.ui.pendingRequests.length > 0,
|
|
75
|
+
asking: ta_protocol_1.TaAskUtil.asking(pi.sessionManager.getBranch()),
|
|
73
76
|
messageCount: pi.messages.length,
|
|
74
77
|
attached: this.channels.size,
|
|
75
78
|
createdAt: this.createdAt,
|
|
@@ -78,6 +81,11 @@ class TaSession {
|
|
|
78
81
|
};
|
|
79
82
|
}
|
|
80
83
|
/** What `info` gives may have changed (TaServer.watchSessions). */
|
|
84
|
+
/** Every event of the session, as its clients get it. */
|
|
85
|
+
onEvent(listener) {
|
|
86
|
+
this.eventListeners.add(listener);
|
|
87
|
+
return () => this.eventListeners.delete(listener);
|
|
88
|
+
}
|
|
81
89
|
onInfoChange(listener) {
|
|
82
90
|
this.infoListeners.add(listener);
|
|
83
91
|
return () => this.infoListeners.delete(listener);
|
|
@@ -289,6 +297,14 @@ class TaSession {
|
|
|
289
297
|
for (const channel of this.channels) {
|
|
290
298
|
channel.send(logged);
|
|
291
299
|
}
|
|
300
|
+
for (const listener of this.eventListeners) {
|
|
301
|
+
try {
|
|
302
|
+
listener(event);
|
|
303
|
+
}
|
|
304
|
+
catch (error) {
|
|
305
|
+
console.error('A listener of the events of a session failed:', error);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
292
308
|
if (INFO_EVENTS.has(event.type)) {
|
|
293
309
|
for (const listener of this.infoListeners) {
|
|
294
310
|
listener();
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type TaAuditEvent, type TaAuthorizer, type TaDenial, type TaMemberInfo, type TaResource, type TaSharedRef } from '@celljs/ta-protocol';
|
|
2
|
+
import { TaAuthority } from './team-protocol';
|
|
3
|
+
/**
|
|
4
|
+
* The authorizer a package gave, and the conversations of agents and channels (a conversation of an agent is checked as
|
|
5
|
+
* the agent): every question about one let in comes here. A failure of the authorizer refuses, never lets.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DefaultTaAuthority implements TaAuthority {
|
|
8
|
+
protected authorizer?: TaAuthorizer;
|
|
9
|
+
protected readonly links: Map<string, TaSharedRef>;
|
|
10
|
+
authorize(authorizer: TaAuthorizer): () => void;
|
|
11
|
+
check(principal: string, action: string, given?: TaResource): true | TaDenial;
|
|
12
|
+
describe(principal: string): TaMemberInfo | undefined;
|
|
13
|
+
record(event: TaAuditEvent): void;
|
|
14
|
+
created(principal: string, resource: TaResource): void;
|
|
15
|
+
admit(principal: string, theirs: number, everyone: number): boolean;
|
|
16
|
+
mayRun(principal: string, running: number): boolean;
|
|
17
|
+
link(sessionFile: string, ref: TaSharedRef | undefined): void;
|
|
18
|
+
protected ask<T>(what: string, answer: () => T, failed: T): T;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=authority.d.ts.map
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.DefaultTaAuthority = void 0;
|
|
10
|
+
const core_1 = require("@celljs/core");
|
|
11
|
+
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
12
|
+
const team_protocol_1 = require("./team-protocol");
|
|
13
|
+
/**
|
|
14
|
+
* The authorizer a package gave, and the conversations of agents and channels (a conversation of an agent is checked as
|
|
15
|
+
* the agent): every question about one let in comes here. A failure of the authorizer refuses, never lets.
|
|
16
|
+
*/
|
|
17
|
+
let DefaultTaAuthority = class DefaultTaAuthority {
|
|
18
|
+
constructor() {
|
|
19
|
+
this.links = new Map();
|
|
20
|
+
}
|
|
21
|
+
authorize(authorizer) {
|
|
22
|
+
this.authorizer = authorizer;
|
|
23
|
+
return () => {
|
|
24
|
+
if (this.authorizer === authorizer) {
|
|
25
|
+
this.authorizer = undefined;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
check(principal, action, given) {
|
|
30
|
+
if (principal === ta_protocol_1.TA_OWNER) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
const of = (given === null || given === void 0 ? void 0 : given.kind) === 'session' ? this.links.get(given.id) : undefined;
|
|
34
|
+
const resource = of && given ? { ...given, of } : given;
|
|
35
|
+
const refused = { action, ...(resource ? { resource } : {}) };
|
|
36
|
+
if (!this.authorizer) {
|
|
37
|
+
return refused;
|
|
38
|
+
}
|
|
39
|
+
return this.ask(`check ${action}`, () => { var _a; var _b; return (_b = (_a = this.authorizer) === null || _a === void 0 ? void 0 : _a.check(principal, action, resource)) !== null && _b !== void 0 ? _b : refused; }, refused);
|
|
40
|
+
}
|
|
41
|
+
describe(principal) {
|
|
42
|
+
return principal === ta_protocol_1.TA_OWNER ? undefined : this.ask('describe', () => { var _a, _b; return (_b = (_a = this.authorizer) === null || _a === void 0 ? void 0 : _a.describe) === null || _b === void 0 ? void 0 : _b.call(_a, principal); }, undefined);
|
|
43
|
+
}
|
|
44
|
+
record(event) {
|
|
45
|
+
if (event.principal !== ta_protocol_1.TA_OWNER) {
|
|
46
|
+
this.ask('record', () => { var _a, _b; return (_b = (_a = this.authorizer) === null || _a === void 0 ? void 0 : _a.record) === null || _b === void 0 ? void 0 : _b.call(_a, event); }, undefined);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
created(principal, resource) {
|
|
50
|
+
if (principal !== ta_protocol_1.TA_OWNER) {
|
|
51
|
+
this.ask('created', () => { var _a, _b; return (_b = (_a = this.authorizer) === null || _a === void 0 ? void 0 : _a.created) === null || _b === void 0 ? void 0 : _b.call(_a, principal, resource); }, undefined);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
admit(principal, theirs, everyone) {
|
|
55
|
+
return this.ask('admit', () => { var _a, _b; var _c; return (_c = (_b = (_a = this.authorizer) === null || _a === void 0 ? void 0 : _a.admit) === null || _b === void 0 ? void 0 : _b.call(_a, principal, theirs, everyone)) !== null && _c !== void 0 ? _c : true; }, false);
|
|
56
|
+
}
|
|
57
|
+
mayRun(principal, running) {
|
|
58
|
+
return principal === ta_protocol_1.TA_OWNER || this.ask('mayRun', () => { var _a, _b; var _c; return (_c = (_b = (_a = this.authorizer) === null || _a === void 0 ? void 0 : _a.mayRun) === null || _b === void 0 ? void 0 : _b.call(_a, principal, running)) !== null && _c !== void 0 ? _c : true; }, false);
|
|
59
|
+
}
|
|
60
|
+
link(sessionFile, ref) {
|
|
61
|
+
if (ref) {
|
|
62
|
+
this.links.set(sessionFile, ref);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
this.links.delete(sessionFile);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
ask(what, answer, failed) {
|
|
69
|
+
try {
|
|
70
|
+
return answer();
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
console.error(`The authorizer failed (${what}): ${error instanceof Error ? error.message : error}`);
|
|
74
|
+
return failed;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
exports.DefaultTaAuthority = DefaultTaAuthority;
|
|
79
|
+
exports.DefaultTaAuthority = DefaultTaAuthority = __decorate([
|
|
80
|
+
(0, core_1.Component)(team_protocol_1.TaAuthority)
|
|
81
|
+
], DefaultTaAuthority);
|
|
82
|
+
//# sourceMappingURL=authority.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { JsonRpc } from '@celljs/rpc';
|
|
2
|
+
import { type TaDenial } from '@celljs/ta-protocol';
|
|
3
|
+
/** A call over the WebSocket, as the gate reads it. */
|
|
4
|
+
export interface TaCall {
|
|
5
|
+
service: string;
|
|
6
|
+
method: string;
|
|
7
|
+
id: JsonRpc.Id | undefined;
|
|
8
|
+
params: unknown[];
|
|
9
|
+
}
|
|
10
|
+
/** Reading a call, what the record keeps of it, and the answer of a refusal: pure, for the gate (TaTeamGate). */
|
|
11
|
+
export declare namespace TaCallUtil {
|
|
12
|
+
/** The service and the method of a call over the WebSocket: `/api/<service>`, `{ method }`. */
|
|
13
|
+
function of(url: string | undefined, body: unknown): TaCall | undefined;
|
|
14
|
+
/** Calls that only read what a page shows, made all the time: not each a line of the record. */
|
|
15
|
+
const QUIET: ReadonlySet<string>;
|
|
16
|
+
/** Calls that answer a question of a run (a dialog, a tool of the client): only who asked the run answers them. */
|
|
17
|
+
const ANSWERS: ReadonlySet<string>;
|
|
18
|
+
/** What a call was given, cut short for the record: a message, a command, a path; never more than 200 characters. */
|
|
19
|
+
function summary(method: string, params: unknown[]): string | undefined;
|
|
20
|
+
/** What is said to the one refused, in English for the model and the log; pages word it from `data`. */
|
|
21
|
+
function message(denial: TaDenial): string;
|
|
22
|
+
function forbidden(id: JsonRpc.Id | undefined, denial: TaDenial): JsonRpc.Response;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=call-util.d.ts.map
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaCallUtil = void 0;
|
|
4
|
+
const rpc_1 = require("@celljs/rpc");
|
|
5
|
+
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
6
|
+
/** Reading a call, what the record keeps of it, and the answer of a refusal: pure, for the gate (TaTeamGate). */
|
|
7
|
+
var TaCallUtil;
|
|
8
|
+
(function (TaCallUtil) {
|
|
9
|
+
/** The service and the method of a call over the WebSocket: `/api/<service>`, `{ method }`. */
|
|
10
|
+
function of(url, body) {
|
|
11
|
+
const request = body;
|
|
12
|
+
const path = (url !== null && url !== void 0 ? url : '').split('?')[0];
|
|
13
|
+
const at = path.lastIndexOf('/');
|
|
14
|
+
if (!request || typeof request.method !== 'string' || at < 0) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
let service;
|
|
18
|
+
try {
|
|
19
|
+
service = decodeURIComponent(path.slice(at + 1));
|
|
20
|
+
}
|
|
21
|
+
catch (_a) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
return { service, method: request.method, id: request.id, params: Array.isArray(request.params) ? request.params : [] };
|
|
25
|
+
}
|
|
26
|
+
TaCallUtil.of = of;
|
|
27
|
+
/** Calls that only read what a page shows, made all the time: not each a line of the record. */
|
|
28
|
+
TaCallUtil.QUIET = new Set([
|
|
29
|
+
'TaServer.getServerInfo',
|
|
30
|
+
'TaServer.listSessions',
|
|
31
|
+
'TaServer.watchSessions',
|
|
32
|
+
'TaServer.listSavedSessions',
|
|
33
|
+
'TaServer.attach',
|
|
34
|
+
'TaServer.detach',
|
|
35
|
+
'TaServer.getState',
|
|
36
|
+
'TaServer.getEarlierMessages',
|
|
37
|
+
'TaServer.getMessageImage',
|
|
38
|
+
'TaServer.getCommands',
|
|
39
|
+
'TaServer.getDirectoryCommands',
|
|
40
|
+
'TaServer.getAvailableModels',
|
|
41
|
+
'TaServer.getAvailableThinkingLevels',
|
|
42
|
+
'TaServer.getSessionStats',
|
|
43
|
+
'TaPackageServer.getExtensionData',
|
|
44
|
+
'TaPackageServer.listWebExtensions',
|
|
45
|
+
'TaPackageServer.readWebExtension',
|
|
46
|
+
'TaPackageServer.listPackages',
|
|
47
|
+
'TaPackageServer.getTemporaryRetention',
|
|
48
|
+
'TaTerminalServer.writeTerminal',
|
|
49
|
+
'TaTerminalServer.resizeTerminal',
|
|
50
|
+
'TaWorkspaceServer.writeTerminal',
|
|
51
|
+
'TaWorkspaceServer.resizeTerminal',
|
|
52
|
+
]);
|
|
53
|
+
/** Calls that answer a question of a run (a dialog, a tool of the client): only who asked the run answers them. */
|
|
54
|
+
TaCallUtil.ANSWERS = new Set(['TaServer.respondUi', 'TaServer.claimClientTool', 'TaServer.respondClientTool']);
|
|
55
|
+
/** What a call was given, cut short for the record: a message, a command, a path; never more than 200 characters. */
|
|
56
|
+
function summary(method, params) {
|
|
57
|
+
const cut = (text) => (typeof text === 'string' && text ? text.replace(/\s+/g, ' ').slice(0, 200) : undefined);
|
|
58
|
+
const second = params[1];
|
|
59
|
+
switch (method) {
|
|
60
|
+
case 'prompt':
|
|
61
|
+
case 'steer':
|
|
62
|
+
case 'followUp':
|
|
63
|
+
return cut(second === null || second === void 0 ? void 0 : second.message);
|
|
64
|
+
case 'bash':
|
|
65
|
+
return cut(params[1]);
|
|
66
|
+
case 'runCommand':
|
|
67
|
+
return cut([params[0], ...(Array.isArray(params[1]) ? params[1] : [])].join(' '));
|
|
68
|
+
case 'callPackageHost': {
|
|
69
|
+
const request = Array.isArray(params[2]) ? params[2][0] : undefined;
|
|
70
|
+
return cut([params[0], params[1], typeof (request === null || request === void 0 ? void 0 : request.kind) === 'string' ? request.kind : ''].filter(Boolean).join(' '));
|
|
71
|
+
}
|
|
72
|
+
default:
|
|
73
|
+
return typeof params[0] === 'string' && params[0].length < 300 ? cut(params[0]) : undefined;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
TaCallUtil.summary = summary;
|
|
77
|
+
/** What is said to the one refused, in English for the model and the log; pages word it from `data`. */
|
|
78
|
+
function message(denial) {
|
|
79
|
+
var _a;
|
|
80
|
+
const what = ta_protocol_1.TaActionUtil.title(denial.action, 'en');
|
|
81
|
+
const where = ((_a = denial.resource) === null || _a === void 0 ? void 0 : _a.kind) === 'dir' ? ` in ${denial.resource.id}` : '';
|
|
82
|
+
return `You may not do this here: it needs "${what}"${where}. Ask the owner of this Ta for it.`;
|
|
83
|
+
}
|
|
84
|
+
TaCallUtil.message = message;
|
|
85
|
+
function forbidden(id, denial) {
|
|
86
|
+
const data = { code: ta_protocol_1.TaErrorCode.FORBIDDEN, hint: 'Ask for it: the owner or an admin answers.', ...denial };
|
|
87
|
+
return rpc_1.JsonRpc.error(id !== null && id !== void 0 ? id : null, ta_protocol_1.TA_RPC_ERROR_CODE, message(denial), { kind: 'application', data });
|
|
88
|
+
}
|
|
89
|
+
TaCallUtil.forbidden = forbidden;
|
|
90
|
+
})(TaCallUtil || (exports.TaCallUtil = TaCallUtil = {}));
|
|
91
|
+
//# sourceMappingURL=call-util.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type RpcConnection, RpcConnectionManager } from '@celljs/rpc/lib/node';
|
|
2
|
+
import { TaAuthority, TaConnections, TaPrincipals } from './team-protocol';
|
|
3
|
+
/**
|
|
4
|
+
* The connections of those let in: counted for the page of members, closed at once when what they were let do is taken
|
|
5
|
+
* back, and, as each opens, let in only within the owner's limits (people online, devices of one).
|
|
6
|
+
*/
|
|
7
|
+
export declare class DefaultTaConnections implements TaConnections {
|
|
8
|
+
protected readonly connections: RpcConnectionManager;
|
|
9
|
+
protected readonly principals: TaPrincipals;
|
|
10
|
+
protected readonly authority: TaAuthority;
|
|
11
|
+
protected init(): void;
|
|
12
|
+
counted(): Record<string, number>;
|
|
13
|
+
close(principal: string): number;
|
|
14
|
+
protected admit(connection: RpcConnection): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=connections.d.ts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DefaultTaConnections = void 0;
|
|
13
|
+
const core_1 = require("@celljs/core");
|
|
14
|
+
const node_1 = require("@celljs/rpc/lib/node");
|
|
15
|
+
const ta_protocol_1 = require("@celljs/ta-protocol");
|
|
16
|
+
const team_protocol_1 = require("./team-protocol");
|
|
17
|
+
/**
|
|
18
|
+
* The connections of those let in: counted for the page of members, closed at once when what they were let do is taken
|
|
19
|
+
* back, and, as each opens, let in only within the owner's limits (people online, devices of one).
|
|
20
|
+
*/
|
|
21
|
+
let DefaultTaConnections = class DefaultTaConnections {
|
|
22
|
+
init() {
|
|
23
|
+
this.connections.onConnect(connection => this.admit(connection));
|
|
24
|
+
}
|
|
25
|
+
counted() {
|
|
26
|
+
var _a;
|
|
27
|
+
const counts = {};
|
|
28
|
+
for (const connection of this.connections.connections) {
|
|
29
|
+
const principal = this.principals.of(connection);
|
|
30
|
+
if (principal !== ta_protocol_1.TA_OWNER && !connection.closed) {
|
|
31
|
+
counts[principal] = ((_a = counts[principal]) !== null && _a !== void 0 ? _a : 0) + 1;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return counts;
|
|
35
|
+
}
|
|
36
|
+
close(principal) {
|
|
37
|
+
let closed = 0;
|
|
38
|
+
for (const connection of [...this.connections.connections]) {
|
|
39
|
+
if (this.principals.of(connection) === principal && !connection.closed) {
|
|
40
|
+
connection.close(4403, 'What this was let do was taken back.');
|
|
41
|
+
closed++;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return closed;
|
|
45
|
+
}
|
|
46
|
+
admit(connection) {
|
|
47
|
+
const principal = this.principals.of(connection);
|
|
48
|
+
if (principal === ta_protocol_1.TA_OWNER || principal.startsWith(ta_protocol_1.TA_INVITE_PREFIX)) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const open = this.connections.connections.filter(one => !one.closed && one !== connection);
|
|
52
|
+
const theirs = open.filter(one => this.principals.of(one) === principal).length;
|
|
53
|
+
const everyone = new Set(open.map(one => this.principals.of(one)).filter(one => one !== ta_protocol_1.TA_OWNER && !one.startsWith(ta_protocol_1.TA_INVITE_PREFIX)));
|
|
54
|
+
everyone.add(principal);
|
|
55
|
+
const admitted = this.authority.admit(principal, theirs, everyone.size);
|
|
56
|
+
this.authority.record({ principal, kind: 'connect', name: 'connect', allowed: admitted });
|
|
57
|
+
if (!admitted) {
|
|
58
|
+
connection.close(4429, 'Too many people are in this Ta now; try again later.');
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
exports.DefaultTaConnections = DefaultTaConnections;
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, core_1.Autowired)(node_1.RpcConnectionManager),
|
|
65
|
+
__metadata("design:type", Object)
|
|
66
|
+
], DefaultTaConnections.prototype, "connections", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, core_1.Autowired)(team_protocol_1.TaPrincipals),
|
|
69
|
+
__metadata("design:type", Object)
|
|
70
|
+
], DefaultTaConnections.prototype, "principals", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, core_1.Autowired)(team_protocol_1.TaAuthority),
|
|
73
|
+
__metadata("design:type", Object)
|
|
74
|
+
], DefaultTaConnections.prototype, "authority", void 0);
|
|
75
|
+
__decorate([
|
|
76
|
+
(0, core_1.PostConstruct)(),
|
|
77
|
+
__metadata("design:type", Function),
|
|
78
|
+
__metadata("design:paramtypes", []),
|
|
79
|
+
__metadata("design:returntype", void 0)
|
|
80
|
+
], DefaultTaConnections.prototype, "init", null);
|
|
81
|
+
exports.DefaultTaConnections = DefaultTaConnections = __decorate([
|
|
82
|
+
(0, core_1.Component)(team_protocol_1.TaConnections)
|
|
83
|
+
], DefaultTaConnections);
|
|
84
|
+
//# sourceMappingURL=connections.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TaHostTeam } from '@celljs/ta-protocol';
|
|
2
|
+
import { TaAuthority, TaConnections, TaHostTeamProvider, TaMemberDevices, TaPackagePermissions, TaPrincipals, TaRunActors, TaSharedDataRegistry } from './team-protocol';
|
|
3
|
+
/** The face of the parts of ta serve that let people in, as the server side of packages gets it (TaExtensionHost.team). */
|
|
4
|
+
export declare class DefaultTaHostTeamProvider implements TaHostTeamProvider {
|
|
5
|
+
protected readonly principals: TaPrincipals;
|
|
6
|
+
protected readonly authority: TaAuthority;
|
|
7
|
+
protected readonly runs: TaRunActors;
|
|
8
|
+
protected readonly shared: TaSharedDataRegistry;
|
|
9
|
+
protected readonly permissions: TaPackagePermissions;
|
|
10
|
+
protected readonly devices: TaMemberDevices;
|
|
11
|
+
protected readonly connections: TaConnections;
|
|
12
|
+
readonly team: TaHostTeam;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=host-team.d.ts.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DefaultTaHostTeamProvider = void 0;
|
|
13
|
+
const core_1 = require("@celljs/core");
|
|
14
|
+
const team_protocol_1 = require("./team-protocol");
|
|
15
|
+
/** The face of the parts of ta serve that let people in, as the server side of packages gets it (TaExtensionHost.team). */
|
|
16
|
+
let DefaultTaHostTeamProvider = class DefaultTaHostTeamProvider {
|
|
17
|
+
constructor() {
|
|
18
|
+
this.team = {
|
|
19
|
+
authorize: authorizer => this.authority.authorize(authorizer),
|
|
20
|
+
current: () => this.principals.current(),
|
|
21
|
+
actAs: (principal, run) => this.principals.actAs(principal, run),
|
|
22
|
+
can: (principal, action, resource) => this.authority.check(principal, action, resource) === true,
|
|
23
|
+
describe: principal => this.authority.describe(principal),
|
|
24
|
+
toolAction: tool => this.permissions.tool(tool),
|
|
25
|
+
shareData: (name, data) => this.shared.add(name, data),
|
|
26
|
+
link: (sessionFile, ref) => this.authority.link(sessionFile, ref),
|
|
27
|
+
actorsOf: sessionFile => this.runs.actorsOf(sessionFile),
|
|
28
|
+
connected: () => this.connections.counted(),
|
|
29
|
+
disconnect: principal => {
|
|
30
|
+
const closed = this.connections.close(principal);
|
|
31
|
+
this.runs.stopRunsOf(principal);
|
|
32
|
+
return closed;
|
|
33
|
+
},
|
|
34
|
+
pair: (principal, name, expiresAt) => this.devices.pair(principal, name, expiresAt),
|
|
35
|
+
unpair: deviceId => this.devices.unpair(deviceId),
|
|
36
|
+
devices: () => this.devices.list(),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.DefaultTaHostTeamProvider = DefaultTaHostTeamProvider;
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, core_1.Autowired)(team_protocol_1.TaPrincipals),
|
|
43
|
+
__metadata("design:type", Object)
|
|
44
|
+
], DefaultTaHostTeamProvider.prototype, "principals", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, core_1.Autowired)(team_protocol_1.TaAuthority),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], DefaultTaHostTeamProvider.prototype, "authority", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, core_1.Autowired)(team_protocol_1.TaRunActors),
|
|
51
|
+
__metadata("design:type", Object)
|
|
52
|
+
], DefaultTaHostTeamProvider.prototype, "runs", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, core_1.Autowired)(team_protocol_1.TaSharedDataRegistry),
|
|
55
|
+
__metadata("design:type", Object)
|
|
56
|
+
], DefaultTaHostTeamProvider.prototype, "shared", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, core_1.Autowired)(team_protocol_1.TaPackagePermissions),
|
|
59
|
+
__metadata("design:type", Object)
|
|
60
|
+
], DefaultTaHostTeamProvider.prototype, "permissions", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, core_1.Autowired)(team_protocol_1.TaMemberDevices),
|
|
63
|
+
__metadata("design:type", Object)
|
|
64
|
+
], DefaultTaHostTeamProvider.prototype, "devices", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, core_1.Autowired)(team_protocol_1.TaConnections),
|
|
67
|
+
__metadata("design:type", Object)
|
|
68
|
+
], DefaultTaHostTeamProvider.prototype, "connections", void 0);
|
|
69
|
+
exports.DefaultTaHostTeamProvider = DefaultTaHostTeamProvider = __decorate([
|
|
70
|
+
(0, core_1.Component)(team_protocol_1.TaHostTeamProvider)
|
|
71
|
+
], DefaultTaHostTeamProvider);
|
|
72
|
+
//# sourceMappingURL=host-team.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './authority';
|
|
2
|
+
export * from './call-util';
|
|
3
|
+
export * from './connections';
|
|
4
|
+
export * from './host-team';
|
|
5
|
+
export * from './member-devices';
|
|
6
|
+
export * from './package-permissions';
|
|
7
|
+
export * from './principals';
|
|
8
|
+
export * from './run-actors';
|
|
9
|
+
export * from './shared-data';
|
|
10
|
+
export * from './team-calls';
|
|
11
|
+
export * from './team-gate';
|
|
12
|
+
export * from './team-protocol';
|
|
13
|
+
export * from './visibility';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./authority"), exports);
|
|
18
|
+
__exportStar(require("./call-util"), exports);
|
|
19
|
+
__exportStar(require("./connections"), exports);
|
|
20
|
+
__exportStar(require("./host-team"), exports);
|
|
21
|
+
__exportStar(require("./member-devices"), exports);
|
|
22
|
+
__exportStar(require("./package-permissions"), exports);
|
|
23
|
+
__exportStar(require("./principals"), exports);
|
|
24
|
+
__exportStar(require("./run-actors"), exports);
|
|
25
|
+
__exportStar(require("./shared-data"), exports);
|
|
26
|
+
__exportStar(require("./team-calls"), exports);
|
|
27
|
+
__exportStar(require("./team-gate"), exports);
|
|
28
|
+
__exportStar(require("./team-protocol"), exports);
|
|
29
|
+
__exportStar(require("./visibility"), exports);
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type TaTeamDevice, type TaTeamPairing } from '@celljs/ta-protocol';
|
|
2
|
+
import { type RelayBridge } from '../relay-bridge';
|
|
3
|
+
import { TaMemberDevices } from './team-protocol';
|
|
4
|
+
/** The devices of those let in, kept with the owner's in relay.json (RelayDevice.member), each reaching ta serve end to end. */
|
|
5
|
+
export declare class DefaultTaMemberDevices implements TaMemberDevices {
|
|
6
|
+
protected readonly relay: RelayBridge;
|
|
7
|
+
pair(principal: string, name: string, expiresAt?: number): Promise<TaTeamPairing>;
|
|
8
|
+
/** Only one of those let in: the owner's own devices are taken out in Settings. */
|
|
9
|
+
unpair(deviceId: string): void;
|
|
10
|
+
list(): TaTeamDevice[];
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=member-devices.d.ts.map
|