@ai-ecoverse/slicc-agent 2.1.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -1
- package/dist/agent-worker.js +6 -0
- package/dist/agent-worker.js.map +7 -0
- package/dist/agent.js +2 -1
- package/dist/agent.js.map +2 -2
- package/dist/client.js +4 -1
- package/dist/client.js.map +2 -2
- package/dist/credentials.js +100 -0
- package/dist/credentials.js.map +7 -0
- package/dist/host.js +14 -2
- package/dist/host.js.map +2 -2
- package/dist/index.js +31 -1
- package/dist/index.js.map +2 -2
- package/dist/kernel/client.js +1 -0
- package/dist/kernel/client.js.map +7 -0
- package/dist/kernel/env.js +204 -0
- package/dist/kernel/env.js.map +7 -0
- package/dist/kernel/exec.js +115 -0
- package/dist/kernel/exec.js.map +7 -0
- package/dist/kernel/files.js +153 -0
- package/dist/kernel/files.js.map +7 -0
- package/dist/kernel/paths.js +31 -0
- package/dist/kernel/paths.js.map +7 -0
- package/dist/kernel/watch.js +71 -0
- package/dist/kernel/watch.js.map +7 -0
- package/dist/main.js +46 -0
- package/dist/main.js.map +7 -0
- package/dist/net.js +39 -0
- package/dist/net.js.map +7 -0
- package/dist/owner.js +32 -9
- package/dist/owner.js.map +2 -2
- package/dist/prompt.js +18 -0
- package/dist/prompt.js.map +7 -0
- package/dist/settings.js +77 -0
- package/dist/settings.js.map +7 -0
- package/dist/spectrum/index.js +10 -2
- package/dist/spectrum/index.js.map +3 -3
- package/dist/spectrum/settings-port.js +73 -0
- package/dist/spectrum/settings-port.js.map +7 -0
- package/dist/types/agent-worker.d.ts +1 -0
- package/dist/types/agent.d.ts +1 -0
- package/dist/types/client.d.ts +2 -0
- package/dist/types/credentials.d.ts +12 -0
- package/dist/types/host.d.ts +2 -0
- package/dist/types/index.d.ts +8 -1
- package/dist/types/kernel/client.d.ts +39 -0
- package/dist/types/kernel/env.d.ts +57 -0
- package/dist/types/kernel/exec.d.ts +5 -0
- package/dist/types/kernel/files.d.ts +34 -0
- package/dist/types/kernel/paths.d.ts +4 -0
- package/dist/types/kernel/watch.d.ts +10 -0
- package/dist/types/main.d.ts +23 -0
- package/dist/types/net.d.ts +19 -0
- package/dist/types/owner.d.ts +6 -2
- package/dist/types/prompt.d.ts +1 -0
- package/dist/types/settings.d.ts +37 -0
- package/dist/types/spectrum/index.d.ts +6 -1
- package/dist/types/spectrum/settings-port.d.ts +17 -0
- package/dist/types/worker.d.ts +1 -0
- package/dist/worker.js +9 -0
- package/dist/worker.js.map +2 -2
- package/package.json +10 -2
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface KernelStat {
|
|
2
|
+
isFile: boolean;
|
|
3
|
+
isDirectory: boolean;
|
|
4
|
+
isSymbolicLink: boolean;
|
|
5
|
+
size: number;
|
|
6
|
+
mtime: Date | number;
|
|
7
|
+
ino?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface KernelFs {
|
|
10
|
+
readFile(path: string): Promise<Uint8Array>;
|
|
11
|
+
readText(path: string): Promise<string>;
|
|
12
|
+
writeFile(path: string, data: string | Uint8Array): Promise<void>;
|
|
13
|
+
stat(path: string): Promise<KernelStat>;
|
|
14
|
+
lstat(path: string): Promise<KernelStat>;
|
|
15
|
+
readdir(path: string): Promise<string[]>;
|
|
16
|
+
mkdir(path: string): Promise<void>;
|
|
17
|
+
rm(path: string, options?: {
|
|
18
|
+
force?: boolean;
|
|
19
|
+
}): Promise<void>;
|
|
20
|
+
rename(from: string, to: string): Promise<void>;
|
|
21
|
+
realpath(path: string): Promise<string>;
|
|
22
|
+
exists(path: string): Promise<boolean>;
|
|
23
|
+
}
|
|
24
|
+
export interface KernelProcess {
|
|
25
|
+
pid: number;
|
|
26
|
+
pgid: number;
|
|
27
|
+
exited: Promise<number>;
|
|
28
|
+
signal(name?: string): unknown;
|
|
29
|
+
}
|
|
30
|
+
export interface SpawnOptions {
|
|
31
|
+
cwd?: string;
|
|
32
|
+
env?: Record<string, string>;
|
|
33
|
+
onStdout?(bytes: Uint8Array): void;
|
|
34
|
+
onStderr?(bytes: Uint8Array): void;
|
|
35
|
+
}
|
|
36
|
+
export interface KernelClient {
|
|
37
|
+
fs: KernelFs;
|
|
38
|
+
spawn(argv: readonly string[], options: SpawnOptions): Promise<KernelProcess>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Context } from '@earendil-works/chord';
|
|
2
|
+
import { type BinaryReader, type DirReader, type ExecutionEnv, type ExecutionError, FileError, type FileInfo, type FileWatcher, type Result, type ShellExecOptions, type ShellExecResult, type TextLineReader, type WatchChange, type WatchTarget } from '@earendil-works/pi-durable/env';
|
|
3
|
+
import type { KernelClient } from './client.ts';
|
|
4
|
+
import { type PollOptions } from './watch.ts';
|
|
5
|
+
export interface KernelEnvOptions {
|
|
6
|
+
cwd: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
watch?: PollOptions;
|
|
9
|
+
}
|
|
10
|
+
type FileResult<T> = Promise<Result<T, FileError>>;
|
|
11
|
+
export declare class SliccKernelEnv implements ExecutionEnv {
|
|
12
|
+
#private;
|
|
13
|
+
readonly id: string;
|
|
14
|
+
cwd: string;
|
|
15
|
+
constructor(client: KernelClient, options: KernelEnvOptions);
|
|
16
|
+
absolutePath(path: string): FileResult<string>;
|
|
17
|
+
joinPath(parts: string[]): FileResult<string>;
|
|
18
|
+
readTextFile(path: string, context: Context): FileResult<string>;
|
|
19
|
+
readBinaryFile(path: string, context: Context): FileResult<Uint8Array>;
|
|
20
|
+
openTextLineReader(path: string, context: Context): FileResult<TextLineReader>;
|
|
21
|
+
readTextLines(path: string, options: {
|
|
22
|
+
maxLines?: number;
|
|
23
|
+
} | undefined, context: Context): FileResult<string[]>;
|
|
24
|
+
openBinaryReader(path: string, options: {
|
|
25
|
+
noFollow?: boolean;
|
|
26
|
+
} | undefined, context: Context): FileResult<BinaryReader>;
|
|
27
|
+
writeFile(path: string, content: string | Uint8Array, context: Context): FileResult<void>;
|
|
28
|
+
appendFile(path: string, content: string | Uint8Array, context: Context): FileResult<void>;
|
|
29
|
+
truncateFile(path: string, size: number, context: Context): FileResult<void>;
|
|
30
|
+
flushFile(path: string, context: Context): FileResult<void>;
|
|
31
|
+
renameFile(sourcePath: string, destinationPath: string, context: Context): FileResult<void>;
|
|
32
|
+
fileInfo(path: string, context: Context): FileResult<FileInfo>;
|
|
33
|
+
listDir(path: string, context: Context): FileResult<FileInfo[]>;
|
|
34
|
+
openDirReader(path: string, context: Context): FileResult<DirReader>;
|
|
35
|
+
watch(targets: readonly WatchTarget[], onChange: (change: WatchChange) => void, context: Context): FileResult<FileWatcher>;
|
|
36
|
+
canonicalPath(path: string, context: Context): FileResult<string>;
|
|
37
|
+
exists(path: string, context: Context): FileResult<boolean>;
|
|
38
|
+
createDir(path: string, _options: {
|
|
39
|
+
recursive?: boolean;
|
|
40
|
+
} | undefined, context: Context): FileResult<void>;
|
|
41
|
+
remove(path: string, options: {
|
|
42
|
+
recursive?: boolean;
|
|
43
|
+
force?: boolean;
|
|
44
|
+
} | undefined, context: Context): FileResult<void>;
|
|
45
|
+
createTempDir(prefix: string | undefined, context: Context): FileResult<string>;
|
|
46
|
+
createTempFile(options: {
|
|
47
|
+
prefix?: string;
|
|
48
|
+
suffix?: string;
|
|
49
|
+
} | undefined, context: Context): FileResult<string>;
|
|
50
|
+
exec(command: string | readonly string[], options: ShellExecOptions | undefined, context: Context): Promise<Result<ShellExecResult, ExecutionError>>;
|
|
51
|
+
cleanup(context: Context): Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
export declare const HOME = "/home";
|
|
54
|
+
export declare function kernelEnvironment(client: KernelClient, options?: Omit<KernelEnvOptions, 'cwd'>): (target: {
|
|
55
|
+
cwd?: string;
|
|
56
|
+
}) => SliccKernelEnv;
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Context } from '@earendil-works/chord';
|
|
2
|
+
import { ExecutionError, type Result, type ShellExecOptions, type ShellExecResult } from '@earendil-works/pi-durable/env';
|
|
3
|
+
import type { KernelClient } from './client.ts';
|
|
4
|
+
export declare const SHELL: readonly ['bash', '-c'];
|
|
5
|
+
export declare function execute(client: KernelClient, cwd: string, command: string | readonly string[], options: ShellExecOptions | undefined, context: Context): Promise<Result<ShellExecResult, ExecutionError>>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Context } from '@earendil-works/chord';
|
|
2
|
+
import { type BinaryReader, type DirReader, FileError, type FileInfo, type LineScan, type Result, type TextLine, type TextLineReader } from '@earendil-works/pi-durable/env';
|
|
3
|
+
import type { KernelFs, KernelStat } from './client.ts';
|
|
4
|
+
export declare function fileError(error: unknown, path?: string): FileError;
|
|
5
|
+
export declare function aborted(context: Context, path?: string): Result<never, FileError> | undefined;
|
|
6
|
+
export declare function attempt<T>(context: Context, path: string, run: () => Promise<T>): Promise<Result<T, FileError>>;
|
|
7
|
+
export declare function info(path: string, stat: KernelStat): FileInfo;
|
|
8
|
+
export declare class SnapshotReader implements BinaryReader {
|
|
9
|
+
#private;
|
|
10
|
+
constructor(bytes: Uint8Array, fileInfo: FileInfo);
|
|
11
|
+
info(): Promise<Result<FileInfo, FileError>>;
|
|
12
|
+
read(offset: number, length: number, context: Context): Promise<Result<Uint8Array, FileError>>;
|
|
13
|
+
scanLines(options: {
|
|
14
|
+
startLine: number;
|
|
15
|
+
endLine?: number;
|
|
16
|
+
}, context: Context): Promise<Result<LineScan, FileError>>;
|
|
17
|
+
close(): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare class SnapshotLines implements TextLineReader {
|
|
20
|
+
#private;
|
|
21
|
+
constructor(text: string);
|
|
22
|
+
readLine(): Promise<Result<TextLine | undefined, FileError>>;
|
|
23
|
+
close(): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
export declare class KernelDirReader implements DirReader {
|
|
26
|
+
#private;
|
|
27
|
+
constructor(fs: KernelFs, path: string, names: string[]);
|
|
28
|
+
next(maxEntries: number, context: Context): Promise<Result<{
|
|
29
|
+
entries: FileInfo[];
|
|
30
|
+
done: boolean;
|
|
31
|
+
}, FileError>>;
|
|
32
|
+
rest(): Promise<FileInfo[]>;
|
|
33
|
+
close(): Promise<void>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FileWatcher, WatchChange, WatchTarget } from '@earendil-works/pi-durable/env';
|
|
2
|
+
import type { KernelFs } from './client.ts';
|
|
3
|
+
type Snapshot = Map<string, string>;
|
|
4
|
+
export declare function snapshot(fs: KernelFs, cwd: string, targets: readonly WatchTarget[]): Promise<Snapshot>;
|
|
5
|
+
export declare function differences(before: Snapshot, after: Snapshot): string[];
|
|
6
|
+
export interface PollOptions {
|
|
7
|
+
intervalMs?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function pollWatch(fs: KernelFs, cwd: string, targets: readonly WatchTarget[], onChange: (change: WatchChange) => void, options?: PollOptions): Promise<FileWatcher>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CredentialStore, Provider } from '@earendil-works/pi-ai';
|
|
2
|
+
import { type ModelRef, type Storage } from '@earendil-works/pi-durable';
|
|
3
|
+
import { type AgentHost } from './host.ts';
|
|
4
|
+
import type { KernelClient } from './kernel/client.ts';
|
|
5
|
+
import { type Transport } from './net.ts';
|
|
6
|
+
import { type WorkerScope } from './worker.ts';
|
|
7
|
+
export interface AgentWorkerScope extends WorkerScope {
|
|
8
|
+
fetch: typeof fetch;
|
|
9
|
+
location: {
|
|
10
|
+
origin: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export type KernelAttach = (port: MessagePort) => Promise<KernelClient & {
|
|
14
|
+
transport: Transport;
|
|
15
|
+
}>;
|
|
16
|
+
export interface AgentWorkerOptions {
|
|
17
|
+
model?: ModelRef;
|
|
18
|
+
providers?: Provider[];
|
|
19
|
+
attach?: KernelAttach;
|
|
20
|
+
credentials?: () => Promise<CredentialStore>;
|
|
21
|
+
storage?: () => Promise<Storage>;
|
|
22
|
+
}
|
|
23
|
+
export declare function runAgentWorker(scope: AgentWorkerScope, options?: AgentWorkerOptions): Promise<AgentHost>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface TransportResponse {
|
|
2
|
+
status: number;
|
|
3
|
+
statusText?: string;
|
|
4
|
+
headers: HeadersInit;
|
|
5
|
+
body: AsyncIterable<Uint8Array>;
|
|
6
|
+
}
|
|
7
|
+
export interface Transport {
|
|
8
|
+
traits?: {
|
|
9
|
+
crossOrigin?: 'cors' | 'any';
|
|
10
|
+
};
|
|
11
|
+
fetch(request: {
|
|
12
|
+
url: string;
|
|
13
|
+
method: string;
|
|
14
|
+
headers: [string, string][];
|
|
15
|
+
body?: Uint8Array;
|
|
16
|
+
signal?: AbortSignal;
|
|
17
|
+
}): Promise<TransportResponse>;
|
|
18
|
+
}
|
|
19
|
+
export declare function transportFetch(transport: Transport, origin: string, native?: typeof fetch): typeof fetch;
|
package/dist/types/owner.d.ts
CHANGED
|
@@ -7,11 +7,15 @@ export interface AgentWorker {
|
|
|
7
7
|
}
|
|
8
8
|
export interface AgentOwner {
|
|
9
9
|
connect(): Promise<AgentConnection>;
|
|
10
|
-
restart(): void
|
|
11
|
-
release(): void
|
|
10
|
+
restart(): Promise<void>;
|
|
11
|
+
release(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export interface KernelSource {
|
|
14
|
+
connect(): Promise<Transferable>;
|
|
12
15
|
}
|
|
13
16
|
export interface OwnerOptions {
|
|
14
17
|
worker: () => AgentWorker;
|
|
18
|
+
kernel?: KernelSource;
|
|
15
19
|
locks?: LockManager;
|
|
16
20
|
channel?: () => {
|
|
17
21
|
port1: PortEndpoint;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SliccPrompt: import("@earendil-works/pi-durable").Extension<import("@earendil-works/pi-durable").ToolRegistration>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type Context, type ReplicatedState } from '@earendil-works/chord';
|
|
2
|
+
import type { CredentialStore, Provider } from '@earendil-works/pi-ai';
|
|
3
|
+
import { type MutableModels } from '@earendil-works/pi-ai/models';
|
|
4
|
+
export declare const BEDROCK = "amazon-bedrock";
|
|
5
|
+
export declare const DEFAULT_MODEL: {
|
|
6
|
+
provider: string;
|
|
7
|
+
modelId: string;
|
|
8
|
+
};
|
|
9
|
+
export interface ModelChoice {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
provider: string;
|
|
13
|
+
kind: 'chat' | 'classifier';
|
|
14
|
+
reasoning: boolean;
|
|
15
|
+
contextWindow: number;
|
|
16
|
+
}
|
|
17
|
+
export interface AccountState {
|
|
18
|
+
id: string;
|
|
19
|
+
provider: string;
|
|
20
|
+
identity: string;
|
|
21
|
+
status: 'connected' | 'disconnected';
|
|
22
|
+
auth: 'api-key';
|
|
23
|
+
needs: 'cors-free-transport' | null;
|
|
24
|
+
}
|
|
25
|
+
export interface SettingsState {
|
|
26
|
+
models: ModelChoice[];
|
|
27
|
+
accounts: AccountState[];
|
|
28
|
+
}
|
|
29
|
+
export interface AgentSettings {
|
|
30
|
+
readonly state: ReplicatedState<SettingsState>;
|
|
31
|
+
connect(providerId: string, secret: string, region: string | null, context: Context): Promise<void>;
|
|
32
|
+
disconnect(providerId: string, context: Context): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
export declare const AgentSettings: import("@earendil-works/chord").Service<AgentSettings>;
|
|
35
|
+
export declare function sliccProviders(): Provider[];
|
|
36
|
+
export declare function createSliccModels(credentials: CredentialStore, providers?: Provider<import("@earendil-works/pi-ai").Api>[]): MutableModels;
|
|
37
|
+
export declare function createAgentSettings(models: MutableModels, credentials: CredentialStore, providers?: Provider<import("@earendil-works/pi-ai").Api>[]): Promise<AgentSettings>;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { AgentConnection } from '../client.ts';
|
|
2
2
|
import { AgentAdapter } from './agent-port.ts';
|
|
3
|
+
import { SettingsAdapter } from './settings-port.ts';
|
|
3
4
|
export { AgentAdapter, CONE } from './agent-port.ts';
|
|
4
5
|
export { assistant, isBusy, queued, textOf, toMessages } from './messages.ts';
|
|
5
|
-
export
|
|
6
|
+
export { SETTINGS_KEY, SettingsAdapter } from './settings-port.ts';
|
|
7
|
+
export declare function createAgentModel(connection: AgentConnection, options?: {
|
|
8
|
+
storage?: Pick<Storage, 'getItem' | 'setItem'> | null;
|
|
9
|
+
}): {
|
|
6
10
|
agent: AgentAdapter;
|
|
11
|
+
settings: SettingsAdapter;
|
|
7
12
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Account, ModelOption, Settings, SettingsEvents, SettingsPort } from '@ai-ecoverse/slicc-spectrum/ui';
|
|
2
|
+
import type { AgentSettings } from '../settings.ts';
|
|
3
|
+
import type { AgentAdapter } from './agent-port.ts';
|
|
4
|
+
import { Emitter } from './emitter.ts';
|
|
5
|
+
export declare const SETTINGS_KEY = "slicc-agent.settings";
|
|
6
|
+
export declare class SettingsAdapter extends Emitter<SettingsEvents> implements SettingsPort {
|
|
7
|
+
#private;
|
|
8
|
+
constructor(settings: AgentSettings, agent: AgentAdapter, storage: Pick<Storage, 'getItem' | 'setItem'> | null);
|
|
9
|
+
get(): Settings;
|
|
10
|
+
update(patch: Partial<Settings>): void;
|
|
11
|
+
models(): readonly ModelOption[];
|
|
12
|
+
accounts(): readonly Account[];
|
|
13
|
+
connect(id: string, secret?: string, options?: {
|
|
14
|
+
region?: string;
|
|
15
|
+
}): Promise<void>;
|
|
16
|
+
disconnect(id: string): void;
|
|
17
|
+
}
|
package/dist/types/worker.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export interface WorkerScope {
|
|
|
3
3
|
addEventListener(type: 'message', listener: (event: MessageEvent) => void): void;
|
|
4
4
|
}
|
|
5
5
|
export declare function serveConnections(scope: WorkerScope, host: Promise<AgentHost>): void;
|
|
6
|
+
export declare function kernelPort(scope: WorkerScope): Promise<MessagePort>;
|
package/dist/worker.js
CHANGED
|
@@ -8,7 +8,16 @@ function serveConnections(scope, host) {
|
|
|
8
8
|
);
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
+
function kernelPort(scope) {
|
|
12
|
+
return new Promise((resolve) => {
|
|
13
|
+
scope.addEventListener("message", ({ data }) => {
|
|
14
|
+
const port = data?.kernel;
|
|
15
|
+
if (port) resolve(port);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
}
|
|
11
19
|
export {
|
|
20
|
+
kernelPort,
|
|
12
21
|
serveConnections
|
|
13
22
|
};
|
|
14
23
|
//# sourceMappingURL=worker.js.map
|
package/dist/worker.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/worker.ts"],
|
|
4
|
-
"sourcesContent": ["import type { AgentHost } from './host.ts';\nimport type { PortEndpoint } from './wire.ts';\n\nexport interface WorkerScope {\n addEventListener(type: 'message', listener: (event: MessageEvent) => void): void;\n}\n\nexport function serveConnections(scope: WorkerScope, host: Promise<AgentHost>): void {\n scope.addEventListener('message', ({ data }) => {\n const port = (data as { connect?: PortEndpoint } | null)?.connect;\n if (!port) return;\n host.then(\n (ready) => ready.connect(port),\n () => port.close?.()\n );\n });\n}\n"],
|
|
5
|
-
"mappings": "AAOO,SAAS,iBAAiB,OAAoB,MAAgC;AACnF,QAAM,iBAAiB,WAAW,CAAC,EAAE,KAAK,MAAM;AAC9C,UAAM,OAAQ,MAA4C;AAC1D,QAAI,CAAC,KAAM;AACX,SAAK;AAAA,MACH,CAAC,UAAU,MAAM,QAAQ,IAAI;AAAA,MAC7B,MAAM,KAAK,QAAQ;AAAA,IACrB;AAAA,EACF,CAAC;AACH;",
|
|
4
|
+
"sourcesContent": ["import type { AgentHost } from './host.ts';\nimport type { PortEndpoint } from './wire.ts';\n\nexport interface WorkerScope {\n addEventListener(type: 'message', listener: (event: MessageEvent) => void): void;\n}\n\nexport function serveConnections(scope: WorkerScope, host: Promise<AgentHost>): void {\n scope.addEventListener('message', ({ data }) => {\n const port = (data as { connect?: PortEndpoint } | null)?.connect;\n if (!port) return;\n host.then(\n (ready) => ready.connect(port),\n () => port.close?.()\n );\n });\n}\n\nexport function kernelPort(scope: WorkerScope): Promise<MessagePort> {\n return new Promise((resolve) => {\n scope.addEventListener('message', ({ data }) => {\n const port = (data as { kernel?: MessagePort } | null)?.kernel;\n if (port) resolve(port);\n });\n });\n}\n"],
|
|
5
|
+
"mappings": "AAOO,SAAS,iBAAiB,OAAoB,MAAgC;AACnF,QAAM,iBAAiB,WAAW,CAAC,EAAE,KAAK,MAAM;AAC9C,UAAM,OAAQ,MAA4C;AAC1D,QAAI,CAAC,KAAM;AACX,SAAK;AAAA,MACH,CAAC,UAAU,MAAM,QAAQ,IAAI;AAAA,MAC7B,MAAM,KAAK,QAAQ;AAAA,IACrB;AAAA,EACF,CAAC;AACH;AAEO,SAAS,WAAW,OAA0C;AACnE,SAAO,IAAI,QAAQ,CAAC,YAAY;AAC9B,UAAM,iBAAiB,WAAW,CAAC,EAAE,KAAK,MAAM;AAC9C,YAAM,OAAQ,MAA0C;AACxD,UAAI,KAAM,SAAQ,IAAI;AAAA,IACxB,CAAC;AAAA,EACH,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-agent",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "SLICC's agent core on pi durable: an agent worker, session storage, remoting and pi extensions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,6 +29,10 @@
|
|
|
29
29
|
"./spectrum": {
|
|
30
30
|
"types": "./dist/types/spectrum/index.d.ts",
|
|
31
31
|
"default": "./dist/spectrum/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./agent-worker": {
|
|
34
|
+
"types": "./dist/types/agent-worker.d.ts",
|
|
35
|
+
"default": "./dist/agent-worker.js"
|
|
32
36
|
}
|
|
33
37
|
},
|
|
34
38
|
"files": [
|
|
@@ -40,7 +44,7 @@
|
|
|
40
44
|
"prepack": "npm run build",
|
|
41
45
|
"start": "npm run build && node test/integration/chrome.mjs",
|
|
42
46
|
"pretest": "npm run build && node test/integration/build.mjs && playwright-core install --no-shell chromium",
|
|
43
|
-
"test": "node --test --test-global-setup=node_modules/@ai-ecoverse/slicc-shared-web/harness/global.mjs 'test/integration/*.test.mjs'",
|
|
47
|
+
"test": "node --test --test-timeout=120000 --test-global-setup=node_modules/@ai-ecoverse/slicc-shared-web/harness/global.mjs 'test/integration/*.test.mjs'",
|
|
44
48
|
"test:unit": "NODE_NO_WARNINGS=1 mcr -c node_modules/@ai-ecoverse/slicc-shared-web/mcr.config.mjs node --test 'test/unit/**/*.test.mjs'",
|
|
45
49
|
"typecheck": "tsc",
|
|
46
50
|
"lint": "slicc-lint",
|
|
@@ -52,9 +56,12 @@
|
|
|
52
56
|
"devDependencies": {
|
|
53
57
|
"@ai-ecoverse/slicc-shared-web": "1.5.0",
|
|
54
58
|
"@ai-ecoverse/slicc-spectrum": "1.7.0",
|
|
59
|
+
"@ai-ecoverse/wasm-bash": "5.3.0-7",
|
|
60
|
+
"@ai-ecoverse/wasm-coreutils": "9.7.0-3",
|
|
55
61
|
"@biomejs/biome": "2.5.15",
|
|
56
62
|
"@types/node": "24.19.1",
|
|
57
63
|
"esbuild": "0.28.2",
|
|
64
|
+
"fake-indexeddb": "6.2.5",
|
|
58
65
|
"lefthook": "2.1.16",
|
|
59
66
|
"monocart-coverage-reports": "2.13.0",
|
|
60
67
|
"playwright-core": "1.63.0",
|
|
@@ -62,6 +69,7 @@
|
|
|
62
69
|
"typescript": "7.0.2"
|
|
63
70
|
},
|
|
64
71
|
"dependencies": {
|
|
72
|
+
"@ai-ecoverse/slicc-kernel": "1.9.0",
|
|
65
73
|
"@earendil-works/chord": "1.0.4",
|
|
66
74
|
"@earendil-works/pi-ai": "1.0.4",
|
|
67
75
|
"@earendil-works/pi-client": "1.0.4",
|