@ai-workbench/connect 0.7.23 → 0.7.27
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 +24 -69
- package/client/index.cjs +95 -70
- package/helper/host-directories.cjs +8 -1
- package/lib/api.d.ts +21 -163
- package/lib/component-download.d.ts +1 -1
- package/lib/component-download.js +1 -1
- package/lib/component-source.d.ts +6 -27
- package/lib/component-source.js +10 -138
- package/lib/components.d.ts +1 -1
- package/lib/components.js +86 -98
- package/lib/connect.d.ts +0 -3
- package/lib/connect.js +15 -62
- package/lib/connection-messages.d.ts +2 -3
- package/lib/connection-messages.js +5 -4
- package/lib/conversation-log.d.ts +9 -0
- package/lib/conversation-log.js +44 -0
- package/lib/cordis.d.ts +1 -4
- package/lib/defaults.d.ts +0 -10
- package/lib/defaults.js +1 -3
- package/lib/enrollment.js +1 -8
- package/lib/host-directories.d.ts +6 -4
- package/lib/host-directories.js +4 -4
- package/lib/host-session-projects.d.ts +8 -58
- package/lib/host-session-projects.js +45 -270
- package/lib/index.d.ts +3 -12
- package/lib/index.js +14 -26
- package/lib/integration.d.ts +2 -2
- package/lib/integration.js +0 -3
- package/lib/login.d.ts +0 -8
- package/lib/native-workspace.d.ts +10 -0
- package/lib/needs.js +15 -27
- package/lib/network.d.ts +0 -4
- package/lib/network.js +4 -88
- package/lib/ports.d.ts +1 -6
- package/lib/profile-activation.d.ts +0 -3
- package/lib/profile-activation.js +8 -2
- package/lib/profile-runtime.js +60 -153
- package/lib/profile-settings.d.ts +6 -1
- package/lib/profile-settings.js +3 -5
- package/lib/provider.d.ts +1 -15
- package/lib/provider.js +2 -18
- package/lib/startup.js +3 -3
- package/lib/workspace-directory-picker-types.d.ts +44 -0
- package/lib/workspace-directory-picker-types.js +1 -0
- package/lib/workspace-directory-picker.d.ts +30 -0
- package/lib/workspace-directory-picker.js +372 -0
- package/lib/workspace-location-types.d.ts +3 -7
- package/lib/workspace-locations.d.ts +5 -29
- package/lib/workspace-locations.js +81 -204
- package/package.json +3 -2
- package/helper/projects.cjs +0 -57
- package/lib/conversation-detail-settings.d.ts +0 -32
- package/lib/conversation-detail-settings.js +0 -119
- package/lib/conversation-details.d.ts +0 -30
- package/lib/conversation-details.js +0 -595
- package/lib/host-session-store.d.ts +0 -27
- package/lib/host-session-store.js +0 -130
- package/lib/local-acceptance-store.d.ts +0 -18
- package/lib/local-acceptance-store.js +0 -133
- package/lib/local-user-turn-acceptance.d.ts +0 -76
- package/lib/local-user-turn-acceptance.js +0 -289
- package/lib/local-user-turn-types.d.ts +0 -40
- package/lib/login-diagnostics.d.ts +0 -28
- package/lib/login-diagnostics.js +0 -57
- package/lib/projects.d.ts +0 -4
- package/lib/projects.js +0 -41
- package/lib/workspace-bindings.d.ts +0 -64
- package/lib/workspace-bindings.js +0 -379
- /package/lib/{local-user-turn-types.js → native-workspace.js} +0 -0
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { Provider } from './api.ts';
|
|
2
|
-
export interface LocalUserTurnAcceptanceRequest {
|
|
3
|
-
instanceId: string;
|
|
4
|
-
epoch: number;
|
|
5
|
-
sessionId: string;
|
|
6
|
-
provider: Provider;
|
|
7
|
-
purpose: 'user-turn';
|
|
8
|
-
workspaceId: string;
|
|
9
|
-
expectedBindingId: string;
|
|
10
|
-
expectedDirectory: {
|
|
11
|
-
device: number;
|
|
12
|
-
inode: number;
|
|
13
|
-
};
|
|
14
|
-
expectedUserTurn: {
|
|
15
|
-
turn: number;
|
|
16
|
-
userMessageId: string;
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
export interface LocalUserTurnAcceptance {
|
|
20
|
-
version: 1;
|
|
21
|
-
acceptanceId: string;
|
|
22
|
-
instanceId: string;
|
|
23
|
-
epoch: number;
|
|
24
|
-
sessionId: string;
|
|
25
|
-
provider: Provider;
|
|
26
|
-
workspaceId: string;
|
|
27
|
-
bindingId: string;
|
|
28
|
-
source: 'local';
|
|
29
|
-
directory: {
|
|
30
|
-
path: string;
|
|
31
|
-
device: number;
|
|
32
|
-
inode: number;
|
|
33
|
-
};
|
|
34
|
-
userTurn: {
|
|
35
|
-
turn: number;
|
|
36
|
-
startSequence: number;
|
|
37
|
-
userMessageId: string;
|
|
38
|
-
userMessageSequence: number;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { RemoteConversationDetail } from './api.ts';
|
|
2
|
-
import { type ConversationDetailOptions } from './conversation-details.ts';
|
|
3
|
-
export declare function validLoginDiagnostic(detail: RemoteConversationDetail): boolean;
|
|
4
|
-
export declare function createLoginDiagnostics(options: Omit<ConversationDetailOptions, 'storageName' | 'validate' | 'knownKinds'>): {
|
|
5
|
-
appendLoginDiagnostic: (detail: RemoteConversationDetail, scope?: {
|
|
6
|
-
localAcceptanceId: string;
|
|
7
|
-
}) => Promise<import("./api.ts").Result<{
|
|
8
|
-
eventId: string;
|
|
9
|
-
recorded: true;
|
|
10
|
-
}>>;
|
|
11
|
-
getLoginDiagnosticReceipt: (query: {
|
|
12
|
-
eventId: string;
|
|
13
|
-
sessionId: string;
|
|
14
|
-
provider: import("./api.ts").Provider;
|
|
15
|
-
}) => Promise<import("./api.ts").Result<{
|
|
16
|
-
eventId: string;
|
|
17
|
-
recorded: false;
|
|
18
|
-
} | {
|
|
19
|
-
eventId: string;
|
|
20
|
-
recorded: true;
|
|
21
|
-
detail: RemoteConversationDetail;
|
|
22
|
-
}>>;
|
|
23
|
-
listLoginDiagnostics: (query: import("./api.ts").RemoteDetailQuery) => Promise<import("./api.ts").Result<import("./api.ts").RemoteDetailPage>>;
|
|
24
|
-
getLoginDiagnosticState: () => import("./api.ts").RemoteConversationDetailState;
|
|
25
|
-
onLoginDiagnosticState: (listener: (state: import("./api.ts").RemoteConversationDetailState) => void) => () => void;
|
|
26
|
-
observeConnection: (state: import("./api.ts").ConnectionState) => void;
|
|
27
|
-
dispose: () => Promise<void>;
|
|
28
|
-
};
|
package/lib/login-diagnostics.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { createConversationDetails, validRemoteConversationDetail } from "./conversation-details.js";
|
|
2
|
-
import { validAuthDiagnosticReason } from "./auth-diagnostics.js";
|
|
3
|
-
const object = (value) => !!value && typeof value === 'object' && !Array.isArray(value);
|
|
4
|
-
const keys = (value, required, optional = []) => required.every(key => Object.hasOwn(value, key)) && Object.keys(value).every(key => required.includes(key) || optional.includes(key));
|
|
5
|
-
const providers = (value) => Array.isArray(value) && value.every(provider => provider === 'claude' || provider === 'codex') && new Set(value).size === value.length;
|
|
6
|
-
// Only structured status facts belong here. Ordinary user-turn payloads retain D19's scope.
|
|
7
|
-
function validPreflightPayload(payload) {
|
|
8
|
-
if (!object(payload) || !keys(payload, ['phase', 'stage', 'workspaceId', 'bindingId', 'source', 'status', 'outcome']))
|
|
9
|
-
return false;
|
|
10
|
-
const id = (value) => value === null || typeof value === 'string' && value.length > 0 && !/[\x00-\x1f\x7f]/.test(value);
|
|
11
|
-
return payload.phase === 'workspace-source-admission'
|
|
12
|
-
&& ['source-context', 'source-confirmation', 'input-acceptance', 'login-readiness', 'local-admission', 'input-prepare', 'model-catalog', 'runtime-resolve'].includes(payload.stage)
|
|
13
|
-
&& id(payload.workspaceId) && id(payload.bindingId)
|
|
14
|
-
&& [null, 'local', 'host', 'legacy-host'].includes(payload.source)
|
|
15
|
-
&& [null, 'unselected', 'selected', 'legacy-confirmation-required', 'invalid'].includes(payload.status)
|
|
16
|
-
&& ['confirmation-required', 'confirmed', 'declined', 'cancelled', 'failed'].includes(payload.outcome);
|
|
17
|
-
}
|
|
18
|
-
export function validLoginDiagnostic(detail) {
|
|
19
|
-
if (!validRemoteConversationDetail(detail))
|
|
20
|
-
return false;
|
|
21
|
-
if (detail.kind === 'preflight-check')
|
|
22
|
-
return validPreflightPayload(detail.payload);
|
|
23
|
-
if (detail.kind !== 'login-check')
|
|
24
|
-
return false;
|
|
25
|
-
const p = detail.payload;
|
|
26
|
-
if (!object(p) || !keys(p, ['reason', 'connection', 'login'], ['observedLoginInstanceId', 'officialReason', 'officialReasonRejected']))
|
|
27
|
-
return false;
|
|
28
|
-
const c = p.connection, l = p.login;
|
|
29
|
-
if (typeof p.reason !== 'string' || !/^[A-Z][A-Z0-9_]*$/.test(p.reason) || !object(c) || !object(l))
|
|
30
|
-
return false;
|
|
31
|
-
if (!keys(c, ['phase', 'instanceId', 'epoch']) || !['connecting', 'connected', 'unavailable', 'disposed'].includes(c.phase) || c.instanceId !== detail.instanceId || c.epoch !== detail.epoch)
|
|
32
|
-
return false;
|
|
33
|
-
if (!keys(l, ['phase', 'instanceId', 'logins', 'queuedProviders', 'checkingProviders']) || !['checking', 'blocked', 'login-required', 'authorizing', 'idle', 'disposed'].includes(l.phase) || !object(l.logins))
|
|
34
|
-
return false;
|
|
35
|
-
// The observed ID is diagnostic evidence only. Event/connection scope remains current.
|
|
36
|
-
if (Object.hasOwn(p, 'observedLoginInstanceId')) {
|
|
37
|
-
const observed = p.observedLoginInstanceId;
|
|
38
|
-
if (p.reason !== 'LOGIN_INSTANCE_MISMATCH' || typeof observed !== 'string' || !observed.length || /[\x00-\x1f\x7f]/.test(observed) || observed === detail.instanceId || l.instanceId !== observed)
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
else if (l.instanceId !== detail.instanceId)
|
|
42
|
-
return false;
|
|
43
|
-
if (!keys(l.logins, [], ['claude', 'codex']) || !Object.values(l.logins).every(value => typeof value === 'boolean' || value === 'absent') || !providers(l.queuedProviders) || !providers(l.checkingProviders))
|
|
44
|
-
return false;
|
|
45
|
-
if (p.officialReasonRejected !== undefined) {
|
|
46
|
-
const rejected = p.officialReasonRejected;
|
|
47
|
-
if (p.reason !== 'OFFICIAL_REASON_UNSUPPORTED' || p.officialReason !== undefined || !object(rejected) || !keys(rejected, ['bytes', 'sha256']) || !Number.isSafeInteger(rejected.bytes) || Number(rejected.bytes) < 0 || typeof rejected.sha256 !== 'string' || !/^[a-f0-9]{64}$/.test(rejected.sha256))
|
|
48
|
-
return false;
|
|
49
|
-
}
|
|
50
|
-
if (p.reason === 'OFFICIAL_REASON_UNSUPPORTED' && p.officialReasonRejected === undefined)
|
|
51
|
-
return false;
|
|
52
|
-
return p.officialReason === undefined || validAuthDiagnosticReason(p.officialReason);
|
|
53
|
-
}
|
|
54
|
-
export function createLoginDiagnostics(options) {
|
|
55
|
-
const details = createConversationDetails({ ...options, get maxEventBytes() { return options.maxEventBytes; }, get pageSize() { return options.pageSize; }, context: () => options.context(), scope: (sessionId, provider) => options.scope(sessionId, provider), storageName: 'login-diagnostics', knownKinds: ['login-check', 'preflight-check'], validate: validLoginDiagnostic });
|
|
56
|
-
return { appendLoginDiagnostic: details.appendRemoteConversationDetail, getLoginDiagnosticReceipt: details.getRemoteConversationDetailReceipt, listLoginDiagnostics: details.listRemoteConversationDetails, getLoginDiagnosticState: details.getRemoteConversationDetailState, onLoginDiagnosticState: details.onRemoteConversationDetailState, observeConnection: details.observeConnection, dispose: details.dispose };
|
|
57
|
-
}
|
package/lib/projects.d.ts
DELETED
package/lib/projects.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { readFile } from 'node:fs/promises';
|
|
2
|
-
import { runRemote } from "./ssh.js";
|
|
3
|
-
import { fail, ok } from "./needs.js";
|
|
4
|
-
export function isProjectName(name) { return typeof name === 'string' && name !== '' && name !== '.' && name !== '..' && !/[\\/\x00-\x1f\x7f]/.test(name); }
|
|
5
|
-
const codes = ['PROJECT_ROOT_INVALID', 'PROJECT_EXISTS', 'PROJECT_INIT_FAILED', 'PROJECT_CREATE_FAILED', 'PROJECT_LIST_FAILED', 'PROJECT_NAME_INVALID'];
|
|
6
|
-
const reasons = new Set(['invalid-name', 'symlink', 'not-directory', 'permissions', 'not-git', 'invalid-git', 'outside-root']);
|
|
7
|
-
function validProject(value, root) {
|
|
8
|
-
return typeof value === 'object' && value !== null && 'name' in value && typeof value.name === 'string' && isProjectName(value.name) && 'path' in value && value.path === root + '/' + value.name;
|
|
9
|
-
}
|
|
10
|
-
export function createProjects(runner) {
|
|
11
|
-
const request = async (t, operation, signal, name) => {
|
|
12
|
-
if (operation === 'create' && !isProjectName(name))
|
|
13
|
-
return fail('PROJECT_NAME_INVALID');
|
|
14
|
-
try {
|
|
15
|
-
const source = await readFile(new URL('../helper/projects.cjs', import.meta.url), 'utf8');
|
|
16
|
-
const command = 'node -e ' + "'" + (source + '\nmain();').replaceAll("'", "'\\''") + "'";
|
|
17
|
-
const raw = await runRemote(runner, t, command, signal, JSON.stringify({ protocolVersion: 1, operation, root: t.projectRoot, ...(operation === 'create' ? { name } : {}) }));
|
|
18
|
-
if (signal.aborted)
|
|
19
|
-
return fail('CONNECTION_LOST');
|
|
20
|
-
if (raw.exitCode !== 0)
|
|
21
|
-
return fail(operation === 'list' ? 'PROJECT_LIST_FAILED' : 'PROJECT_CREATE_FAILED');
|
|
22
|
-
const result = JSON.parse(raw.stdout);
|
|
23
|
-
if (result.protocolVersion !== 1 || typeof result.ok !== 'boolean')
|
|
24
|
-
return fail('PROJECT_PROTOCOL_INVALID');
|
|
25
|
-
if (!result.ok) {
|
|
26
|
-
const code = codes.find(code => code === result.error?.code);
|
|
27
|
-
return fail(code ?? 'PROJECT_PROTOCOL_INVALID');
|
|
28
|
-
}
|
|
29
|
-
if (operation === 'create')
|
|
30
|
-
return validProject(result.value, t.projectRoot) && result.value.name === name ? ok(result.value) : fail('PROJECT_PROTOCOL_INVALID');
|
|
31
|
-
const list = result.value;
|
|
32
|
-
if (!list || !Array.isArray(list.projects) || !Array.isArray(list.unavailable) || !list.projects.every((p) => validProject(p, t.projectRoot)) || !list.unavailable.every((p) => p && typeof p.name === 'string' && reasons.has(p.reason)))
|
|
33
|
-
return fail('PROJECT_PROTOCOL_INVALID');
|
|
34
|
-
return ok(list);
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
return fail(operation === 'list' ? 'PROJECT_LIST_FAILED' : 'PROJECT_CREATE_FAILED');
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
return { list: (t, s) => request(t, 'list', s), create: (t, n, s) => request(t, 'create', s, n) };
|
|
41
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import type { ConnectApi, Project, SessionProjectTarget, Result, ConnectionState, WorkspaceBindingState, WorkspaceNoticeReceipt, WorkspaceUse, Provider, SshTarget } from './api.ts';
|
|
2
|
-
export interface NativeWorkspace {
|
|
3
|
-
id: string;
|
|
4
|
-
path: string;
|
|
5
|
-
title: string;
|
|
6
|
-
sessionIds: string[];
|
|
7
|
-
}
|
|
8
|
-
export interface NativeWorkspaceRegistry {
|
|
9
|
-
get(id: string): NativeWorkspace | undefined;
|
|
10
|
-
list(): NativeWorkspace[];
|
|
11
|
-
}
|
|
12
|
-
interface Claim {
|
|
13
|
-
id: string;
|
|
14
|
-
sessionId: string;
|
|
15
|
-
provider: Provider;
|
|
16
|
-
owner: string;
|
|
17
|
-
deliveryId?: string;
|
|
18
|
-
}
|
|
19
|
-
interface Binding {
|
|
20
|
-
key: string;
|
|
21
|
-
identity: string;
|
|
22
|
-
workspaceId: string;
|
|
23
|
-
localPath: string;
|
|
24
|
-
localDev: number;
|
|
25
|
-
localIno: number;
|
|
26
|
-
project: Project;
|
|
27
|
-
bindingId: string;
|
|
28
|
-
noticeId: string;
|
|
29
|
-
sessionIds: string[];
|
|
30
|
-
accepted?: {
|
|
31
|
-
sessionId: string;
|
|
32
|
-
provider: Provider;
|
|
33
|
-
}[];
|
|
34
|
-
phase: 'intent' | 'bound';
|
|
35
|
-
settings: 'pending' | 'displayed';
|
|
36
|
-
provider: 'pending' | 'claimed' | 'delivered' | 'unknown';
|
|
37
|
-
claim?: Claim;
|
|
38
|
-
}
|
|
39
|
-
export interface WorkspaceBindingOptions {
|
|
40
|
-
profileDir: string;
|
|
41
|
-
metadataMaxBytes: number;
|
|
42
|
-
api: Pick<ConnectApi, 'getConnectionState' | 'getSshTarget' | 'listProjects' | 'createProject' | 'ensureReady'>;
|
|
43
|
-
registry: NativeWorkspaceRegistry;
|
|
44
|
-
readHeader: (sessionId: string) => Promise<{
|
|
45
|
-
id: string;
|
|
46
|
-
cwd?: string;
|
|
47
|
-
} | undefined>;
|
|
48
|
-
nextRevision?: () => number;
|
|
49
|
-
onState?: (state: WorkspaceBindingState) => void;
|
|
50
|
-
diagnostic?: (error: unknown) => void;
|
|
51
|
-
}
|
|
52
|
-
export declare function createWorkspaceBindings(options: WorkspaceBindingOptions): {
|
|
53
|
-
readLegacyLocations: () => Promise<Binding[]>;
|
|
54
|
-
observeConnection(state: ConnectionState): void;
|
|
55
|
-
dispose(): Promise<unknown>;
|
|
56
|
-
verifyRemoteConversationScope: (sessionId: string, provider: Provider, target: SshTarget) => Promise<Result<{
|
|
57
|
-
identity: string;
|
|
58
|
-
}>>;
|
|
59
|
-
getWorkspaceBindingState: () => WorkspaceBindingState;
|
|
60
|
-
onWorkspaceBindingState(listener: (state: WorkspaceBindingState) => void): () => void;
|
|
61
|
-
acknowledgeWorkspaceNotice: (receipt: WorkspaceNoticeReceipt) => Promise<Result<void>>;
|
|
62
|
-
resolveSessionProject: (sessionId: string, use: WorkspaceUse) => Promise<Result<SessionProjectTarget>>;
|
|
63
|
-
};
|
|
64
|
-
export {};
|
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
import { lstat, realpath, open, rename, rm } from 'node:fs/promises';
|
|
2
|
-
import { join, isAbsolute, basename } from 'node:path';
|
|
3
|
-
import { createHash, randomUUID } from 'node:crypto';
|
|
4
|
-
import { privateDirectory, readPrivate } from "./private-files.js";
|
|
5
|
-
import { isProjectName } from "./projects.js";
|
|
6
|
-
import { ok, fail, NeedError, need } from "./needs.js";
|
|
7
|
-
// All bindings belonging to one profile share reservation ordering, including reopened service instances.
|
|
8
|
-
const queues = new Map();
|
|
9
|
-
const hash = (v) => createHash('sha256').update(JSON.stringify(v)).digest('hex');
|
|
10
|
-
const token = (v) => typeof v === 'string' && v.length > 0 && !/[\x00-\x1f\x7f]/.test(v);
|
|
11
|
-
const integrity = (r) => hash([r.identity, r.workspaceId, r.localPath, r.localDev, r.localIno, r.project, r.bindingId, r.noticeId, r.sessionIds, ...(r.accepted === undefined ? [] : [r.accepted])]);
|
|
12
|
-
export function createWorkspaceBindings(options) {
|
|
13
|
-
const root = join(options.profileDir, 'ai-workbench-connect'), file = join(root, 'workspaces.json'), owner = randomUUID();
|
|
14
|
-
let revision = 0, disposed = false, tail = Promise.resolve(), snapshot = { instanceId: options.api.getConnectionState().instanceId, revision: 0, items: [] };
|
|
15
|
-
let latest = [];
|
|
16
|
-
const listeners = new Set(), statuses = new Map();
|
|
17
|
-
const same = (a) => { const b = options.api.getConnectionState(); return !disposed && b.phase === 'connected' && b.instanceId === a.instanceId && b.epoch === a.epoch; };
|
|
18
|
-
const stale = () => fail(disposed ? 'DISPOSED' : 'CONNECTION_LOST');
|
|
19
|
-
const diagnostic = (error) => options.diagnostic?.(error);
|
|
20
|
-
function publish(items) {
|
|
21
|
-
if (disposed)
|
|
22
|
-
return;
|
|
23
|
-
latest = items;
|
|
24
|
-
snapshot = { instanceId: options.api.getConnectionState().instanceId, revision: (revision = options.nextRevision?.() ?? revision + 1), items: items.map(r => ({ bindingId: r.bindingId, workspaceId: r.workspaceId, workspaceName: r.project.name, status: statuses.get(r.bindingId) ?? (r.phase === 'intent' ? 'pending' : 'unavailable'), notice: { noticeId: r.noticeId, settings: r.settings, provider: r.provider === 'claimed' && r.claim?.owner !== owner ? 'unknown' : r.provider } })) };
|
|
25
|
-
options.onState?.(structuredClone(snapshot));
|
|
26
|
-
for (const listener of listeners)
|
|
27
|
-
listener(structuredClone(snapshot));
|
|
28
|
-
}
|
|
29
|
-
async function prepare() {
|
|
30
|
-
if (!isAbsolute(options.profileDir) || await realpath(options.profileDir) !== options.profileDir)
|
|
31
|
-
throw Error('PROFILE_PATH_INVALID');
|
|
32
|
-
await privateDirectory(root);
|
|
33
|
-
if (await realpath(root) !== root)
|
|
34
|
-
throw Error('BINDING_PATH_INVALID');
|
|
35
|
-
}
|
|
36
|
-
async function records() {
|
|
37
|
-
let raw;
|
|
38
|
-
try {
|
|
39
|
-
raw = await readPrivate(file, options.metadataMaxBytes);
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
if (error.code === 'ENOENT')
|
|
43
|
-
return [];
|
|
44
|
-
throw error;
|
|
45
|
-
}
|
|
46
|
-
const value = JSON.parse(raw);
|
|
47
|
-
if (value.schemaVersion !== 2 || !Array.isArray(value.items))
|
|
48
|
-
throw Error('BINDING_INVALID');
|
|
49
|
-
const ids = new Set(), paths = new Set(), notices = new Set(), bindings = new Set(), sessions = new Set();
|
|
50
|
-
for (const r of value.items) {
|
|
51
|
-
if (!r || !token(r.bindingId) || !token(r.noticeId) || !token(r.workspaceId) || !(/^[a-f0-9]{64}$/.test(r.identity)) || !isAbsolute(r.localPath) || !Number.isSafeInteger(r.localDev) || !Number.isSafeInteger(r.localIno) || !isProjectName(r.project?.name) || typeof r.project.path !== 'string' || r.key !== integrity(r) || !['intent', 'bound'].includes(r.phase) || !['pending', 'displayed'].includes(r.settings) || !['pending', 'claimed', 'delivered', 'unknown'].includes(r.provider) || ids.has(r.workspaceId) || paths.has(r.identity + '\0' + r.project.path) || notices.has(r.noticeId) || bindings.has(r.bindingId) || !Array.isArray(r.sessionIds) || r.sessionIds.some(id => !token(id) || sessions.has(id)) || new Set(r.sessionIds).size !== r.sessionIds.length)
|
|
52
|
-
throw Error('BINDING_INVALID');
|
|
53
|
-
if (r.provider === 'pending' ? r.claim !== undefined : (!r.claim || !token(r.claim.id) || !token(r.claim.sessionId) || !['claude', 'codex'].includes(r.claim.provider) || !token(r.claim.owner) || (r.provider === 'delivered' && !token(r.claim.deliveryId))))
|
|
54
|
-
throw Error('BINDING_CLAIM_INVALID');
|
|
55
|
-
if (r.accepted !== undefined && (!Array.isArray(r.accepted) || r.accepted.some(a => !r.sessionIds.includes(a.sessionId) || !['claude', 'codex'].includes(a.provider)) || new Set(r.accepted.map(a => a.sessionId + '\0' + a.provider)).size !== r.accepted.length))
|
|
56
|
-
throw Error('BINDING_ACCEPTANCE_INVALID');
|
|
57
|
-
ids.add(r.workspaceId);
|
|
58
|
-
paths.add(r.identity + '\0' + r.project.path);
|
|
59
|
-
notices.add(r.noticeId);
|
|
60
|
-
bindings.add(r.bindingId);
|
|
61
|
-
for (const id of r.sessionIds)
|
|
62
|
-
sessions.add(id);
|
|
63
|
-
}
|
|
64
|
-
return value.items;
|
|
65
|
-
}
|
|
66
|
-
async function save(items) {
|
|
67
|
-
for (const r of items)
|
|
68
|
-
r.key = integrity(r);
|
|
69
|
-
const bytes = JSON.stringify({ schemaVersion: 2, items }) + '\n';
|
|
70
|
-
if (Buffer.byteLength(bytes) > options.metadataMaxBytes)
|
|
71
|
-
throw Error('BINDING_LIMIT');
|
|
72
|
-
const temp = join(root, '.workspaces-' + randomUUID());
|
|
73
|
-
try {
|
|
74
|
-
const h = await open(temp, 'wx', 0o600);
|
|
75
|
-
try {
|
|
76
|
-
await h.writeFile(bytes);
|
|
77
|
-
await h.sync();
|
|
78
|
-
}
|
|
79
|
-
finally {
|
|
80
|
-
await h.close();
|
|
81
|
-
}
|
|
82
|
-
await rename(temp, file);
|
|
83
|
-
const dir = await open(root, 'r');
|
|
84
|
-
try {
|
|
85
|
-
await dir.sync();
|
|
86
|
-
}
|
|
87
|
-
finally {
|
|
88
|
-
await dir.close();
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
finally {
|
|
92
|
-
await rm(temp, { force: true });
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
function serialized(run) {
|
|
96
|
-
const prior = queues.get(file) ?? Promise.resolve();
|
|
97
|
-
const promise = prior.then(() => disposed ? fail('DISPOSED') : run());
|
|
98
|
-
const settled = promise.then(() => { }, () => { });
|
|
99
|
-
queues.set(file, settled);
|
|
100
|
-
tail = settled;
|
|
101
|
-
void settled.then(() => { if (queues.get(file) === settled)
|
|
102
|
-
queues.delete(file); });
|
|
103
|
-
return promise;
|
|
104
|
-
}
|
|
105
|
-
async function native(sessionId) {
|
|
106
|
-
const matches = options.registry.list().filter(w => Array.isArray(w.sessionIds) && w.sessionIds.includes(sessionId));
|
|
107
|
-
if (matches.length !== 1)
|
|
108
|
-
throw new NeedError(need('PROJECT_BINDING_REQUIRED'));
|
|
109
|
-
const workspace = matches[0], registered = options.registry.get(workspace.id), header = await options.readHeader(sessionId);
|
|
110
|
-
if (!registered || registered.path !== workspace.path || !registered.sessionIds.includes(sessionId) || !isAbsolute(workspace.path) || !header || header.id !== sessionId || !header.cwd || !isAbsolute(header.cwd))
|
|
111
|
-
throw new NeedError(need('PROJECT_BINDING_REQUIRED'));
|
|
112
|
-
const localPath = await realpath(workspace.path), cwd = await realpath(header.cwd), info = await lstat(localPath);
|
|
113
|
-
if (localPath !== cwd || !info.isDirectory() || info.isSymbolicLink())
|
|
114
|
-
throw new NeedError(need('PROJECT_BINDING_REQUIRED'));
|
|
115
|
-
return { workspaceId: workspace.id, localPath, localDev: info.dev, localIno: info.ino, name: basename(localPath) };
|
|
116
|
-
}
|
|
117
|
-
const sameNative = (a, b) => a.workspaceId === b.workspaceId && a.localPath === b.localPath && a.localDev === b.localDev && a.localIno === b.localIno;
|
|
118
|
-
function validList(list, projectRoot) { return Array.isArray(list.projects) && Array.isArray(list.unavailable) && list.projects.every(p => isProjectName(p.name) && p.path === projectRoot + '/' + p.name) && new Set(list.projects.map(p => p.path)).size === list.projects.length; }
|
|
119
|
-
function occupancy(list, name) {
|
|
120
|
-
const aliases = (n) => n.normalize('NFC').toLowerCase() === name.normalize('NFC').toLowerCase();
|
|
121
|
-
return list.unavailable.some(p => aliases(p.name)) || list.projects.some(p => p.name !== name && aliases(p.name));
|
|
122
|
-
}
|
|
123
|
-
async function resolve(sessionId, use) {
|
|
124
|
-
if (!token(sessionId) || !use || !['claude', 'codex'].includes(use.provider) || use.purpose !== 'user-turn')
|
|
125
|
-
return fail('PROJECT_BINDING_REQUIRED');
|
|
126
|
-
let stored, binding;
|
|
127
|
-
try {
|
|
128
|
-
await prepare();
|
|
129
|
-
stored = await records();
|
|
130
|
-
const before = options.api.getConnectionState();
|
|
131
|
-
const ready = await options.api.ensureReady(use.provider);
|
|
132
|
-
if (!same(before))
|
|
133
|
-
return stale();
|
|
134
|
-
if (!ready.ok)
|
|
135
|
-
return ready;
|
|
136
|
-
const targetResult = await options.api.getSshTarget();
|
|
137
|
-
if (!same(before))
|
|
138
|
-
return stale();
|
|
139
|
-
if (!targetResult.ok)
|
|
140
|
-
return targetResult;
|
|
141
|
-
const target = targetResult.value;
|
|
142
|
-
if (JSON.stringify(target) !== JSON.stringify(ready.value))
|
|
143
|
-
return fail('CONNECTION_LOST');
|
|
144
|
-
const trust = await readPrivate(target.knownHostsFile, options.metadataMaxBytes), identity = hash([target.host, target.username, target.port, target.projectRoot, target.session, trust]);
|
|
145
|
-
binding = stored.find(r => r.sessionIds.includes(sessionId));
|
|
146
|
-
let current;
|
|
147
|
-
try {
|
|
148
|
-
current = await native(sessionId);
|
|
149
|
-
}
|
|
150
|
-
catch (error) {
|
|
151
|
-
if (stored.some(r => r.sessionIds.includes(sessionId) || options.registry.get(r.workspaceId)?.sessionIds.includes(sessionId))) {
|
|
152
|
-
diagnostic(error);
|
|
153
|
-
throw new NeedError(need('PROJECT_BINDING_INVALID'));
|
|
154
|
-
}
|
|
155
|
-
throw error;
|
|
156
|
-
}
|
|
157
|
-
if (!isProjectName(current.name))
|
|
158
|
-
return fail('PROJECT_NAME_INVALID');
|
|
159
|
-
const localBinding = stored.find(r => r.workspaceId === current.workspaceId || r.localPath === current.localPath);
|
|
160
|
-
if (binding && binding !== localBinding)
|
|
161
|
-
throw new NeedError(need('PROJECT_BINDING_INVALID'));
|
|
162
|
-
binding = localBinding;
|
|
163
|
-
if (binding && (binding.identity !== identity || binding.workspaceId !== current.workspaceId || binding.localPath !== current.localPath || binding.localDev !== current.localDev || binding.localIno !== current.localIno || binding.project.name !== current.name || binding.project.path !== target.projectRoot + '/' + current.name))
|
|
164
|
-
throw new NeedError(need('PROJECT_BINDING_INVALID'));
|
|
165
|
-
const remotePath = target.projectRoot + '/' + current.name, collision = stored.find(r => r !== binding && r.identity === identity && r.project.path === remotePath);
|
|
166
|
-
if (collision) {
|
|
167
|
-
const result = fail(collision.phase === 'intent' ? 'PROJECT_BINDING_BUSY' : 'PROJECT_EXISTS');
|
|
168
|
-
if (!result.ok)
|
|
169
|
-
result.error.message = `远程主机上的‘${current.name}’已被另一工作区使用/正在关联,请选择名称不同的本地文件夹或联系管理员`;
|
|
170
|
-
return result;
|
|
171
|
-
}
|
|
172
|
-
const listed = await options.api.listProjects();
|
|
173
|
-
if (!same(before))
|
|
174
|
-
return stale();
|
|
175
|
-
if (!listed.ok)
|
|
176
|
-
return listed;
|
|
177
|
-
if (!validList(listed.value, target.projectRoot))
|
|
178
|
-
return fail('PROJECT_PROTOCOL_INVALID');
|
|
179
|
-
let project = listed.value.projects.find(p => p.name === current.name && p.path === remotePath);
|
|
180
|
-
if (binding?.phase === 'bound' && !project)
|
|
181
|
-
throw new NeedError(need('PROJECT_BINDING_INVALID'));
|
|
182
|
-
if (occupancy(listed.value, current.name))
|
|
183
|
-
return fail(binding?.phase === 'intent' ? 'PROJECT_CREATE_UNKNOWN' : 'PROJECT_EXISTS');
|
|
184
|
-
if (!binding) {
|
|
185
|
-
binding = { key: '', identity, workspaceId: current.workspaceId, localPath: current.localPath, localDev: current.localDev, localIno: current.localIno, project: { name: current.name, path: remotePath }, bindingId: randomUUID(), noticeId: randomUUID(), sessionIds: [sessionId], phase: project ? 'bound' : 'intent', settings: 'pending', provider: 'pending' };
|
|
186
|
-
stored.push(binding);
|
|
187
|
-
await save(stored);
|
|
188
|
-
if (!same(before))
|
|
189
|
-
return stale();
|
|
190
|
-
if (!project) {
|
|
191
|
-
if (!sameNative(current, await native(sessionId)))
|
|
192
|
-
throw new NeedError(need('PROJECT_BINDING_INVALID'));
|
|
193
|
-
if (!same(before))
|
|
194
|
-
return stale();
|
|
195
|
-
let created;
|
|
196
|
-
try {
|
|
197
|
-
created = await options.api.createProject(current.name);
|
|
198
|
-
}
|
|
199
|
-
catch (error) {
|
|
200
|
-
diagnostic(error);
|
|
201
|
-
publish(stored);
|
|
202
|
-
return fail('PROJECT_CREATE_UNKNOWN');
|
|
203
|
-
}
|
|
204
|
-
if (!same(before))
|
|
205
|
-
return stale();
|
|
206
|
-
if (!created.ok) {
|
|
207
|
-
publish(stored);
|
|
208
|
-
return created;
|
|
209
|
-
}
|
|
210
|
-
if (created.value.name !== current.name || created.value.path !== remotePath)
|
|
211
|
-
return fail('PROJECT_PROTOCOL_INVALID');
|
|
212
|
-
const verified = await options.api.listProjects();
|
|
213
|
-
if (!same(before))
|
|
214
|
-
return stale();
|
|
215
|
-
if (!verified.ok || !validList(verified.value, target.projectRoot) || occupancy(verified.value, current.name))
|
|
216
|
-
return fail('PROJECT_CREATE_UNKNOWN');
|
|
217
|
-
project = verified.value.projects.find(p => p.name === current.name && p.path === remotePath);
|
|
218
|
-
if (!project)
|
|
219
|
-
return fail('PROJECT_CREATE_UNKNOWN');
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
else if (!project) {
|
|
223
|
-
publish(stored);
|
|
224
|
-
return fail('PROJECT_CREATE_UNKNOWN');
|
|
225
|
-
}
|
|
226
|
-
if (!sameNative(current, await native(sessionId)))
|
|
227
|
-
throw new NeedError(need('PROJECT_BINDING_INVALID'));
|
|
228
|
-
if (!same(before))
|
|
229
|
-
return stale();
|
|
230
|
-
binding.phase = 'bound';
|
|
231
|
-
if (!binding.sessionIds.includes(sessionId))
|
|
232
|
-
binding.sessionIds.push(sessionId);
|
|
233
|
-
statuses.set(binding.bindingId, 'ready');
|
|
234
|
-
if (binding.provider === 'unknown' || (binding.provider === 'claimed' && binding.claim?.owner !== owner)) {
|
|
235
|
-
binding.provider = 'unknown';
|
|
236
|
-
await save(stored);
|
|
237
|
-
publish(stored);
|
|
238
|
-
return fail('PROJECT_NOTICE_DELIVERY_UNKNOWN');
|
|
239
|
-
}
|
|
240
|
-
if (binding.provider === 'claimed' && (binding.claim?.sessionId !== sessionId || binding.claim.provider !== use.provider)) {
|
|
241
|
-
await save(stored);
|
|
242
|
-
publish(stored);
|
|
243
|
-
return fail('PROJECT_BINDING_BUSY');
|
|
244
|
-
}
|
|
245
|
-
if (binding.provider === 'pending') {
|
|
246
|
-
binding.provider = 'claimed';
|
|
247
|
-
binding.claim = { id: randomUUID(), sessionId, provider: use.provider, owner };
|
|
248
|
-
}
|
|
249
|
-
await save(stored);
|
|
250
|
-
if (!same(before))
|
|
251
|
-
return stale();
|
|
252
|
-
if (!sameNative(current, await native(sessionId)))
|
|
253
|
-
throw new NeedError(need('PROJECT_BINDING_INVALID'));
|
|
254
|
-
if (!same(before))
|
|
255
|
-
return stale();
|
|
256
|
-
binding.accepted ??= [];
|
|
257
|
-
if (!binding.accepted.some(a => a.sessionId === sessionId && a.provider === use.provider))
|
|
258
|
-
binding.accepted.push({ sessionId, provider: use.provider });
|
|
259
|
-
await save(stored);
|
|
260
|
-
if (!same(before))
|
|
261
|
-
return stale();
|
|
262
|
-
publish(stored);
|
|
263
|
-
return ok({ instanceId: before.instanceId, epoch: before.epoch, bindingRevision: revision, bindingId: binding.bindingId, sessionId, workspaceId: current.workspaceId, project: structuredClone(binding.project), target, ...(binding.provider === 'claimed' ? { notice: { noticeId: binding.noticeId, claimId: binding.claim.id, workspaceName: binding.project.name, messageKey: 'remote-workspace-binding' } } : {}) });
|
|
264
|
-
}
|
|
265
|
-
catch (error) {
|
|
266
|
-
diagnostic(error);
|
|
267
|
-
if (binding)
|
|
268
|
-
statuses.set(binding.bindingId, 'invalid');
|
|
269
|
-
if (stored)
|
|
270
|
-
publish(stored);
|
|
271
|
-
return error instanceof NeedError ? { ok: false, error: error.need } : fail('PROJECT_BINDING_INVALID');
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
async function acknowledge(receipt) {
|
|
275
|
-
try {
|
|
276
|
-
await prepare();
|
|
277
|
-
const stored = await records();
|
|
278
|
-
if (!receipt || !token(receipt.noticeId))
|
|
279
|
-
return fail('PROJECT_BINDING_INVALID');
|
|
280
|
-
const binding = stored.find(r => r.noticeId === receipt.noticeId);
|
|
281
|
-
if (!binding || binding.phase !== 'bound')
|
|
282
|
-
return fail('PROJECT_BINDING_INVALID');
|
|
283
|
-
if (receipt.surface === 'settings') {
|
|
284
|
-
if (receipt.outcome !== 'displayed' || Object.keys(receipt).sort().join(',') !== 'noticeId,outcome,surface')
|
|
285
|
-
return fail('PROJECT_BINDING_INVALID');
|
|
286
|
-
binding.settings = 'displayed';
|
|
287
|
-
}
|
|
288
|
-
else if (receipt.surface === 'provider') {
|
|
289
|
-
const claim = binding.claim, keys = receipt.outcome === 'delivered' ? 'claimId,deliveryId,noticeId,outcome,provider,sessionId,surface' : 'claimId,noticeId,outcome,provider,sessionId,surface';
|
|
290
|
-
if (!claim || !['claimed', 'unknown', 'delivered'].includes(binding.provider) || Object.keys(receipt).sort().join(',') !== keys || receipt.claimId !== claim.id || receipt.sessionId !== claim.sessionId || receipt.provider !== claim.provider || !['delivered', 'not-delivered', 'unknown'].includes(receipt.outcome) || (receipt.outcome === 'delivered' && !token(receipt.deliveryId)))
|
|
291
|
-
return fail('PROJECT_BINDING_INVALID');
|
|
292
|
-
if (binding.provider === 'delivered') {
|
|
293
|
-
return receipt.outcome === 'delivered' && receipt.deliveryId === claim.deliveryId ? ok(undefined) : fail('PROJECT_BINDING_INVALID');
|
|
294
|
-
}
|
|
295
|
-
if (receipt.outcome === 'not-delivered') {
|
|
296
|
-
binding.provider = 'pending';
|
|
297
|
-
delete binding.claim;
|
|
298
|
-
}
|
|
299
|
-
else if (receipt.outcome === 'unknown')
|
|
300
|
-
binding.provider = 'unknown';
|
|
301
|
-
else if (receipt.outcome === 'delivered') {
|
|
302
|
-
binding.provider = 'delivered';
|
|
303
|
-
claim.deliveryId = receipt.deliveryId;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
else
|
|
307
|
-
return fail('PROJECT_BINDING_INVALID');
|
|
308
|
-
await save(stored);
|
|
309
|
-
publish(stored);
|
|
310
|
-
return ok(undefined);
|
|
311
|
-
}
|
|
312
|
-
catch (error) {
|
|
313
|
-
diagnostic(error);
|
|
314
|
-
return fail('PROJECT_BINDING_INVALID');
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
// Pure verification: never resolves a project, checks login, creates or claims a notice.
|
|
318
|
-
async function verifyRemoteConversationScope(sessionId, provider, target) {
|
|
319
|
-
const before = options.api.getConnectionState();
|
|
320
|
-
if (!same(before))
|
|
321
|
-
return stale();
|
|
322
|
-
if (!token(sessionId) || !['claude', 'codex'].includes(provider))
|
|
323
|
-
return fail('REMOTE_DETAIL_SCOPE_INVALID');
|
|
324
|
-
try {
|
|
325
|
-
if (!isAbsolute(options.profileDir) || await realpath(options.profileDir) !== options.profileDir)
|
|
326
|
-
return fail('REMOTE_DETAIL_SCOPE_INVALID');
|
|
327
|
-
if (!same(before))
|
|
328
|
-
return stale();
|
|
329
|
-
const directory = await lstat(root);
|
|
330
|
-
if (!same(before))
|
|
331
|
-
return stale();
|
|
332
|
-
if (!directory.isDirectory() || directory.isSymbolicLink() || await realpath(root) !== root)
|
|
333
|
-
return fail('REMOTE_DETAIL_SCOPE_INVALID');
|
|
334
|
-
if (!same(before))
|
|
335
|
-
return stale();
|
|
336
|
-
const stored = await records();
|
|
337
|
-
if (!same(before))
|
|
338
|
-
return stale();
|
|
339
|
-
const binding = stored.find(r => r.sessionIds.includes(sessionId));
|
|
340
|
-
if (!binding || binding.phase !== 'bound' || statuses.get(binding.bindingId) === 'invalid' || !binding.accepted?.some(a => a.sessionId === sessionId && a.provider === provider))
|
|
341
|
-
return fail('REMOTE_DETAIL_SCOPE_INVALID');
|
|
342
|
-
const trust = await readPrivate(target.knownHostsFile, options.metadataMaxBytes);
|
|
343
|
-
if (!same(before))
|
|
344
|
-
return stale();
|
|
345
|
-
if (binding.identity !== hash([target.host, target.username, target.port, target.projectRoot, target.session, trust]))
|
|
346
|
-
return fail('REMOTE_DETAIL_SCOPE_INVALID');
|
|
347
|
-
const current = await native(sessionId);
|
|
348
|
-
if (!same(before))
|
|
349
|
-
return stale();
|
|
350
|
-
if (binding.workspaceId !== current.workspaceId || binding.localPath !== current.localPath || binding.localDev !== current.localDev || binding.localIno !== current.localIno || binding.project.name !== current.name || binding.project.path !== target.projectRoot + '/' + current.name)
|
|
351
|
-
return fail('REMOTE_DETAIL_SCOPE_INVALID');
|
|
352
|
-
return ok({ identity: hash([target.host, target.username, target.port, trust]) });
|
|
353
|
-
}
|
|
354
|
-
catch {
|
|
355
|
-
return same(before) ? fail('REMOTE_DETAIL_SCOPE_INVALID') : stale();
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
// Loading metadata never resolves a remote project or creates either a local or remote directory.
|
|
359
|
-
void serialized(async () => { try {
|
|
360
|
-
await prepare();
|
|
361
|
-
publish(await records());
|
|
362
|
-
}
|
|
363
|
-
catch (error) {
|
|
364
|
-
diagnostic(error);
|
|
365
|
-
} });
|
|
366
|
-
return {
|
|
367
|
-
readLegacyLocations: () => serialized(async () => { await prepare(); return structuredClone(await records()); }),
|
|
368
|
-
observeConnection(state) { if (disposed)
|
|
369
|
-
return; for (const [id, status] of statuses)
|
|
370
|
-
if (status === 'ready')
|
|
371
|
-
statuses.set(id, 'unavailable'); publish(latest); },
|
|
372
|
-
dispose() { disposed = true; listeners.clear(); return tail; },
|
|
373
|
-
verifyRemoteConversationScope: (sessionId, provider, target) => serialized(() => verifyRemoteConversationScope(sessionId, provider, target)),
|
|
374
|
-
getWorkspaceBindingState: () => structuredClone(snapshot),
|
|
375
|
-
onWorkspaceBindingState(listener) { listeners.add(listener); return () => { listeners.delete(listener); }; },
|
|
376
|
-
acknowledgeWorkspaceNotice: (receipt) => serialized(() => acknowledge(receipt)),
|
|
377
|
-
resolveSessionProject: (sessionId, use) => serialized(() => resolve(sessionId, use)),
|
|
378
|
-
};
|
|
379
|
-
}
|
|
File without changes
|