@ai-ecoverse/slicc-agent 7.8.15 → 7.9.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.
@@ -2,9 +2,10 @@ import type { AgentRemote } from './remote/host.ts';
2
2
  import type { AgentPages } from './remote/pages.ts';
3
3
  import { VIEW_ONLY } from './view-only.ts';
4
4
  export { VIEW_ONLY };
5
+ export declare const NOT_OWNER = "Only the owner's page can change MCP servers.";
5
6
  type Answer = (...args: unknown[]) => Promise<unknown>;
6
7
  export declare const controlAnswer: (name: string) => Answer;
7
- export declare const settingsAnswer: () => Answer;
8
+ export declare const settingsAnswer: (name: string) => Answer;
8
9
  export declare const remoteAnswer: (name: string) => Answer;
9
10
  export declare function viewPages(): AgentPages;
10
11
  export declare const pageAnswer: (name: string) => Answer;
@@ -363,7 +363,7 @@ export interface AccountState {
363
363
  provider: string;
364
364
  identity: string;
365
365
  status: 'connected' | 'disconnected' | 'expired';
366
- auth: 'api-key' | 'oauth';
366
+ auth: 'api-key' | 'oauth' | 'local';
367
367
  needs: 'cors-free-transport' | null;
368
368
  blocked?: 'cors-free-transport';
369
369
  group?: 'providers' | 'mcp';
@@ -373,7 +373,15 @@ export interface AccountState {
373
373
  description?: string;
374
374
  keyUrl?: string;
375
375
  vaultName?: string;
376
+ state?: McpServerState;
376
377
  }
378
+ export type McpServerState = 'connecting' | 'connected' | 'needs-secret' | 'needs-auth' | 'failed' | 'disabled' | 'refused';
379
+ export type McpEdit = {
380
+ ok: true;
381
+ } | {
382
+ ok: false;
383
+ reason: string;
384
+ };
377
385
  export interface AccountField {
378
386
  name: string;
379
387
  label: string;
@@ -434,6 +442,9 @@ export interface AgentSettings {
434
442
  serverUrl(providerId: string, context: Context): Promise<string | null>;
435
443
  signIn(providerId: string, context: Context): Promise<SignIn | McpSignIn | DeviceSignIn | null>;
436
444
  dismissMoved(context: Context): Promise<void>;
445
+ addServer(name: string, entry: unknown, context: Context): Promise<McpEdit>;
446
+ removeServer(id: string, context: Context): Promise<McpEdit>;
437
447
  }
438
448
  export declare const SETTINGS_METHODS: ("connect" | "disconnect" | "dismissMoved" | "remove" | "serverUrl" | "signIn")[];
449
+ export declare const OWNER_SETTINGS_METHODS: readonly (keyof Omit<AgentSettings, 'state'> & string)[];
439
450
  export declare const AgentSettings: RemoteContract;
@@ -1,5 +1,5 @@
1
1
  import type { Account, ModelOption, Settings, SettingsEvents, SettingsPort } from '@ai-ecoverse/slicc-spectrum/ui';
2
- import type { AgentSettings, ProviderOption, SignIn } from '../services.ts';
2
+ import type { AgentSettings, McpEdit, ProviderOption, SignIn } from '../services.ts';
3
3
  import { type ConnectOptions } from '../sign-ins.ts';
4
4
  import type { AgentAdapter } from './agent-port.ts';
5
5
  import { Emitter } from './emitter.ts';
@@ -13,13 +13,16 @@ export type Login = (providerId: string, signIn: () => Promise<SignIn | null>, o
13
13
  }) => Promise<string | Sealed>;
14
14
  export declare const SIGN_IN_NEEDS_VAULT = "Adobe sign-in needs seven's vault: update seven";
15
15
  export declare const UNFINISHED = "The sign-in didn't finish. Try again.";
16
+ export declare const NOTHING_TO_CONNECT = "This MCP server has no sign-in to connect: it needs none, or it's off in mcp.json.";
16
17
  export declare function readable(error: unknown): Error;
17
18
  type Events = SettingsEvents & {
18
19
  providers: readonly ProviderOption[];
19
20
  };
20
21
  export declare class SettingsAdapter extends Emitter<Events> implements SettingsPort {
21
22
  #private;
22
- constructor(settings: AgentSettings, agent: AgentAdapter, storage: Pick<Storage, 'getItem' | 'setItem'> | null, login?: Login | null, mcp?: Login, popups?: SignInWindow);
23
+ readonly addServer?: (name: string, entry: unknown) => Promise<McpEdit>;
24
+ readonly removeServer?: (id: string) => Promise<McpEdit>;
25
+ constructor(settings: AgentSettings, agent: AgentAdapter, storage: Pick<Storage, 'getItem' | 'setItem'> | null, login?: Login | null, mcp?: Login, popups?: SignInWindow, owner?: boolean);
23
26
  get(): Settings;
24
27
  update(patch: Partial<Settings>): void;
25
28
  models(): readonly ModelOption[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-agent",
3
- "version": "7.8.15",
3
+ "version": "7.9.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",