@ai-ecoverse/slicc-agent 2.3.0 → 2.5.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 +10 -2
- package/dist/host.js +1 -1
- package/dist/host.js.map +2 -2
- package/dist/index.js +10 -2
- package/dist/index.js.map +2 -2
- package/dist/listener.js +73 -0
- package/dist/listener.js.map +7 -0
- package/dist/patches.js +24 -0
- package/dist/patches.js.map +7 -0
- package/dist/settings.js +20 -2
- package/dist/settings.js.map +2 -2
- package/dist/types/host.d.ts +1 -1
- package/dist/types/index.d.ts +4 -2
- package/dist/types/listener.d.ts +11 -0
- package/dist/types/patches.d.ts +10 -0
- package/dist/types/settings.d.ts +2 -0
- package/dist/types/wire.d.ts +6 -10
- package/dist/wire.js +1 -67
- package/dist/wire.js.map +2 -2
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -73,7 +73,7 @@ const owner = await startAgent({
|
|
|
73
73
|
|
|
74
74
|
`runAgentWorker(self, options)` is the same with its parts replaceable (model, providers, kernel attach, credentials, storage).
|
|
75
75
|
|
|
76
|
-
**Providers.** The first provider is AWS Bedrock with a Bedrock API key as the bearer token; the default model is `us.anthropic.claude-sonnet-5-5`. Bedrock sends no CORS headers, so it needs a CORS-free transport, and its account says so (`needs: 'cors-free-transport'`).
|
|
76
|
+
**Providers.** The first provider is AWS Bedrock with a Bedrock API key as the bearer token; the default model is `us.anthropic.claude-sonnet-5-5`. Requests go to `us-west-2` unless the stored credential names another region (`AWS_REGION`, set by `connect`'s `region`). The default applies when the credential is read, so keys stored earlier get it too. The settings UI has no region field yet. Bedrock sends no CORS headers, so it needs a CORS-free transport, and its account says so (`needs: 'cors-free-transport'`).
|
|
77
77
|
|
|
78
78
|
**Credentials.** They live in the IndexedDB database `slicc-agent-credentials`, sealed with AES-GCM under a non-extractable key that never leaves WebCrypto. They never enter the session database or the transcript, and followers never see them.
|
|
79
79
|
|
|
@@ -94,7 +94,15 @@ app.model = { ...createKernelModel({ kernel, root }), ...createAgentModel(agent,
|
|
|
94
94
|
|
|
95
95
|
The adapter keeps the replicated transcript and maps it on every update. User, assistant and compaction entries become messages; tool results fill in the tool calls they answer; the generation in flight shows as a streaming message; retries and running compactions show as system messages. `busy()` and `queue()` read durable's live and inbox documents. A plain send queues a follow-up, and a steer send steers, as slicc-spectrum's composer asks today. There is one cone so far; scoops, the freezer, licks and questions come later. slicc-spectrum is a peer dependency (≥ 1.7.0) used for types only.
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
## Patched dependencies
|
|
98
|
+
|
|
99
|
+
Fixes to pi stay in this repository. [`patches/patches.json`](patches/patches.json) lists each one with its `kind`, `package`, `patchedVersion`, `reason`, `removeWhen` and `verify` command, and an optional `marker` (a file in the package and a string it must contain):
|
|
100
|
+
|
|
101
|
+
- `monkeypatch`: code that runs in users' browsers is patched at runtime. `applyPatches()` in [`src/patches.ts`](src/patches.ts) applies them once before pi is used: `PortListener.start()` calls it, so `hostAgent` and a `PortListener` used directly with pi's `Server` both get them. Each one checks that the code it replaces still looks as expected and throws, naming its manifest entry, if not. Today there is one: pi-server's `Server.accept` calls `unref()` on its handshake timer, which browsers don't have, so the patch gives numeric timer ids a no-op `unref`.
|
|
102
|
+
- `patch-package`: repository-only fixes go in `patches/<package>+<version>.patch`, applied by a `postinstall` that runs [patch-package](https://github.com/ds300/patch-package). There are none yet.
|
|
103
|
+
- `environment`: something the host must provide. pi-server imports `randomUUID` from `node:crypto`; slicc-bios serves a stub backed by `globalThis.crypto`, and the integration bundles alias it to `test/integration/shims/node-crypto.js`.
|
|
104
|
+
|
|
105
|
+
`npm run lint:patches` (part of `npm run lint`) fails when an installed version differs from `patchedVersion`, a marker is gone, a monkeypatch isn't named in `src/patches.ts`, a patch file and its entry don't match, or `renovate.json` doesn't route the package to the `patched dependencies` group with automerge off. That group covers every `@earendil-works/*` package, so a pi bump is always a reviewed PR: rerun each entry's `verify`, then move `patchedVersion` forward or drop the entry.
|
|
98
106
|
|
|
99
107
|
## Develop
|
|
100
108
|
|
package/dist/host.js
CHANGED
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
SessionNotFoundError
|
|
10
10
|
} from "@earendil-works/pi-server";
|
|
11
11
|
import { createAgentControl } from "./control.js";
|
|
12
|
+
import { PortListener } from "./listener.js";
|
|
12
13
|
import { AGENT_SESSION, AgentControl, AgentSessions, AgentTranscript } from "./services.js";
|
|
13
14
|
import { AgentSettings } from "./settings.js";
|
|
14
|
-
import { PortListener } from "./wire.js";
|
|
15
15
|
function endpointFor(provider) {
|
|
16
16
|
const endpoint = createRemoteServiceEndpoint(provider);
|
|
17
17
|
return {
|
package/dist/host.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/host.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n type Context,\n createRemoteServiceEndpoint,\n RemoteServiceProvider,\n replicatedState,\n} from '@earendil-works/chord';\nimport { BACKGROUND_CONTEXT } from '@earendil-works/chord/context';\nimport {\n type RoutedServerServiceHost,\n type RoutedSessionAttachment,\n type RoutedSessionHandle,\n Server,\n type ServerHost,\n SessionNotFoundError,\n} from '@earendil-works/pi-server';\nimport type { Agent } from './agent.ts';\nimport { createAgentControl } from './control.ts';\nimport { AGENT_SESSION, AgentControl, AgentSessions, AgentTranscript } from './services.ts';\nimport { AgentSettings } from './settings.ts';\nimport {
|
|
5
|
-
"mappings": "AAAA;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;AACnC;AAAA,EAIE;AAAA,EAEA;AAAA,OACK;AAEP,SAAS,0BAA0B;AACnC,SAAS,eAAe,cAAc,eAAe,uBAAuB;AAC5E,SAAS,qBAAqB;
|
|
4
|
+
"sourcesContent": ["import {\n type Context,\n createRemoteServiceEndpoint,\n RemoteServiceProvider,\n replicatedState,\n} from '@earendil-works/chord';\nimport { BACKGROUND_CONTEXT } from '@earendil-works/chord/context';\nimport {\n type RoutedServerServiceHost,\n type RoutedSessionAttachment,\n type RoutedSessionHandle,\n Server,\n type ServerHost,\n SessionNotFoundError,\n} from '@earendil-works/pi-server';\nimport type { Agent } from './agent.ts';\nimport { createAgentControl } from './control.ts';\nimport { PortListener } from './listener.ts';\nimport { AGENT_SESSION, AgentControl, AgentSessions, AgentTranscript } from './services.ts';\nimport { AgentSettings } from './settings.ts';\nimport type { PortEndpoint } from './wire.ts';\n\nexport interface AgentHost {\n readonly serverId: string;\n readonly agent: Agent;\n connect(endpoint: PortEndpoint): void;\n close(): Promise<void>;\n}\n\nfunction endpointFor(provider: RemoteServiceProvider): RoutedSessionAttachment {\n const endpoint = createRemoteServiceEndpoint(provider);\n return {\n invokeService: (call, publish, context) =>\n endpoint.invoke(call, (id, update) => publish(id, update, context), context),\n release: () => endpoint.dispose(),\n };\n}\n\nfunction sessionServices(provider: RemoteServiceProvider): RoutedSessionHandle {\n return {\n attachClient: () => endpointFor(provider),\n close: async () => {},\n };\n}\n\nfunction serverServices(): RoutedServerServiceHost {\n return {\n attachClient(presentation) {\n const provider = new RemoteServiceProvider([{ service: AgentSessions, mode: 'singleton' }]);\n provider.provide(AgentSessions, {\n attach: (sessionId, context) => presentation.attachSession(sessionId, context),\n detach: (context) => presentation.detachSession(context),\n });\n const attachment = endpointFor(provider);\n return {\n invokeService: attachment.invokeService,\n release(context) {\n attachment.release(context);\n provider.dispose();\n },\n };\n },\n };\n}\n\nconst noSettings: AgentSettings = {\n state: replicatedState({ models: [], accounts: [] }),\n connect: async () => {\n throw new Error('this agent has no accounts');\n },\n disconnect: async () => {},\n};\n\nexport async function hostAgent(\n agent: Agent,\n options: { serverId?: string; context?: Context; settings?: AgentSettings } = {}\n): Promise<AgentHost> {\n const context = options.context ?? BACKGROUND_CONTEXT;\n const serverId = options.serverId ?? crypto.randomUUID();\n const state = await agent.root.viewState(context);\n const provider = new RemoteServiceProvider([\n { service: AgentControl, mode: 'singleton' },\n { service: AgentTranscript, mode: 'singleton' },\n { service: AgentSettings, mode: 'singleton' },\n ]);\n provider.provide(AgentControl, createAgentControl(agent.harness, agent.root));\n provider.provide(AgentTranscript, { state });\n provider.provide(AgentSettings, options.settings ?? noSettings);\n const host: ServerHost = {\n serverServices: serverServices(),\n async resolveSession(sessionId) {\n if (sessionId !== AGENT_SESSION)\n throw new SessionNotFoundError(`unknown session ${sessionId}`);\n return { id: sessionId };\n },\n openSession: async () => sessionServices(provider),\n };\n const listener = new PortListener(serverId);\n const server = await new Server(host, { serverId, listeners: [listener] }).start();\n return {\n serverId,\n agent,\n connect: (endpoint) => listener.connect(endpoint),\n async close() {\n await server.close();\n provider.dispose();\n state.dispose();\n await agent.close();\n },\n };\n}\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAA0B;AACnC;AAAA,EAIE;AAAA,EAEA;AAAA,OACK;AAEP,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAC7B,SAAS,eAAe,cAAc,eAAe,uBAAuB;AAC5E,SAAS,qBAAqB;AAU9B,SAAS,YAAY,UAA0D;AAC7E,QAAM,WAAW,4BAA4B,QAAQ;AACrD,SAAO;AAAA,IACL,eAAe,CAAC,MAAM,SAAS,YAC7B,SAAS,OAAO,MAAM,CAAC,IAAI,WAAW,QAAQ,IAAI,QAAQ,OAAO,GAAG,OAAO;AAAA,IAC7E,SAAS,MAAM,SAAS,QAAQ;AAAA,EAClC;AACF;AAEA,SAAS,gBAAgB,UAAsD;AAC7E,SAAO;AAAA,IACL,cAAc,MAAM,YAAY,QAAQ;AAAA,IACxC,OAAO,YAAY;AAAA,IAAC;AAAA,EACtB;AACF;AAEA,SAAS,iBAA0C;AACjD,SAAO;AAAA,IACL,aAAa,cAAc;AACzB,YAAM,WAAW,IAAI,sBAAsB,CAAC,EAAE,SAAS,eAAe,MAAM,YAAY,CAAC,CAAC;AAC1F,eAAS,QAAQ,eAAe;AAAA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YAAY,gBAAgB,QAAQ;AAAA,EACnD;AACA,QAAM,WAAW,IAAI,aAAa,QAAQ;AAC1C,QAAM,SAAS,MAAM,IAAI,OAAO,MAAM,EAAE,UAAU,WAAW,CAAC,QAAQ,EAAE,CAAC,EAAE,MAAM;AACjF,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,SAAS,CAAC,aAAa,SAAS,QAAQ,QAAQ;AAAA,IAChD,MAAM,QAAQ;AACZ,YAAM,OAAO,MAAM;AACnB,eAAS,QAAQ;AACjB,YAAM,QAAQ;AACd,YAAM,MAAM,MAAM;AAAA,IACpB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import { createAgentControl } from "./control.js";
|
|
|
4
4
|
import { CREDENTIALS_DATABASE, EncryptedCredentialStore } from "./credentials.js";
|
|
5
5
|
import { hostAgent } from "./host.js";
|
|
6
6
|
import { HOME, kernelEnvironment, SliccKernelEnv } from "./kernel/env.js";
|
|
7
|
+
import { PortListener } from "./listener.js";
|
|
7
8
|
import {
|
|
8
9
|
runAgentWorker
|
|
9
10
|
} from "./main.js";
|
|
@@ -12,6 +13,7 @@ import {
|
|
|
12
13
|
AGENT_LOCK,
|
|
13
14
|
startAgent
|
|
14
15
|
} from "./owner.js";
|
|
16
|
+
import { applyPatches, patchServerAccept } from "./patches.js";
|
|
15
17
|
import { SliccPrompt } from "./prompt.js";
|
|
16
18
|
import {
|
|
17
19
|
AGENT_SESSION,
|
|
@@ -25,7 +27,9 @@ import {
|
|
|
25
27
|
createAgentSettings,
|
|
26
28
|
createSliccModels,
|
|
27
29
|
DEFAULT_MODEL,
|
|
28
|
-
|
|
30
|
+
DEFAULT_REGIONS,
|
|
31
|
+
sliccProviders,
|
|
32
|
+
withDefaultRegions
|
|
29
33
|
} from "./settings.js";
|
|
30
34
|
import {
|
|
31
35
|
AGENT_DIRECTORY,
|
|
@@ -33,7 +37,7 @@ import {
|
|
|
33
37
|
openOpfsSqliteStorage,
|
|
34
38
|
WasmSqliteDatabase
|
|
35
39
|
} from "./sqlite.js";
|
|
36
|
-
import { PortChannel,
|
|
40
|
+
import { PortChannel, withUnrefTimers } from "./wire.js";
|
|
37
41
|
import { kernelPort, serveConnections } from "./worker.js";
|
|
38
42
|
export {
|
|
39
43
|
AGENT_DIRECTORY,
|
|
@@ -46,6 +50,7 @@ export {
|
|
|
46
50
|
BEDROCK,
|
|
47
51
|
CREDENTIALS_DATABASE,
|
|
48
52
|
DEFAULT_MODEL,
|
|
53
|
+
DEFAULT_REGIONS,
|
|
49
54
|
EncryptedCredentialStore,
|
|
50
55
|
HOME,
|
|
51
56
|
PortChannel,
|
|
@@ -54,6 +59,7 @@ export {
|
|
|
54
59
|
SliccPrompt,
|
|
55
60
|
WasmSqliteDatabase,
|
|
56
61
|
answerText,
|
|
62
|
+
applyPatches,
|
|
57
63
|
connectAgent,
|
|
58
64
|
createAgentControl,
|
|
59
65
|
createAgentSettings,
|
|
@@ -64,11 +70,13 @@ export {
|
|
|
64
70
|
openAgent,
|
|
65
71
|
openMemorySqliteStorage,
|
|
66
72
|
openOpfsSqliteStorage,
|
|
73
|
+
patchServerAccept,
|
|
67
74
|
runAgentWorker,
|
|
68
75
|
serveConnections,
|
|
69
76
|
sliccProviders,
|
|
70
77
|
startAgent,
|
|
71
78
|
transportFetch,
|
|
79
|
+
withDefaultRegions,
|
|
72
80
|
withUnrefTimers
|
|
73
81
|
};
|
|
74
82
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export { type Agent, type AgentOptions, answerText, openAgent } from './agent.ts';\nexport { type AgentConnection, connectAgent } from './client.ts';\nexport { createAgentControl } from './control.ts';\nexport { CREDENTIALS_DATABASE, EncryptedCredentialStore } from './credentials.ts';\nexport { type AgentHost, hostAgent } from './host.ts';\nexport type {\n KernelClient,\n KernelFs,\n KernelProcess,\n KernelStat,\n SpawnOptions,\n} from './kernel/client.ts';\nexport { HOME, type KernelEnvOptions, kernelEnvironment, SliccKernelEnv } from './kernel/env.ts';\nexport {\n type AgentWorkerOptions,\n type AgentWorkerScope,\n type KernelAttach,\n runAgentWorker,\n} from './main.ts';\nexport { type Transport, type TransportResponse, transportFetch } from './net.ts';\nexport {\n AGENT_LOCK,\n type AgentOwner,\n type AgentWorker,\n type OwnerOptions,\n startAgent,\n} from './owner.ts';\nexport { SliccPrompt } from './prompt.ts';\nexport {\n AGENT_SESSION,\n AgentControl,\n AgentSessions,\n type AgentSettingsChange,\n AgentTranscript,\n type OperationError,\n type PromptResult,\n type SendMode,\n type SendRequest,\n type SendResponse,\n} from './services.ts';\nexport {\n type AccountState,\n AgentSettings,\n BEDROCK,\n createAgentSettings,\n createSliccModels,\n DEFAULT_MODEL,\n type ModelChoice,\n type SettingsState,\n sliccProviders,\n} from './settings.ts';\nexport {\n AGENT_DIRECTORY,\n type OpfsSqliteOptions,\n openMemorySqliteStorage,\n openOpfsSqliteStorage,\n WasmSqliteDatabase,\n} from './sqlite.ts';\nexport { PortChannel, type PortEndpoint,
|
|
5
|
-
"mappings": "AAAA,SAAwC,YAAY,iBAAiB;AACrE,SAA+B,oBAAoB;AACnD,SAAS,0BAA0B;AACnC,SAAS,sBAAsB,gCAAgC;AAC/D,SAAyB,iBAAiB;AAQ1C,SAAS,MAA6B,mBAAmB,sBAAsB;AAC/E;AAAA,EAIE;AAAA,OACK;AACP,SAAiD,sBAAsB;AACvE;AAAA,EACE;AAAA,EAIA;AAAA,OACK;AACP,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OAMK;AACP;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAgC,
|
|
4
|
+
"sourcesContent": ["export { type Agent, type AgentOptions, answerText, openAgent } from './agent.ts';\nexport { type AgentConnection, connectAgent } from './client.ts';\nexport { createAgentControl } from './control.ts';\nexport { CREDENTIALS_DATABASE, EncryptedCredentialStore } from './credentials.ts';\nexport { type AgentHost, hostAgent } from './host.ts';\nexport type {\n KernelClient,\n KernelFs,\n KernelProcess,\n KernelStat,\n SpawnOptions,\n} from './kernel/client.ts';\nexport { HOME, type KernelEnvOptions, kernelEnvironment, SliccKernelEnv } from './kernel/env.ts';\nexport { PortListener } from './listener.ts';\nexport {\n type AgentWorkerOptions,\n type AgentWorkerScope,\n type KernelAttach,\n runAgentWorker,\n} from './main.ts';\nexport { type Transport, type TransportResponse, transportFetch } from './net.ts';\nexport {\n AGENT_LOCK,\n type AgentOwner,\n type AgentWorker,\n type OwnerOptions,\n startAgent,\n} from './owner.ts';\nexport { applyPatches, patchServerAccept } from './patches.ts';\nexport { SliccPrompt } from './prompt.ts';\nexport {\n AGENT_SESSION,\n AgentControl,\n AgentSessions,\n type AgentSettingsChange,\n AgentTranscript,\n type OperationError,\n type PromptResult,\n type SendMode,\n type SendRequest,\n type SendResponse,\n} from './services.ts';\nexport {\n type AccountState,\n AgentSettings,\n BEDROCK,\n createAgentSettings,\n createSliccModels,\n DEFAULT_MODEL,\n DEFAULT_REGIONS,\n type ModelChoice,\n type SettingsState,\n sliccProviders,\n withDefaultRegions,\n} from './settings.ts';\nexport {\n AGENT_DIRECTORY,\n type OpfsSqliteOptions,\n openMemorySqliteStorage,\n openOpfsSqliteStorage,\n WasmSqliteDatabase,\n} from './sqlite.ts';\nexport { PortChannel, type PortEndpoint, withUnrefTimers } from './wire.ts';\nexport { kernelPort, serveConnections, type WorkerScope } from './worker.ts';\n"],
|
|
5
|
+
"mappings": "AAAA,SAAwC,YAAY,iBAAiB;AACrE,SAA+B,oBAAoB;AACnD,SAAS,0BAA0B;AACnC,SAAS,sBAAsB,gCAAgC;AAC/D,SAAyB,iBAAiB;AAQ1C,SAAS,MAA6B,mBAAmB,sBAAsB;AAC/E,SAAS,oBAAoB;AAC7B;AAAA,EAIE;AAAA,OACK;AACP,SAAiD,sBAAsB;AACvE;AAAA,EACE;AAAA,EAIA;AAAA,OACK;AACP,SAAS,cAAc,yBAAyB;AAChD,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OAMK;AACP;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAgC,uBAAuB;AAChE,SAAS,YAAY,wBAA0C;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/listener.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { applyPatches } from "./patches.js";
|
|
2
|
+
import { post } from "./wire.js";
|
|
3
|
+
class PortConnection {
|
|
4
|
+
closed = false;
|
|
5
|
+
#endpoint;
|
|
6
|
+
#ended;
|
|
7
|
+
constructor(endpoint, ended) {
|
|
8
|
+
this.#endpoint = endpoint;
|
|
9
|
+
this.#ended = ended;
|
|
10
|
+
}
|
|
11
|
+
async send(chunk) {
|
|
12
|
+
if (this.closed) throw new Error("connection is closed");
|
|
13
|
+
post(this.#endpoint, chunk);
|
|
14
|
+
}
|
|
15
|
+
close(finalChunk) {
|
|
16
|
+
if (this.closed) return;
|
|
17
|
+
if (finalChunk) post(this.#endpoint, finalChunk);
|
|
18
|
+
this.closed = true;
|
|
19
|
+
this.#endpoint.postMessage({ close: true });
|
|
20
|
+
this.#endpoint.close?.();
|
|
21
|
+
this.#ended();
|
|
22
|
+
}
|
|
23
|
+
end() {
|
|
24
|
+
this.closed = true;
|
|
25
|
+
this.#ended();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
class PortListener {
|
|
29
|
+
#serverId;
|
|
30
|
+
#connections = /* @__PURE__ */ new Set();
|
|
31
|
+
#accept;
|
|
32
|
+
constructor(serverId) {
|
|
33
|
+
this.#serverId = serverId;
|
|
34
|
+
}
|
|
35
|
+
async start(accept) {
|
|
36
|
+
applyPatches();
|
|
37
|
+
this.#accept = accept;
|
|
38
|
+
}
|
|
39
|
+
async close() {
|
|
40
|
+
for (const connection of [...this.#connections]) connection.close();
|
|
41
|
+
this.#accept = void 0;
|
|
42
|
+
}
|
|
43
|
+
connect(endpoint) {
|
|
44
|
+
const accept = this.#accept;
|
|
45
|
+
if (!accept) throw new Error("agent host is not listening");
|
|
46
|
+
const connection = new PortConnection(endpoint, () => this.#connections.delete(connection));
|
|
47
|
+
this.#connections.add(connection);
|
|
48
|
+
const handler = accept(connection);
|
|
49
|
+
endpoint.addEventListener("message", ({ data }) => {
|
|
50
|
+
if (data instanceof Uint8Array) handler.onData(data);
|
|
51
|
+
else if (data?.close) {
|
|
52
|
+
connection.end();
|
|
53
|
+
handler.onClose();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
const failed = (event) => {
|
|
57
|
+
connection.end();
|
|
58
|
+
handler.onError(new Error(`agent port ${event.type}`));
|
|
59
|
+
};
|
|
60
|
+
endpoint.addEventListener("messageerror", failed);
|
|
61
|
+
endpoint.addEventListener("close", () => {
|
|
62
|
+
if (connection.closed) return;
|
|
63
|
+
connection.end();
|
|
64
|
+
handler.onClose();
|
|
65
|
+
});
|
|
66
|
+
endpoint.start?.();
|
|
67
|
+
endpoint.postMessage({ hello: this.#serverId });
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
export {
|
|
71
|
+
PortListener
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=listener.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/listener.ts"],
|
|
4
|
+
"sourcesContent": ["import type { ServerListener } from '@earendil-works/pi-server';\nimport { applyPatches } from './patches.ts';\nimport { type Frame, type PortEndpoint, post } from './wire.ts';\n\ntype ByteConnectionAcceptor = Parameters<ServerListener['start']>[0];\ntype ByteConnection = Parameters<ByteConnectionAcceptor>[0];\ntype ByteConnectionHandler = ReturnType<ByteConnectionAcceptor>;\n\nclass PortConnection implements ByteConnection {\n closed = false;\n readonly #endpoint: PortEndpoint;\n readonly #ended: () => void;\n\n constructor(endpoint: PortEndpoint, ended: () => void) {\n this.#endpoint = endpoint;\n this.#ended = ended;\n }\n\n async send(chunk: Uint8Array): Promise<void> {\n if (this.closed) throw new Error('connection is closed');\n post(this.#endpoint, chunk);\n }\n\n close(finalChunk?: Uint8Array): void {\n if (this.closed) return;\n if (finalChunk) post(this.#endpoint, finalChunk);\n this.closed = true;\n this.#endpoint.postMessage({ close: true } satisfies Frame);\n this.#endpoint.close?.();\n this.#ended();\n }\n\n end(): void {\n this.closed = true;\n this.#ended();\n }\n}\n\nexport class PortListener implements ServerListener {\n readonly #serverId: string;\n readonly #connections = new Set<PortConnection>();\n #accept: ByteConnectionAcceptor | undefined;\n\n constructor(serverId: string) {\n this.#serverId = serverId;\n }\n\n async start(accept: ByteConnectionAcceptor): Promise<void> {\n applyPatches();\n this.#accept = accept;\n }\n\n async close(): Promise<void> {\n for (const connection of [...this.#connections]) connection.close();\n this.#accept = undefined;\n }\n\n connect(endpoint: PortEndpoint): void {\n const accept = this.#accept;\n if (!accept) throw new Error('agent host is not listening');\n const connection = new PortConnection(endpoint, () => this.#connections.delete(connection));\n this.#connections.add(connection);\n const handler: ByteConnectionHandler = accept(connection);\n endpoint.addEventListener('message', ({ data }) => {\n if (data instanceof Uint8Array) handler.onData(data);\n else if ((data as { close?: boolean } | null)?.close) {\n connection.end();\n handler.onClose();\n }\n });\n const failed = (event: Event) => {\n connection.end();\n handler.onError(new Error(`agent port ${event.type}`));\n };\n endpoint.addEventListener('messageerror', failed);\n endpoint.addEventListener('close', () => {\n if (connection.closed) return;\n connection.end();\n handler.onClose();\n });\n endpoint.start?.();\n endpoint.postMessage({ hello: this.#serverId } satisfies Frame);\n }\n}\n"],
|
|
5
|
+
"mappings": "AACA,SAAS,oBAAoB;AAC7B,SAAwC,YAAY;AAMpD,MAAM,eAAyC;AAAA,EAC7C,SAAS;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY,UAAwB,OAAmB;AACrD,SAAK,YAAY;AACjB,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,MAAM,KAAK,OAAkC;AAC3C,QAAI,KAAK,OAAQ,OAAM,IAAI,MAAM,sBAAsB;AACvD,SAAK,KAAK,WAAW,KAAK;AAAA,EAC5B;AAAA,EAEA,MAAM,YAA+B;AACnC,QAAI,KAAK,OAAQ;AACjB,QAAI,WAAY,MAAK,KAAK,WAAW,UAAU;AAC/C,SAAK,SAAS;AACd,SAAK,UAAU,YAAY,EAAE,OAAO,KAAK,CAAiB;AAC1D,SAAK,UAAU,QAAQ;AACvB,SAAK,OAAO;AAAA,EACd;AAAA,EAEA,MAAY;AACV,SAAK,SAAS;AACd,SAAK,OAAO;AAAA,EACd;AACF;AAEO,MAAM,aAAuC;AAAA,EACzC;AAAA,EACA,eAAe,oBAAI,IAAoB;AAAA,EAChD;AAAA,EAEA,YAAY,UAAkB;AAC5B,SAAK,YAAY;AAAA,EACnB;AAAA,EAEA,MAAM,MAAM,QAA+C;AACzD,iBAAa;AACb,SAAK,UAAU;AAAA,EACjB;AAAA,EAEA,MAAM,QAAuB;AAC3B,eAAW,cAAc,CAAC,GAAG,KAAK,YAAY,EAAG,YAAW,MAAM;AAClE,SAAK,UAAU;AAAA,EACjB;AAAA,EAEA,QAAQ,UAA8B;AACpC,UAAM,SAAS,KAAK;AACpB,QAAI,CAAC,OAAQ,OAAM,IAAI,MAAM,6BAA6B;AAC1D,UAAM,aAAa,IAAI,eAAe,UAAU,MAAM,KAAK,aAAa,OAAO,UAAU,CAAC;AAC1F,SAAK,aAAa,IAAI,UAAU;AAChC,UAAM,UAAiC,OAAO,UAAU;AACxD,aAAS,iBAAiB,WAAW,CAAC,EAAE,KAAK,MAAM;AACjD,UAAI,gBAAgB,WAAY,SAAQ,OAAO,IAAI;AAAA,eACzC,MAAqC,OAAO;AACpD,mBAAW,IAAI;AACf,gBAAQ,QAAQ;AAAA,MAClB;AAAA,IACF,CAAC;AACD,UAAM,SAAS,CAAC,UAAiB;AAC/B,iBAAW,IAAI;AACf,cAAQ,QAAQ,IAAI,MAAM,cAAc,MAAM,IAAI,EAAE,CAAC;AAAA,IACvD;AACA,aAAS,iBAAiB,gBAAgB,MAAM;AAChD,aAAS,iBAAiB,SAAS,MAAM;AACvC,UAAI,WAAW,OAAQ;AACvB,iBAAW,IAAI;AACf,cAAQ,QAAQ;AAAA,IAClB,CAAC;AACD,aAAS,QAAQ;AACjB,aAAS,YAAY,EAAE,OAAO,KAAK,UAAU,CAAiB;AAAA,EAChE;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/patches.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Server } from "@earendil-works/pi-server";
|
|
2
|
+
import { withUnrefTimers } from "./wire.js";
|
|
3
|
+
const applied = /* @__PURE__ */ Symbol.for("slicc.agent.patches");
|
|
4
|
+
function patchServerAccept(target) {
|
|
5
|
+
if (target[applied]) return;
|
|
6
|
+
const original = target.prototype.accept;
|
|
7
|
+
if (typeof original !== "function" || !String(original).includes("handshakeTimeout.unref()")) {
|
|
8
|
+
throw new Error(
|
|
9
|
+
"pi-server-handshake-unref: Server.prototype.accept no longer calls handshakeTimeout.unref(); revisit patches.json"
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
target.prototype.accept = function accept(...args) {
|
|
13
|
+
return withUnrefTimers(() => original.apply(this, args));
|
|
14
|
+
};
|
|
15
|
+
target[applied] = true;
|
|
16
|
+
}
|
|
17
|
+
function applyPatches() {
|
|
18
|
+
patchServerAccept(Server);
|
|
19
|
+
}
|
|
20
|
+
export {
|
|
21
|
+
applyPatches,
|
|
22
|
+
patchServerAccept
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=patches.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/patches.ts"],
|
|
4
|
+
"sourcesContent": ["import { Server } from '@earendil-works/pi-server';\nimport { withUnrefTimers } from './wire.ts';\n\nconst applied = Symbol.for('slicc.agent.patches');\n\ninterface Patchable {\n prototype: { accept: (...args: unknown[]) => unknown };\n [applied]?: true;\n}\n\nexport function patchServerAccept(target: Patchable): void {\n if (target[applied]) return;\n const original = target.prototype.accept;\n if (typeof original !== 'function' || !String(original).includes('handshakeTimeout.unref()')) {\n throw new Error(\n 'pi-server-handshake-unref: Server.prototype.accept no longer calls handshakeTimeout.unref(); revisit patches.json'\n );\n }\n target.prototype.accept = function accept(this: unknown, ...args: unknown[]) {\n return withUnrefTimers(() => original.apply(this, args));\n };\n target[applied] = true;\n}\n\nexport function applyPatches(): void {\n patchServerAccept(Server as unknown as Patchable);\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,cAAc;AACvB,SAAS,uBAAuB;AAEhC,MAAM,UAAU,uBAAO,IAAI,qBAAqB;AAOzC,SAAS,kBAAkB,QAAyB;AACzD,MAAI,OAAO,OAAO,EAAG;AACrB,QAAM,WAAW,OAAO,UAAU;AAClC,MAAI,OAAO,aAAa,cAAc,CAAC,OAAO,QAAQ,EAAE,SAAS,0BAA0B,GAAG;AAC5F,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO,UAAU,SAAS,SAAS,UAAyB,MAAiB;AAC3E,WAAO,gBAAgB,MAAM,SAAS,MAAM,MAAM,IAAI,CAAC;AAAA,EACzD;AACA,SAAO,OAAO,IAAI;AACpB;AAEO,SAAS,eAAqB;AACnC,oBAAkB,MAA8B;AAClD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/settings.js
CHANGED
|
@@ -6,13 +6,29 @@ import { createModels } from "@earendil-works/pi-ai/models";
|
|
|
6
6
|
import { amazonBedrockProvider } from "@earendil-works/pi-ai/providers/amazon-bedrock";
|
|
7
7
|
const BEDROCK = "amazon-bedrock";
|
|
8
8
|
const DEFAULT_MODEL = { provider: BEDROCK, modelId: "us.anthropic.claude-sonnet-5-5" };
|
|
9
|
+
const DEFAULT_REGIONS = { [BEDROCK]: "us-west-2" };
|
|
9
10
|
const AgentSettings = defineService("slicc.agent.settings");
|
|
10
11
|
const corsFree = /* @__PURE__ */ new Set([BEDROCK]);
|
|
11
12
|
function sliccProviders() {
|
|
12
13
|
return [amazonBedrockProvider()];
|
|
13
14
|
}
|
|
15
|
+
function withDefaultRegions(credentials) {
|
|
16
|
+
return {
|
|
17
|
+
async read(providerId, options) {
|
|
18
|
+
const credential = await credentials.read(providerId, options);
|
|
19
|
+
const region = DEFAULT_REGIONS[providerId];
|
|
20
|
+
if (credential?.type !== "api_key" || !region || credential.env?.AWS_REGION) {
|
|
21
|
+
return credential;
|
|
22
|
+
}
|
|
23
|
+
return { ...credential, env: { ...credential.env, AWS_REGION: region } };
|
|
24
|
+
},
|
|
25
|
+
list: (options) => credentials.list(options),
|
|
26
|
+
modify: (providerId, fn, options) => credentials.modify(providerId, fn, options),
|
|
27
|
+
delete: (providerId, options) => credentials.delete(providerId, options)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
14
30
|
function createSliccModels(credentials, providers = sliccProviders()) {
|
|
15
|
-
const models = createModels({ credentials });
|
|
31
|
+
const models = createModels({ credentials: withDefaultRegions(credentials) });
|
|
16
32
|
for (const provider of providers) models.setProvider(provider);
|
|
17
33
|
return models;
|
|
18
34
|
}
|
|
@@ -70,8 +86,10 @@ export {
|
|
|
70
86
|
AgentSettings,
|
|
71
87
|
BEDROCK,
|
|
72
88
|
DEFAULT_MODEL,
|
|
89
|
+
DEFAULT_REGIONS,
|
|
73
90
|
createAgentSettings,
|
|
74
91
|
createSliccModels,
|
|
75
|
-
sliccProviders
|
|
92
|
+
sliccProviders,
|
|
93
|
+
withDefaultRegions
|
|
76
94
|
};
|
|
77
95
|
//# sourceMappingURL=settings.js.map
|
package/dist/settings.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/settings.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n type Context,\n defineService,\n type ReplicatedState,\n replicatedState,\n} from '@earendil-works/chord';\nimport type { CredentialStore, Provider } from '@earendil-works/pi-ai';\nimport { createModels, type MutableModels } from '@earendil-works/pi-ai/models';\nimport { amazonBedrockProvider } from '@earendil-works/pi-ai/providers/amazon-bedrock';\n\nexport const BEDROCK = 'amazon-bedrock';\nexport const DEFAULT_MODEL = { provider: BEDROCK, modelId: 'us.anthropic.claude-sonnet-5-5' };\n\nexport interface ModelChoice {\n id: string;\n label: string;\n provider: string;\n kind: 'chat' | 'classifier';\n reasoning: boolean;\n contextWindow: number;\n}\n\nexport interface AccountState {\n id: string;\n provider: string;\n identity: string;\n status: 'connected' | 'disconnected';\n auth: 'api-key';\n needs: 'cors-free-transport' | null;\n}\n\nexport interface SettingsState {\n models: ModelChoice[];\n accounts: AccountState[];\n}\n\nexport interface AgentSettings {\n readonly state: ReplicatedState<SettingsState>;\n connect(\n providerId: string,\n secret: string,\n region: string | null,\n context: Context\n ): Promise<void>;\n disconnect(providerId: string, context: Context): Promise<void>;\n}\n\nexport const AgentSettings = defineService<AgentSettings>('slicc.agent.settings');\n\nconst corsFree = new Set([BEDROCK]);\n\nexport function sliccProviders(): Provider[] {\n return [amazonBedrockProvider() as Provider];\n}\n\nexport function createSliccModels(\n credentials: CredentialStore,\n providers = sliccProviders()\n): MutableModels {\n const models = createModels({ credentials });\n for (const provider of providers) models.setProvider(provider);\n return models;\n}\n\nfunction choices(models: MutableModels, providers: Provider[]): ModelChoice[] {\n return providers.flatMap((provider) =>\n models.getModels(provider.id).map((model) => ({\n id: `${provider.id}/${model.id}`,\n label: model.name,\n provider: provider.name ?? provider.id,\n kind: 'chat' as const,\n reasoning: Boolean(model.reasoning),\n contextWindow: model.contextWindow,\n }))\n );\n}\n\nasync function accounts(\n credentials: CredentialStore,\n providers: Provider[]\n): Promise<AccountState[]> {\n const stored = new Set((await credentials.list()).map((info) => info.providerId));\n return providers.map((provider) => ({\n id: provider.id,\n provider: provider.name ?? provider.id,\n identity: stored.has(provider.id) ? 'API key' : '',\n status: stored.has(provider.id) ? 'connected' : 'disconnected',\n auth: 'api-key',\n needs: corsFree.has(provider.id) ? 'cors-free-transport' : null,\n }));\n}\n\nexport async function createAgentSettings(\n models: MutableModels,\n credentials: CredentialStore,\n providers = sliccProviders()\n): Promise<AgentSettings> {\n const state = replicatedState<SettingsState>({\n models: choices(models, providers),\n accounts: await accounts(credentials, providers),\n });\n const refresh = async (context: Context) => {\n state.replace(context, {\n models: choices(models, providers),\n accounts: await accounts(credentials, providers),\n });\n };\n return {\n state,\n async connect(providerId, secret, region, context) {\n await credentials.modify(providerId, async () => ({\n type: 'api_key',\n key: secret,\n ...(region ? { env: { AWS_REGION: region } } : {}),\n }));\n await refresh(context);\n },\n async disconnect(providerId, context) {\n await credentials.delete(providerId);\n await refresh(context);\n },\n };\n}\n"],
|
|
5
|
-
"mappings": "AAAA;AAAA,EAEE;AAAA,EAEA;AAAA,OACK;AAEP,SAAS,oBAAwC;AACjD,SAAS,6BAA6B;AAE/B,MAAM,UAAU;AAChB,MAAM,gBAAgB,EAAE,UAAU,SAAS,SAAS,iCAAiC;
|
|
4
|
+
"sourcesContent": ["import {\n type Context,\n defineService,\n type ReplicatedState,\n replicatedState,\n} from '@earendil-works/chord';\nimport type { CredentialStore, Provider } from '@earendil-works/pi-ai';\nimport { createModels, type MutableModels } from '@earendil-works/pi-ai/models';\nimport { amazonBedrockProvider } from '@earendil-works/pi-ai/providers/amazon-bedrock';\n\nexport const BEDROCK = 'amazon-bedrock';\nexport const DEFAULT_MODEL = { provider: BEDROCK, modelId: 'us.anthropic.claude-sonnet-5-5' };\nexport const DEFAULT_REGIONS: Readonly<Record<string, string>> = { [BEDROCK]: 'us-west-2' };\n\nexport interface ModelChoice {\n id: string;\n label: string;\n provider: string;\n kind: 'chat' | 'classifier';\n reasoning: boolean;\n contextWindow: number;\n}\n\nexport interface AccountState {\n id: string;\n provider: string;\n identity: string;\n status: 'connected' | 'disconnected';\n auth: 'api-key';\n needs: 'cors-free-transport' | null;\n}\n\nexport interface SettingsState {\n models: ModelChoice[];\n accounts: AccountState[];\n}\n\nexport interface AgentSettings {\n readonly state: ReplicatedState<SettingsState>;\n connect(\n providerId: string,\n secret: string,\n region: string | null,\n context: Context\n ): Promise<void>;\n disconnect(providerId: string, context: Context): Promise<void>;\n}\n\nexport const AgentSettings = defineService<AgentSettings>('slicc.agent.settings');\n\nconst corsFree = new Set([BEDROCK]);\n\nexport function sliccProviders(): Provider[] {\n return [amazonBedrockProvider() as Provider];\n}\n\nexport function withDefaultRegions(credentials: CredentialStore): CredentialStore {\n return {\n async read(providerId, options) {\n const credential = await credentials.read(providerId, options);\n const region = DEFAULT_REGIONS[providerId];\n if (credential?.type !== 'api_key' || !region || credential.env?.AWS_REGION) {\n return credential;\n }\n return { ...credential, env: { ...credential.env, AWS_REGION: region } };\n },\n list: (options) => credentials.list(options),\n modify: (providerId, fn, options) => credentials.modify(providerId, fn, options),\n delete: (providerId, options) => credentials.delete(providerId, options),\n };\n}\n\nexport function createSliccModels(\n credentials: CredentialStore,\n providers = sliccProviders()\n): MutableModels {\n const models = createModels({ credentials: withDefaultRegions(credentials) });\n for (const provider of providers) models.setProvider(provider);\n return models;\n}\n\nfunction choices(models: MutableModels, providers: Provider[]): ModelChoice[] {\n return providers.flatMap((provider) =>\n models.getModels(provider.id).map((model) => ({\n id: `${provider.id}/${model.id}`,\n label: model.name,\n provider: provider.name ?? provider.id,\n kind: 'chat' as const,\n reasoning: Boolean(model.reasoning),\n contextWindow: model.contextWindow,\n }))\n );\n}\n\nasync function accounts(\n credentials: CredentialStore,\n providers: Provider[]\n): Promise<AccountState[]> {\n const stored = new Set((await credentials.list()).map((info) => info.providerId));\n return providers.map((provider) => ({\n id: provider.id,\n provider: provider.name ?? provider.id,\n identity: stored.has(provider.id) ? 'API key' : '',\n status: stored.has(provider.id) ? 'connected' : 'disconnected',\n auth: 'api-key',\n needs: corsFree.has(provider.id) ? 'cors-free-transport' : null,\n }));\n}\n\nexport async function createAgentSettings(\n models: MutableModels,\n credentials: CredentialStore,\n providers = sliccProviders()\n): Promise<AgentSettings> {\n const state = replicatedState<SettingsState>({\n models: choices(models, providers),\n accounts: await accounts(credentials, providers),\n });\n const refresh = async (context: Context) => {\n state.replace(context, {\n models: choices(models, providers),\n accounts: await accounts(credentials, providers),\n });\n };\n return {\n state,\n async connect(providerId, secret, region, context) {\n await credentials.modify(providerId, async () => ({\n type: 'api_key',\n key: secret,\n ...(region ? { env: { AWS_REGION: region } } : {}),\n }));\n await refresh(context);\n },\n async disconnect(providerId, context) {\n await credentials.delete(providerId);\n await refresh(context);\n },\n };\n}\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA,EAEE;AAAA,EAEA;AAAA,OACK;AAEP,SAAS,oBAAwC;AACjD,SAAS,6BAA6B;AAE/B,MAAM,UAAU;AAChB,MAAM,gBAAgB,EAAE,UAAU,SAAS,SAAS,iCAAiC;AACrF,MAAM,kBAAoD,EAAE,CAAC,OAAO,GAAG,YAAY;AAoCnF,MAAM,gBAAgB,cAA6B,sBAAsB;AAEhF,MAAM,WAAW,oBAAI,IAAI,CAAC,OAAO,CAAC;AAE3B,SAAS,iBAA6B;AAC3C,SAAO,CAAC,sBAAsB,CAAa;AAC7C;AAEO,SAAS,mBAAmB,aAA+C;AAChF,SAAO;AAAA,IACL,MAAM,KAAK,YAAY,SAAS;AAC9B,YAAM,aAAa,MAAM,YAAY,KAAK,YAAY,OAAO;AAC7D,YAAM,SAAS,gBAAgB,UAAU;AACzC,U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AA,IACN,OAAO,SAAS,IAAI,SAAS,EAAE,IAAI,wBAAwB;AAAA,EAC7D,EAAE;AACJ;AAEA,eAAsB,oBACpB,QACA,aACA,YAAY,eAAe,GACH;AACxB,QAAM,QAAQ,gBAA+B;AAAA,IAC3C,QAAQ,QAAQ,QAAQ,SAAS;AAAA,IACjC,UAAU,MAAM,SAAS,aAAa,SAAS;AAAA,EACjD,CAAC;AACD,QAAM,UAAU,OAAO,YAAqB;AAC1C,UAAM,QAAQ,SAAS;AAAA,MACrB,QAAQ,QAAQ,QAAQ,SAAS;AAAA,MACjC,UAAU,MAAM,SAAS,aAAa,SAAS;AAAA,IACjD,CAAC;AAAA,EACH;AACA,SAAO;AAAA,IACL;AAAA,IACA,MAAM,QAAQ,YAAY,QAAQ,QAAQ,SAAS;AACjD,YAAM,YAAY,OAAO,YAAY,aAAa;AAAA,QAChD,MAAM;AAAA,QACN,KAAK;AAAA,QACL,GAAI,SAAS,EAAE,KAAK,EAAE,YAAY,OAAO,EAAE,IAAI,CAAC;AAAA,MAClD,EAAE;AACF,YAAM,QAAQ,OAAO;AAAA,IACvB;AAAA,IACA,MAAM,WAAW,YAAY,SAAS;AACpC,YAAM,YAAY,OAAO,UAAU;AACnC,YAAM,QAAQ,OAAO;AAAA,IACvB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/types/host.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Context } from '@earendil-works/chord';
|
|
2
2
|
import type { Agent } from './agent.ts';
|
|
3
3
|
import { AgentSettings } from './settings.ts';
|
|
4
|
-
import {
|
|
4
|
+
import type { PortEndpoint } from './wire.ts';
|
|
5
5
|
export interface AgentHost {
|
|
6
6
|
readonly serverId: string;
|
|
7
7
|
readonly agent: Agent;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,12 +5,14 @@ export { CREDENTIALS_DATABASE, EncryptedCredentialStore } from './credentials.ts
|
|
|
5
5
|
export { type AgentHost, hostAgent } from './host.ts';
|
|
6
6
|
export type { KernelClient, KernelFs, KernelProcess, KernelStat, SpawnOptions, } from './kernel/client.ts';
|
|
7
7
|
export { HOME, type KernelEnvOptions, kernelEnvironment, SliccKernelEnv } from './kernel/env.ts';
|
|
8
|
+
export { PortListener } from './listener.ts';
|
|
8
9
|
export { type AgentWorkerOptions, type AgentWorkerScope, type KernelAttach, runAgentWorker, } from './main.ts';
|
|
9
10
|
export { type Transport, type TransportResponse, transportFetch } from './net.ts';
|
|
10
11
|
export { AGENT_LOCK, type AgentOwner, type AgentWorker, type OwnerOptions, startAgent, } from './owner.ts';
|
|
12
|
+
export { applyPatches, patchServerAccept } from './patches.ts';
|
|
11
13
|
export { SliccPrompt } from './prompt.ts';
|
|
12
14
|
export { AGENT_SESSION, AgentControl, AgentSessions, type AgentSettingsChange, AgentTranscript, type OperationError, type PromptResult, type SendMode, type SendRequest, type SendResponse, } from './services.ts';
|
|
13
|
-
export { type AccountState, AgentSettings, BEDROCK, createAgentSettings, createSliccModels, DEFAULT_MODEL, type ModelChoice, type SettingsState, sliccProviders, } from './settings.ts';
|
|
15
|
+
export { type AccountState, AgentSettings, BEDROCK, createAgentSettings, createSliccModels, DEFAULT_MODEL, DEFAULT_REGIONS, type ModelChoice, type SettingsState, sliccProviders, withDefaultRegions, } from './settings.ts';
|
|
14
16
|
export { AGENT_DIRECTORY, type OpfsSqliteOptions, openMemorySqliteStorage, openOpfsSqliteStorage, WasmSqliteDatabase, } from './sqlite.ts';
|
|
15
|
-
export { PortChannel, type PortEndpoint,
|
|
17
|
+
export { PortChannel, type PortEndpoint, withUnrefTimers } from './wire.ts';
|
|
16
18
|
export { kernelPort, serveConnections, type WorkerScope } from './worker.ts';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ServerListener } from '@earendil-works/pi-server';
|
|
2
|
+
import { type PortEndpoint } from './wire.ts';
|
|
3
|
+
type ByteConnectionAcceptor = Parameters<ServerListener['start']>[0];
|
|
4
|
+
export declare class PortListener implements ServerListener {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(serverId: string);
|
|
7
|
+
start(accept: ByteConnectionAcceptor): Promise<void>;
|
|
8
|
+
close(): Promise<void>;
|
|
9
|
+
connect(endpoint: PortEndpoint): void;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
declare const applied: unique symbol;
|
|
2
|
+
interface Patchable {
|
|
3
|
+
prototype: {
|
|
4
|
+
accept: (...args: unknown[]) => unknown;
|
|
5
|
+
};
|
|
6
|
+
[applied]?: true;
|
|
7
|
+
}
|
|
8
|
+
export declare function patchServerAccept(target: Patchable): void;
|
|
9
|
+
export declare function applyPatches(): void;
|
|
10
|
+
export {};
|
package/dist/types/settings.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare const DEFAULT_MODEL: {
|
|
|
6
6
|
provider: string;
|
|
7
7
|
modelId: string;
|
|
8
8
|
};
|
|
9
|
+
export declare const DEFAULT_REGIONS: Readonly<Record<string, string>>;
|
|
9
10
|
export interface ModelChoice {
|
|
10
11
|
id: string;
|
|
11
12
|
label: string;
|
|
@@ -33,5 +34,6 @@ export interface AgentSettings {
|
|
|
33
34
|
}
|
|
34
35
|
export declare const AgentSettings: import("@earendil-works/chord").Service<AgentSettings>;
|
|
35
36
|
export declare function sliccProviders(): Provider[];
|
|
37
|
+
export declare function withDefaultRegions(credentials: CredentialStore): CredentialStore;
|
|
36
38
|
export declare function createSliccModels(credentials: CredentialStore, providers?: Provider<import("@earendil-works/pi-ai").Api>[]): MutableModels;
|
|
37
39
|
export declare function createAgentSettings(models: MutableModels, credentials: CredentialStore, providers?: Provider<import("@earendil-works/pi-ai").Api>[]): Promise<AgentSettings>;
|
package/dist/types/wire.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import type { ByteTransportFactory } from '@earendil-works/pi-client';
|
|
2
|
-
import type { ServerListener } from '@earendil-works/pi-server';
|
|
3
|
-
type ByteConnectionAcceptor = Parameters<ServerListener['start']>[0];
|
|
4
2
|
export interface PortEndpoint {
|
|
5
3
|
postMessage(message: unknown, transfer?: Transferable[]): void;
|
|
6
4
|
addEventListener(type: 'message', listener: (event: MessageEvent) => void): void;
|
|
@@ -8,20 +6,18 @@ export interface PortEndpoint {
|
|
|
8
6
|
start?(): void;
|
|
9
7
|
close?(): void;
|
|
10
8
|
}
|
|
9
|
+
export type Frame = {
|
|
10
|
+
hello: string;
|
|
11
|
+
} | {
|
|
12
|
+
close: true;
|
|
13
|
+
} | Uint8Array;
|
|
14
|
+
export declare function post(endpoint: PortEndpoint, chunk: Uint8Array): void;
|
|
11
15
|
export declare function withUnrefTimers<T>(run: () => T, scope?: {
|
|
12
16
|
setTimeout: typeof setTimeout;
|
|
13
17
|
}): T;
|
|
14
|
-
export declare class PortListener implements ServerListener {
|
|
15
|
-
#private;
|
|
16
|
-
constructor(serverId: string);
|
|
17
|
-
start(accept: ByteConnectionAcceptor): Promise<void>;
|
|
18
|
-
close(): Promise<void>;
|
|
19
|
-
connect(endpoint: PortEndpoint): void;
|
|
20
|
-
}
|
|
21
18
|
export declare class PortChannel {
|
|
22
19
|
#private;
|
|
23
20
|
readonly hello: Promise<string>;
|
|
24
21
|
constructor(endpoint: PortEndpoint);
|
|
25
22
|
readonly transport: ByteTransportFactory;
|
|
26
23
|
}
|
|
27
|
-
export {};
|
package/dist/wire.js
CHANGED
|
@@ -25,72 +25,6 @@ function withUnrefTimers(run, scope = globalThis) {
|
|
|
25
25
|
scope.setTimeout = original;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
class PortConnection {
|
|
29
|
-
closed = false;
|
|
30
|
-
#endpoint;
|
|
31
|
-
#ended;
|
|
32
|
-
constructor(endpoint, ended) {
|
|
33
|
-
this.#endpoint = endpoint;
|
|
34
|
-
this.#ended = ended;
|
|
35
|
-
}
|
|
36
|
-
async send(chunk) {
|
|
37
|
-
if (this.closed) throw new Error("connection is closed");
|
|
38
|
-
post(this.#endpoint, chunk);
|
|
39
|
-
}
|
|
40
|
-
close(finalChunk) {
|
|
41
|
-
if (this.closed) return;
|
|
42
|
-
if (finalChunk) post(this.#endpoint, finalChunk);
|
|
43
|
-
this.closed = true;
|
|
44
|
-
this.#endpoint.postMessage({ close: true });
|
|
45
|
-
this.#endpoint.close?.();
|
|
46
|
-
this.#ended();
|
|
47
|
-
}
|
|
48
|
-
end() {
|
|
49
|
-
this.closed = true;
|
|
50
|
-
this.#ended();
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
class PortListener {
|
|
54
|
-
#serverId;
|
|
55
|
-
#connections = /* @__PURE__ */ new Set();
|
|
56
|
-
#accept;
|
|
57
|
-
constructor(serverId) {
|
|
58
|
-
this.#serverId = serverId;
|
|
59
|
-
}
|
|
60
|
-
async start(accept) {
|
|
61
|
-
this.#accept = accept;
|
|
62
|
-
}
|
|
63
|
-
async close() {
|
|
64
|
-
for (const connection of [...this.#connections]) connection.close();
|
|
65
|
-
this.#accept = void 0;
|
|
66
|
-
}
|
|
67
|
-
connect(endpoint) {
|
|
68
|
-
const accept = this.#accept;
|
|
69
|
-
if (!accept) throw new Error("agent host is not listening");
|
|
70
|
-
const connection = new PortConnection(endpoint, () => this.#connections.delete(connection));
|
|
71
|
-
this.#connections.add(connection);
|
|
72
|
-
const handler = withUnrefTimers(() => accept(connection));
|
|
73
|
-
endpoint.addEventListener("message", ({ data }) => {
|
|
74
|
-
if (data instanceof Uint8Array) handler.onData(data);
|
|
75
|
-
else if (data?.close) {
|
|
76
|
-
connection.end();
|
|
77
|
-
handler.onClose();
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
const failed = (event) => {
|
|
81
|
-
connection.end();
|
|
82
|
-
handler.onError(new Error(`agent port ${event.type}`));
|
|
83
|
-
};
|
|
84
|
-
endpoint.addEventListener("messageerror", failed);
|
|
85
|
-
endpoint.addEventListener("close", () => {
|
|
86
|
-
if (connection.closed) return;
|
|
87
|
-
connection.end();
|
|
88
|
-
handler.onClose();
|
|
89
|
-
});
|
|
90
|
-
endpoint.start?.();
|
|
91
|
-
endpoint.postMessage({ hello: this.#serverId });
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
28
|
class PortChannel {
|
|
95
29
|
hello;
|
|
96
30
|
#endpoint;
|
|
@@ -158,7 +92,7 @@ class PortChannel {
|
|
|
158
92
|
}
|
|
159
93
|
export {
|
|
160
94
|
PortChannel,
|
|
161
|
-
|
|
95
|
+
post,
|
|
162
96
|
withUnrefTimers
|
|
163
97
|
};
|
|
164
98
|
//# sourceMappingURL=wire.js.map
|
package/dist/wire.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/wire.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ByteTransportFactory, ByteTransportHandlers } from '@earendil-works/pi-client';\
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { ByteTransportFactory, ByteTransportHandlers } from '@earendil-works/pi-client';\n\nexport interface PortEndpoint {\n postMessage(message: unknown, transfer?: Transferable[]): void;\n addEventListener(type: 'message', listener: (event: MessageEvent) => void): void;\n addEventListener(\n type: 'close' | 'messageerror' | 'error',\n listener: (event: Event) => void\n ): void;\n start?(): void;\n close?(): void;\n}\n\nexport type Frame = { hello: string } | { close: true } | Uint8Array;\n\nexport function post(endpoint: PortEndpoint, chunk: Uint8Array): void {\n const copy = chunk.slice();\n endpoint.postMessage(copy, [copy.buffer]);\n}\n\nfunction unrefable(id: number): object {\n return {\n unref() {\n return this;\n },\n ref() {\n return this;\n },\n [Symbol.toPrimitive]: () => id,\n };\n}\n\nexport function withUnrefTimers<T>(\n run: () => T,\n scope: { setTimeout: typeof setTimeout } = globalThis\n): T {\n const original = scope.setTimeout;\n scope.setTimeout = ((...args: Parameters<typeof setTimeout>) => {\n const id: unknown = original(...args);\n return typeof id === 'number' ? unrefable(id) : id;\n }) as typeof setTimeout;\n try {\n return run();\n } finally {\n scope.setTimeout = original;\n }\n}\n\nexport class PortChannel {\n readonly hello: Promise<string>;\n readonly #endpoint: PortEndpoint;\n readonly #queue: Uint8Array[] = [];\n #handlers: ByteTransportHandlers | undefined;\n #ended: 'close' | Error | undefined;\n #greet!: (serverId: string) => void;\n #refuse!: (error: Error) => void;\n\n constructor(endpoint: PortEndpoint) {\n this.#endpoint = endpoint;\n this.hello = new Promise((greet, refuse) => {\n this.#greet = greet;\n this.#refuse = refuse;\n });\n endpoint.addEventListener('message', ({ data }) => this.#receive(data as Frame));\n endpoint.addEventListener('messageerror', (event) =>\n this.#end(new Error(`agent port ${event.type}`))\n );\n endpoint.addEventListener('error', (event) => this.#end(new Error(`agent port ${event.type}`)));\n endpoint.addEventListener('close', () => this.#end('close'));\n endpoint.start?.();\n }\n\n readonly transport: ByteTransportFactory = (handlers) => {\n this.#handlers = handlers;\n for (const chunk of this.#queue.splice(0)) handlers.onData(chunk);\n if (this.#ended) this.#deliver(this.#ended);\n return {\n send: async (chunk) => {\n if (this.#ended) throw new Error('agent port is closed');\n post(this.#endpoint, chunk);\n },\n close: () => {\n if (this.#ended) return;\n this.#ended = 'close';\n this.#refuse(new Error('agent port closed before hello'));\n this.#endpoint.postMessage({ close: true } satisfies Frame);\n this.#endpoint.close?.();\n },\n };\n };\n\n #receive(frame: Frame): void {\n if (frame instanceof Uint8Array) {\n if (this.#handlers) this.#handlers.onData(frame);\n else this.#queue.push(frame);\n } else if ('hello' in frame) {\n this.#greet(frame.hello);\n } else {\n this.#end('close');\n }\n }\n\n #end(reason: 'close' | Error): void {\n if (this.#ended) return;\n this.#ended = reason;\n this.#refuse(reason === 'close' ? new Error('agent port closed before hello') : reason);\n this.#deliver(reason);\n }\n\n #deliver(reason: 'close' | Error): void {\n const handlers = this.#handlers;\n if (!handlers) return;\n this.#handlers = undefined;\n if (reason === 'close') handlers.onClose();\n else handlers.onError(reason);\n }\n}\n"],
|
|
5
|
+
"mappings": "AAeO,SAAS,KAAK,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
+
"version": "2.5.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",
|
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
"test": "node --test --test-timeout=120000 --test-global-setup=node_modules/@ai-ecoverse/slicc-shared-web/harness/global.mjs 'test/integration/*.test.mjs'",
|
|
48
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'",
|
|
49
49
|
"typecheck": "tsc",
|
|
50
|
-
"lint": "slicc-lint",
|
|
50
|
+
"lint": "slicc-lint && npm run lint:patches",
|
|
51
|
+
"lint:patches": "node scripts/check-patches.mjs",
|
|
51
52
|
"format": "biome check --write .",
|
|
52
53
|
"trust": "npx fledgling sync -y --skip-publish",
|
|
53
54
|
"trust:dry": "npx fledgling sync --dry-run -y --skip-publish",
|