@ai-ecoverse/slicc-agent 3.38.0 → 3.39.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 CHANGED
@@ -111,6 +111,8 @@ const owner = await startAgent({
111
111
 
112
112
  **Adobe.** `adobeProvider()` reaches Adobe's LLM proxy (`ADOBE_PROXY`) with the user's IMS token as a bearer. Its models come from the proxy's `/v1/config` once a token is stored: Anthropic-style models go through pi-ai's `anthropic-messages` API at the proxy root, `api: 'openai'` models through `openai-completions` under `/v1`, and hidden ones are skipped. Every request carries an `X-Session-Id` that is fixed for the worker. The account is a sign-in (`auth: 'oauth'`): `AgentSettings.signIn('adobe')` returns the IMS `clientId`, `scopes` and `imsEnvironment` from `/v1/config`, fetched in the worker through the transport. The page runs the IMS popup and passes the token to `connect`, so `createAgentModel(connection, { login })` takes a `login(providerId, signIn, { signal })` that returns a token. While it runs, the account shows as `signing-in` (spectrum ≥ 1.34.0), and `SettingsPort.cancel(id)` aborts the signal; a cancelled sign-in never connects, even if the login resolves late. The adapter calls `login` before anything else in the click's task, so the page can open its popup while it still has the user's gesture, and `signIn()` then fetches the IMS options lazily. The weekly budget from `/v1/usage` is in the settings state as `budget` (refreshed on connect and every five minutes), and the `tray` adapter shows it in spectrum's TrayStatus. Until the proxy allows `*.sliccy.ai` (vibemigration#228), Adobe needs a CORS-free transport like Bedrock. An expired session's error card offers **Log in**.
113
113
 
114
+ **Classifiers.** The Adobe provider also registers Cloudflare's Clef classifiers as `adobe/clef` and `adobe/clef-flash` (`adobeClassifiers()`): `type: 'classifier'` models on pi-ai's `cloudflare-workers-ai-system-one` API with `baseUrl: <proxy>/v1/ai`, so `models.classify(model, { state, questions })` posts `{ model: '@cf/cloudflare/clef', input }` to the proxy's `/v1/ai/run` with the IMS token as the bearer. The provider maps its short ids to the Workers AI names, and pi parses the answers and prices the usage ($0.24 per million input tokens for Clef, $0.09 for Clef Flash, nothing for output), which counts against the same weekly budget. They are classifiers only: `models.getModels()`, the settings `models` and the picker list chat models, and `models.getAvailableOfType('classifier', 'adobe')` returns them only while an Adobe token is stored.
115
+
114
116
  **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.
115
117
 
116
118
  **Settings.** The `slicc.agent.settings` service shows the models and accounts and takes `connect(providerId, apiKey)` and `disconnect(providerId)`.
@@ -511,7 +513,7 @@ The built-in `sprinkles` skill teaches the files, the bridge and the command.
511
513
 
512
514
  ## The kernel
513
515
 
514
- `@ai-ecoverse/slicc-kernel` is a peer dependency (`>=1.47.1 <2`, the first kernel with users and the H1 wasm commands; until 3.31.0 the floor was 1.26.3): the agent only calls `attachKernel`, the client end of the page kernel's port, so it must match the kernel the page runs. Seven chooses that version: slicc-bios pins the certified kernel next to the agent in `src/packages/agent/package.json`, and pnpm fills the peer from that pin. The devDependency is the lowest certified kernel the range allows (1.47.1), and the unit and integration tests run on it with the H1 wasm commands as devDependencies. A second CI job reruns the integration tests on the newest certified kernel (`NEWEST_CERTIFIED_KERNEL` in `.github/workflows/ci.yml`), with the wasm commands certified for it (`NEWEST_CERTIFIED_WASM`). Today the floor is 1.47.1 and the newest certified kernel 1.61.0; the second job moves by hand to each newer certified kernel, so both ends of the range are tested. If the port protocol ever breaks within 1.x, a patch release narrows the upper bound. Renovate opens PRs for the kernel, `wasi-pnpm`, the `wasm-*` packages and `slicc-cdp` but never merges them, because they move only after the homescoop coordinator certifies them.
516
+ `@ai-ecoverse/slicc-kernel` is a peer dependency (`>=1.47.1 <2`, the first kernel with users and the H1 wasm commands; until 3.31.0 the floor was 1.26.3): the agent only calls `attachKernel`, the client end of the page kernel's port, so it must match the kernel the page runs. Seven chooses that version: slicc-bios pins the certified kernel next to the agent in `src/packages/agent/package.json`, and pnpm fills the peer from that pin. The devDependency is the lowest certified kernel the range allows (1.47.1), and the unit and integration tests run on it with the H1 wasm commands as devDependencies. A second CI job reruns the integration tests on the newest certified kernel (`NEWEST_CERTIFIED_KERNEL` in `.github/workflows/ci.yml`), with the wasm commands certified for it (`NEWEST_CERTIFIED_WASM`). Today the floor is 1.47.1 and the newest certified kernel 1.62.3; the second job moves by hand to each newer certified kernel, so both ends of the range are tested. If the port protocol ever breaks within 1.x, a patch release narrows the upper bound. Renovate opens PRs for the kernel, `wasi-pnpm`, the `wasm-*` packages and `slicc-cdp` but never merges them, because they move only after the homescoop coordinator certifies them.
515
517
 
516
518
  ## Patched dependencies
517
519
 
package/dist/adobe.js CHANGED
@@ -1,9 +1,49 @@
1
1
  import { anthropicMessagesApi } from "@earendil-works/pi-ai/api/anthropic-messages.lazy";
2
+ import { cloudflareWorkersAISystemOneApi } from "@earendil-works/pi-ai/api/cloudflare-workers-ai-system-one.lazy";
2
3
  import { openAICompletionsApi } from "@earendil-works/pi-ai/api/openai-completions.lazy";
3
4
  import { createProvider } from "@earendil-works/pi-ai/models";
4
5
  const ADOBE = "adobe";
5
6
  const ADOBE_PROXY = "https://adobe-llm-proxy.paolo-moz.workers.dev";
6
7
  const free = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };
8
+ const CLASSIFIER_API = "cloudflare-workers-ai-system-one";
9
+ const WORKERS_AI = "@cf/cloudflare/";
10
+ const CLEF = [
11
+ { id: "clef", name: "Clef", input: 0.24 },
12
+ { id: "clef-flash", name: "Clef Flash", input: 0.09 }
13
+ ];
14
+ function adobeClassifiers(endpoint) {
15
+ return CLEF.map(({ id, name, input }) => ({
16
+ type: "classifier",
17
+ id,
18
+ name,
19
+ provider: ADOBE,
20
+ api: CLASSIFIER_API,
21
+ baseUrl: `${endpoint}/v1/ai`,
22
+ input: ["text"],
23
+ cost: { ...free, input },
24
+ contextWindow: 65536
25
+ }));
26
+ }
27
+ function bearer(headers = {}) {
28
+ const value = Object.entries(headers).find(
29
+ ([name]) => name.toLowerCase() === "authorization"
30
+ )?.[1];
31
+ return value?.replace(/^Bearer\s+/i, "");
32
+ }
33
+ function clef(fetcher) {
34
+ const transport = cloudflareWorkersAISystemOneApi();
35
+ return {
36
+ classify: (model, context, options = {}) => transport.classify(model, context, {
37
+ ...options,
38
+ fetch: options.fetch ?? fetcher,
39
+ apiKey: bearer(options.headers) ?? options.apiKey,
40
+ onPayload: async (payload, sent) => {
41
+ const wire = { ...payload, model: `${WORKERS_AI}${model.id}` };
42
+ return await options.onPayload?.(wire, sent) ?? wire;
43
+ }
44
+ })
45
+ };
46
+ }
7
47
  function adobeModel(info, endpoint) {
8
48
  const openai = info.api === "openai";
9
49
  return {
@@ -64,17 +104,20 @@ function adobeProvider({
64
104
  }
65
105
  }
66
106
  },
67
- models: [],
107
+ models: adobeClassifiers(endpoint),
68
108
  fetchModels: async () => (await adobeConfig(endpoint, fetcher)).models.filter((info) => !info.hidden).map((info) => adobeModel(info, endpoint)),
69
109
  api: {
70
110
  "anthropic-messages": anthropicMessagesApi(),
71
111
  "openai-completions": openAICompletionsApi()
72
- }
112
+ },
113
+ classifiers: { [CLASSIFIER_API]: clef(fetcher) }
73
114
  });
74
115
  }
75
116
  export {
76
117
  ADOBE,
77
118
  ADOBE_PROXY,
119
+ CLASSIFIER_API,
120
+ adobeClassifiers,
78
121
  adobeConfig,
79
122
  adobeModel,
80
123
  adobeProvider,
package/dist/adobe.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/adobe.ts"],
4
- "sourcesContent": ["import type { Provider } from '@earendil-works/pi-ai';\nimport { anthropicMessagesApi } from '@earendil-works/pi-ai/api/anthropic-messages.lazy';\nimport { openAICompletionsApi } from '@earendil-works/pi-ai/api/openai-completions.lazy';\nimport { createProvider } from '@earendil-works/pi-ai/models';\n\nexport const ADOBE = 'adobe';\nexport const ADOBE_PROXY = 'https://adobe-llm-proxy.paolo-moz.workers.dev';\n\nexport interface AdobeModelInfo {\n id: string;\n name: string;\n api?: 'anthropic' | 'openai';\n context_window?: number;\n max_tokens?: number;\n reasoning?: boolean;\n input?: string[];\n cost?: { input: number; output: number; cacheRead: number; cacheWrite: number };\n hidden?: boolean;\n}\n\nexport interface AdobeConfig {\n clientId: string;\n scopes: string;\n imsEnvironment: string;\n models: AdobeModelInfo[];\n}\n\nexport interface Budget {\n percent: number;\n window: 'weekly';\n resets: string;\n}\n\ntype Fetch = typeof fetch;\n\nconst free = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };\n\nexport function adobeModel(info: AdobeModelInfo, endpoint: string) {\n const openai = info.api === 'openai';\n return {\n id: info.id,\n name: info.name,\n provider: ADOBE,\n api: openai ? ('openai-completions' as const) : ('anthropic-messages' as const),\n baseUrl: openai ? `${endpoint}/v1` : endpoint,\n reasoning: info.reasoning ?? !openai,\n input: (info.input ?? ['text']).filter(\n (kind): kind is 'text' | 'image' => kind === 'text' || kind === 'image'\n ),\n cost: info.cost ?? free,\n contextWindow: info.context_window ?? 200000,\n maxTokens: info.max_tokens ?? 8192,\n ...(openai ? { compat: { supportsStore: false, supportsDeveloperRole: false } } : {}),\n };\n}\n\nexport async function adobeConfig(endpoint: string, fetcher: Fetch): Promise<AdobeConfig> {\n const response = await fetcher(`${endpoint}/v1/config`, {\n headers: { Accept: 'application/json' },\n });\n if (!response.ok) throw new Error(`the Adobe proxy answered /v1/config with ${response.status}`);\n return (await response.json()) as AdobeConfig;\n}\n\nexport async function adobeUsage(\n token: string,\n {\n endpoint = ADOBE_PROXY,\n fetch: fetcher = globalThis.fetch,\n }: { endpoint?: string; fetch?: Fetch } = {}\n): Promise<Budget | null> {\n const response = await fetcher(`${endpoint}/v1/usage`, {\n headers: { Accept: 'application/json', Authorization: `Bearer ${token}` },\n });\n if (!response.ok) return null;\n const weekly = (\n (await response.json()) as { usage?: { weekly?: { percent?: number; resetsAt?: string } } }\n ).usage?.weekly;\n if (typeof weekly?.percent !== 'number' || typeof weekly.resetsAt !== 'string') return null;\n return { percent: weekly.percent, window: 'weekly', resets: weekly.resetsAt };\n}\n\nexport function adobeProvider({\n endpoint = ADOBE_PROXY,\n session = crypto.randomUUID(),\n fetch: fetcher = (input, init) => globalThis.fetch(input, init),\n}: {\n endpoint?: string;\n session?: string;\n fetch?: Fetch;\n} = {}): Provider {\n return createProvider({\n id: ADOBE,\n name: 'Adobe',\n baseUrl: endpoint,\n headers: { 'X-Session-Id': session },\n auth: {\n apiKey: {\n name: 'Adobe IMS',\n resolve: async ({ credential, signal }) => {\n signal.throwIfAborted();\n if (!credential?.key) return undefined;\n return {\n auth: { headers: { Authorization: `Bearer ${credential.key}` } },\n source: 'Adobe IMS',\n };\n },\n },\n },\n models: [],\n fetchModels: async () =>\n (await adobeConfig(endpoint, fetcher)).models\n .filter((info) => !info.hidden)\n .map((info) => adobeModel(info, endpoint)),\n api: {\n 'anthropic-messages': anthropicMessagesApi(),\n 'openai-completions': openAICompletionsApi(),\n },\n }) as Provider;\n}\n"],
5
- "mappings": "AACA,SAAS,4BAA4B;AACrC,SAAS,4BAA4B;AACrC,SAAS,sBAAsB;AAExB,MAAM,QAAQ;AACd,MAAM,cAAc;AA6B3B,MAAM,OAAO,EAAE,OAAO,GAAG,QAAQ,GAAG,WAAW,GAAG,YAAY,EAAE;AAEzD,SAAS,WAAW,MAAsB,UAAkB;AACjE,QAAM,SAAS,KAAK,QAAQ;AAC5B,SAAO;AAAA,IACL,IAAI,KAAK;AAAA,IACT,MAAM,KAAK;AAAA,IACX,UAAU;AAAA,IACV,KAAK,SAAU,uBAAkC;AAAA,IACjD,SAAS,SAAS,GAAG,QAAQ,QAAQ;AAAA,IACrC,WAAW,KAAK,aAAa,CAAC;AAAA,IAC9B,QAAQ,KAAK,SAAS,CAAC,MAAM,GAAG;AAAA,MAC9B,CAAC,SAAmC,SAAS,UAAU,SAAS;AAAA,IAClE;AAAA,IACA,MAAM,KAAK,QAAQ;AAAA,IACnB,eAAe,KAAK,kBAAkB;AAAA,IACtC,WAAW,KAAK,cAAc;AAAA,IAC9B,GAAI,SAAS,EAAE,QAAQ,EAAE,eAAe,OAAO,uBAAuB,M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WAAW,GAAG,GAAG,EAAE;AAAA,YAC/D,QAAQ;AAAA,UACV;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA,QAAQ,CAAC;AAAA,IACT,aAAa,aACV,MAAM,YAAY,UAAU,OAAO,GAAG,OACpC,OAAO,CAAC,SAAS,CAAC,KAAK,MAAM,EAC7B,IAAI,CAAC,SAAS,WAAW,MAAM,QAAQ,CAAC;AAAA,IAC7C,KAAK;AAAA,MACH,sBAAsB,qBAAqB;AAAA,MAC3C,sBAAsB,qBAAqB;AAAA,IAC7C;AAAA,EACF,CAAC;AACH;",
4
+ "sourcesContent": ["import type { ClassifierModel, Provider, ProviderClassifier } from '@earendil-works/pi-ai';\nimport { anthropicMessagesApi } from '@earendil-works/pi-ai/api/anthropic-messages.lazy';\nimport { cloudflareWorkersAISystemOneApi } from '@earendil-works/pi-ai/api/cloudflare-workers-ai-system-one.lazy';\nimport { openAICompletionsApi } from '@earendil-works/pi-ai/api/openai-completions.lazy';\nimport { createProvider } from '@earendil-works/pi-ai/models';\n\nexport const ADOBE = 'adobe';\nexport const ADOBE_PROXY = 'https://adobe-llm-proxy.paolo-moz.workers.dev';\n\nexport interface AdobeModelInfo {\n id: string;\n name: string;\n api?: 'anthropic' | 'openai';\n context_window?: number;\n max_tokens?: number;\n reasoning?: boolean;\n input?: string[];\n cost?: { input: number; output: number; cacheRead: number; cacheWrite: number };\n hidden?: boolean;\n}\n\nexport interface AdobeConfig {\n clientId: string;\n scopes: string;\n imsEnvironment: string;\n models: AdobeModelInfo[];\n}\n\nexport interface Budget {\n percent: number;\n window: 'weekly';\n resets: string;\n}\n\ntype Fetch = typeof fetch;\n\nconst free = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 };\n\nexport const CLASSIFIER_API = 'cloudflare-workers-ai-system-one';\nconst WORKERS_AI = '@cf/cloudflare/';\n\nconst CLEF = [\n { id: 'clef', name: 'Clef', input: 0.24 },\n { id: 'clef-flash', name: 'Clef Flash', input: 0.09 },\n];\n\nexport function adobeClassifiers(endpoint: string): ClassifierModel<typeof CLASSIFIER_API>[] {\n return CLEF.map(({ id, name, input }) => ({\n type: 'classifier',\n id,\n name,\n provider: ADOBE,\n api: CLASSIFIER_API,\n baseUrl: `${endpoint}/v1/ai`,\n input: ['text'],\n cost: { ...free, input },\n contextWindow: 65536,\n }));\n}\n\nfunction bearer(headers: Record<string, string | null> = {}): string | undefined {\n const value = Object.entries(headers).find(\n ([name]) => name.toLowerCase() === 'authorization'\n )?.[1];\n return value?.replace(/^Bearer\\s+/i, '');\n}\n\nfunction clef(fetcher: Fetch): ProviderClassifier {\n const transport = cloudflareWorkersAISystemOneApi();\n return {\n classify: (model, context, options = {}) =>\n transport.classify(model, context, {\n ...options,\n fetch: options.fetch ?? fetcher,\n apiKey: bearer(options.headers) ?? options.apiKey,\n onPayload: async (payload, sent) => {\n const wire = { ...(payload as object), model: `${WORKERS_AI}${model.id}` };\n return (await options.onPayload?.(wire, sent)) ?? wire;\n },\n }),\n };\n}\n\nexport function adobeModel(info: AdobeModelInfo, endpoint: string) {\n const openai = info.api === 'openai';\n return {\n id: info.id,\n name: info.name,\n provider: ADOBE,\n api: openai ? ('openai-completions' as const) : ('anthropic-messages' as const),\n baseUrl: openai ? `${endpoint}/v1` : endpoint,\n reasoning: info.reasoning ?? !openai,\n input: (info.input ?? ['text']).filter(\n (kind): kind is 'text' | 'image' => kind === 'text' || kind === 'image'\n ),\n cost: info.cost ?? free,\n contextWindow: info.context_window ?? 200000,\n maxTokens: info.max_tokens ?? 8192,\n ...(openai ? { compat: { supportsStore: false, supportsDeveloperRole: false } } : {}),\n };\n}\n\nexport async function adobeConfig(endpoint: string, fetcher: Fetch): Promise<AdobeConfig> {\n const response = await fetcher(`${endpoint}/v1/config`, {\n headers: { Accept: 'application/json' },\n });\n if (!response.ok) throw new Error(`the Adobe proxy answered /v1/config with ${response.status}`);\n return (await response.json()) as AdobeConfig;\n}\n\nexport async function adobeUsage(\n token: string,\n {\n endpoint = ADOBE_PROXY,\n fetch: fetcher = globalThis.fetch,\n }: { endpoint?: string; fetch?: Fetch } = {}\n): Promise<Budget | null> {\n const response = await fetcher(`${endpoint}/v1/usage`, {\n headers: { Accept: 'application/json', Authorization: `Bearer ${token}` },\n });\n if (!response.ok) return null;\n const weekly = (\n (await response.json()) as { usage?: { weekly?: { percent?: number; resetsAt?: string } } }\n ).usage?.weekly;\n if (typeof weekly?.percent !== 'number' || typeof weekly.resetsAt !== 'string') return null;\n return { percent: weekly.percent, window: 'weekly', resets: weekly.resetsAt };\n}\n\nexport function adobeProvider({\n endpoint = ADOBE_PROXY,\n session = crypto.randomUUID(),\n fetch: fetcher = (input, init) => globalThis.fetch(input, init),\n}: {\n endpoint?: string;\n session?: string;\n fetch?: Fetch;\n} = {}): Provider {\n return createProvider({\n id: ADOBE,\n name: 'Adobe',\n baseUrl: endpoint,\n headers: { 'X-Session-Id': session },\n auth: {\n apiKey: {\n name: 'Adobe IMS',\n resolve: async ({ credential, signal }) => {\n signal.throwIfAborted();\n if (!credential?.key) return undefined;\n return {\n auth: { headers: { Authorization: `Bearer ${credential.key}` } },\n source: 'Adobe IMS',\n };\n },\n },\n },\n models: adobeClassifiers(endpoint),\n fetchModels: async () =>\n (await adobeConfig(endpoint, fetcher)).models\n .filter((info) => !info.hidden)\n .map((info) => adobeModel(info, endpoint)),\n api: {\n 'anthropic-messages': anthropicMessagesApi(),\n 'openai-completions': openAICompletionsApi(),\n },\n classifiers: { [CLASSIFIER_API]: clef(fetcher) },\n }) as Provider;\n}\n"],
5
+ "mappings": "AACA,SAAS,4BAA4B;AACrC,SAAS,uCAAuC;AAChD,SAAS,4BAA4B;AACrC,SAAS,sBAAsB;AAExB,MAAM,QAAQ;AACd,MAAM,cAAc;AA6B3B,MAAM,OAAO,EAAE,OAAO,GAAG,QAAQ,GAAG,WAAW,GAAG,YAAY,EAAE;AAEzD,MAAM,iBAAiB;AAC9B,MAAM,aAAa;AAEnB,MAAM,OAAO;AAAA,EACX,EAAE,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E,IAII,CAAC,GAAa;AAChB,SAAO,eAAe;AAAA,IACpB,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,SAAS,EAAE,gBAAgB,QAAQ;AAAA,IACnC,MAAM;AAAA,MACJ,QAAQ;AAAA,QACN,MAAM;AAAA,QACN,SAAS,OAAO,EAAE,YAAY,OAAO,MAAM;AACzC,iBAAO,eAAe;AACtB,cAAI,CAAC,YAAY,IAAK,QAAO;AAC7B,iBAAO;AAAA,YACL,MAAM,EAAE,SAAS,EAAE,eAAe,UAAU,WAAW,GAAG,GAAG,EAAE;AAAA,YAC/D,QAAQ;AAAA,UACV;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,IACA,QAAQ,iBAAiB,QAAQ;AAAA,IACjC,aAAa,aACV,MAAM,YAAY,UAAU,OAAO,GAAG,OACpC,OAAO,CAAC,SAAS,CAAC,KAAK,MAAM,EAC7B,IAAI,CAAC,SAAS,WAAW,MAAM,QAAQ,CAAC;AAAA,IAC7C,KAAK;AAAA,MACH,sBAAsB,qBAAqB;AAAA,MAC3C,sBAAsB,qBAAqB;AAAA,IAC7C;AAAA,IACA,aAAa,EAAE,CAAC,cAAc,GAAG,KAAK,OAAO,EAAE;AAAA,EACjD,CAAC;AACH;",
6
6
  "names": []
7
7
  }
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  ADOBE,
3
3
  ADOBE_PROXY,
4
+ adobeClassifiers,
4
5
  adobeConfig,
5
6
  adobeModel,
6
7
  adobeProvider,
@@ -79,6 +80,7 @@ export {
79
80
  SliccPrompt,
80
81
  WasmSqliteDatabase,
81
82
  adminOver,
83
+ adobeClassifiers,
82
84
  adobeConfig,
83
85
  adobeModel,
84
86
  adobeProvider,
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 {\n ADOBE,\n ADOBE_PROXY,\n type AdobeConfig,\n type AdobeModelInfo,\n adobeConfig,\n adobeModel,\n adobeProvider,\n adobeUsage,\n type Budget,\n} from './adobe.ts';\nexport { 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 adminOver,\n type KernelAdmin,\n type KernelUser,\n type KernelUsers,\n serveAdmin,\n type UserClient,\n type UserClients,\n type UserConnect,\n type UserSpec,\n userClients,\n} from './kernel/users.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 KernelSource,\n type OwnerOptions,\n startAgent,\n} from './owner.ts';\nexport { applyPatches, patchServerAccept } from './patches.ts';\nexport { SliccPrompt, sliccPrompt } from './prompt.ts';\nexport {\n type AccountState,\n AGENT_SESSION,\n AgentControl,\n AgentSessions,\n AgentSettings,\n type AgentSettingsChange,\n AgentTranscript,\n type BudgetState,\n type ModelChoice,\n type OperationError,\n type PromptResult,\n type SendMode,\n type SendRequest,\n type SendResponse,\n type SettingsState,\n type SignIn,\n} from './services.ts';\nexport {\n BEDROCK,\n createAgentSettings,\n createSliccModels,\n DEFAULT_MODEL,\n DEFAULT_REGIONS,\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 { type SystemFacts, systemSection } from './system.ts';\nexport { PortChannel, type PortEndpoint, withUnrefTimers } from './wire.ts';\nexport {\n type KernelPorts,\n kernelPort,\n kernelPorts,\n serveConnections,\n type WorkerScope,\n} from './worker.ts';\n"],
5
- "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,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,EACE;AAAA,EAIA;AAAA,EAKA;AAAA,OACK;AACP,SAAS,oBAAoB;AAC7B;AAAA,EAIE;AAAA,OACK;AACP,SAAiD,sBAAsB;AACvE;AAAA,EACE;AAAA,EAKA;AAAA,OACK;AACP,SAAS,cAAc,yBAAyB;AAChD,SAAS,aAAa,mBAAmB;AACzC;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OAUK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAA2B,qBAAqB;AAChD,SAAS,aAAgC,uBAAuB;AAChE;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;",
4
+ "sourcesContent": ["export {\n ADOBE,\n ADOBE_PROXY,\n type AdobeConfig,\n type AdobeModelInfo,\n adobeClassifiers,\n adobeConfig,\n adobeModel,\n adobeProvider,\n adobeUsage,\n type Budget,\n} from './adobe.ts';\nexport { 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 adminOver,\n type KernelAdmin,\n type KernelUser,\n type KernelUsers,\n serveAdmin,\n type UserClient,\n type UserClients,\n type UserConnect,\n type UserSpec,\n userClients,\n} from './kernel/users.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 KernelSource,\n type OwnerOptions,\n startAgent,\n} from './owner.ts';\nexport { applyPatches, patchServerAccept } from './patches.ts';\nexport { SliccPrompt, sliccPrompt } from './prompt.ts';\nexport {\n type AccountState,\n AGENT_SESSION,\n AgentControl,\n AgentSessions,\n AgentSettings,\n type AgentSettingsChange,\n AgentTranscript,\n type BudgetState,\n type ModelChoice,\n type OperationError,\n type PromptResult,\n type SendMode,\n type SendRequest,\n type SendResponse,\n type SettingsState,\n type SignIn,\n} from './services.ts';\nexport {\n BEDROCK,\n createAgentSettings,\n createSliccModels,\n DEFAULT_MODEL,\n DEFAULT_REGIONS,\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 { type SystemFacts, systemSection } from './system.ts';\nexport { PortChannel, type PortEndpoint, withUnrefTimers } from './wire.ts';\nexport {\n type KernelPorts,\n kernelPort,\n kernelPorts,\n serveConnections,\n type WorkerScope,\n} from './worker.ts';\n"],
5
+ "mappings": "AAAA;AAAA,EACE;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,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,EACE;AAAA,EAIA;AAAA,EAKA;AAAA,OACK;AACP,SAAS,oBAAoB;AAC7B;AAAA,EAIE;AAAA,OACK;AACP,SAAiD,sBAAsB;AACvE;AAAA,EACE;AAAA,EAKA;AAAA,OACK;AACP,SAAS,cAAc,yBAAyB;AAChD,SAAS,aAAa,mBAAmB;AACzC;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA;AAAA,OAUK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAA2B,qBAAqB;AAChD,SAAS,aAAgC,uBAAuB;AAChE;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import type { Provider } from '@earendil-works/pi-ai';
1
+ import type { ClassifierModel, Provider } from '@earendil-works/pi-ai';
2
2
  export declare const ADOBE = "adobe";
3
3
  export declare const ADOBE_PROXY = "https://adobe-llm-proxy.paolo-moz.workers.dev";
4
4
  export interface AdobeModelInfo {
@@ -29,6 +29,8 @@ export interface Budget {
29
29
  resets: string;
30
30
  }
31
31
  type Fetch = typeof fetch;
32
+ export declare const CLASSIFIER_API = "cloudflare-workers-ai-system-one";
33
+ export declare function adobeClassifiers(endpoint: string): ClassifierModel<typeof CLASSIFIER_API>[];
32
34
  export declare function adobeModel(info: AdobeModelInfo, endpoint: string): {
33
35
  id: string;
34
36
  name: string;
@@ -1,4 +1,4 @@
1
- export { ADOBE, ADOBE_PROXY, type AdobeConfig, type AdobeModelInfo, adobeConfig, adobeModel, adobeProvider, adobeUsage, type Budget, } from './adobe.ts';
1
+ export { ADOBE, ADOBE_PROXY, type AdobeConfig, type AdobeModelInfo, adobeClassifiers, adobeConfig, adobeModel, adobeProvider, adobeUsage, type Budget, } from './adobe.ts';
2
2
  export { type Agent, type AgentOptions, answerText, openAgent } from './agent.ts';
3
3
  export { type AgentConnection, connectAgent } from './client.ts';
4
4
  export { createAgentControl } from './control.ts';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-agent",
3
- "version": "3.38.0",
3
+ "version": "3.39.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",