@ai-ecoverse/slicc-agent 3.43.1 → 3.45.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 +13 -2
- package/dist/agent.js +1 -0
- package/dist/agent.js.map +2 -2
- package/dist/client.js +3 -1
- package/dist/client.js.map +2 -2
- package/dist/codemode/index.js +2 -1
- package/dist/codemode/index.js.map +2 -2
- package/dist/control.js +13 -3
- package/dist/control.js.map +2 -2
- package/dist/freezer/index.js +5 -4
- package/dist/freezer/index.js.map +2 -2
- package/dist/host.js +13 -2
- package/dist/host.js.map +2 -2
- package/dist/kernel/env.js +55 -4
- package/dist/kernel/env.js.map +2 -2
- package/dist/kernel/exec.js +84 -16
- package/dist/kernel/exec.js.map +3 -3
- package/dist/licks/licks.js +17 -1
- package/dist/licks/licks.js.map +2 -2
- package/dist/main.js +29 -10
- package/dist/main.js.map +2 -2
- package/dist/mcp/content.js +3 -1
- package/dist/mcp/content.js.map +2 -2
- package/dist/mcp/tools.js +2 -1
- package/dist/mcp/tools.js.map +2 -2
- package/dist/memory/prompt.js +3 -2
- package/dist/memory/prompt.js.map +2 -2
- package/dist/memory/store.js +5 -3
- package/dist/memory/store.js.map +2 -2
- package/dist/remote/host.js +21 -1
- package/dist/remote/host.js.map +2 -2
- package/dist/secrets/extension.js +147 -0
- package/dist/secrets/extension.js.map +7 -0
- package/dist/secrets/names.js +72 -0
- package/dist/secrets/names.js.map +7 -0
- package/dist/secrets/scrub.js +36 -0
- package/dist/secrets/scrub.js.map +7 -0
- package/dist/secrets/vault.js +162 -0
- package/dist/secrets/vault.js.map +7 -0
- package/dist/secrets/view.js +15 -0
- package/dist/secrets/view.js.map +7 -0
- package/dist/services.js.map +2 -2
- package/dist/skills/index.js +8 -1
- package/dist/skills/index.js.map +2 -2
- package/dist/spectrum/agent-port.js +67 -6
- package/dist/spectrum/agent-port.js.map +2 -2
- package/dist/spectrum/messages.js +13 -0
- package/dist/spectrum/messages.js.map +2 -2
- package/dist/types/agent.d.ts +1 -0
- package/dist/types/client.d.ts +2 -0
- package/dist/types/control.d.ts +2 -1
- package/dist/types/host.d.ts +9 -1
- package/dist/types/kernel/env.d.ts +6 -0
- package/dist/types/kernel/exec.d.ts +8 -1
- package/dist/types/licks/licks.d.ts +1 -0
- package/dist/types/mcp/content.d.ts +1 -1
- package/dist/types/remote/host.d.ts +5 -1
- package/dist/types/secrets/extension.d.ts +31 -0
- package/dist/types/secrets/names.d.ts +24 -0
- package/dist/types/secrets/scrub.d.ts +21 -0
- package/dist/types/secrets/vault.d.ts +30 -0
- package/dist/types/secrets/view.d.ts +9 -0
- package/dist/types/services.d.ts +3 -1
- package/dist/types/skills/index.d.ts +1 -0
- package/dist/types/spectrum/agent-port.d.ts +9 -1
- package/package.json +3 -3
|
@@ -65,5 +65,6 @@ export declare const MAX_ITEMS = 50;
|
|
|
65
65
|
export declare const MAX_EVENTS = 64;
|
|
66
66
|
export declare function render(pending: Pending): Lick;
|
|
67
67
|
export declare function strongest(a: LickSeverity | undefined, b: LickSeverity | undefined): LickSeverity | undefined;
|
|
68
|
+
export declare function scrubbedLick(event: LickEvent): Promise<LickEvent>;
|
|
68
69
|
export declare function createLicks(host: Promise<LicksHost>): Licks;
|
|
69
70
|
export { LICK_STATE_KIND };
|
|
@@ -13,7 +13,7 @@ export interface Truncation {
|
|
|
13
13
|
}
|
|
14
14
|
export declare function formatSize(bytes: number): string;
|
|
15
15
|
export declare function truncateMiddle(content: string, maxBytes: number): Truncation;
|
|
16
|
-
export declare function limitContent(
|
|
16
|
+
export declare function limitContent(raw: Content[], save: Saver): Promise<{
|
|
17
17
|
content: Content[];
|
|
18
18
|
fullOutputPath?: string;
|
|
19
19
|
}>;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import type { Context } from '@earendil-works/chord';
|
|
1
|
+
import type { Context, ReplicatedState } from '@earendil-works/chord';
|
|
2
2
|
import { type AgentEvent, type Conversation, type EntryRecord, type Harness, type SnapshotEvent, type SubmissionId } from '@earendil-works/pi-durable';
|
|
3
|
+
import { type VaultState } from '../secrets/vault.ts';
|
|
3
4
|
import type { Delivered, SendMode, SendRequest, SendResponse } from '../services.ts';
|
|
4
5
|
import { Mapper, type RemoteEvent } from './events.ts';
|
|
6
|
+
export declare const VAULT_BACK = "the vault is answering again";
|
|
7
|
+
export declare function vaultNotices(vault: ReplicatedState<VaultState> | undefined, push: (events: RemoteEvent[]) => void): () => void;
|
|
5
8
|
export declare const MAX_QUEUED = 10000;
|
|
6
9
|
export declare const IDLE_MS = 120000;
|
|
7
10
|
export type RemoteOpened = {
|
|
@@ -41,6 +44,7 @@ export interface RemoteHost {
|
|
|
41
44
|
harness: Harness;
|
|
42
45
|
conversation(agentId: string | null, context: Context): Promise<Conversation>;
|
|
43
46
|
send(request: SendRequest, context: Context): Promise<SendResponse>;
|
|
47
|
+
vault?: ReplicatedState<VaultState>;
|
|
44
48
|
now?: () => number;
|
|
45
49
|
limit?: number;
|
|
46
50
|
sweepMs?: number;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Context, JsonValue } from '@earendil-works/chord';
|
|
2
|
+
import { type AgentChange, type Extension, type Harness, type Storage, type ToolExecutionResult } from '@earendil-works/pi-durable';
|
|
3
|
+
import type { Names, SecretName } from './names.ts';
|
|
4
|
+
import type { Scrub } from './scrub.ts';
|
|
5
|
+
import type { Vault } from './vault.ts';
|
|
6
|
+
import { listedLine, SECRETS_KIND } from './view.ts';
|
|
7
|
+
export { listedLine, SECRETS_KIND };
|
|
8
|
+
export declare const SECRETS = "slicc-secrets";
|
|
9
|
+
export declare const SECRETS_COMMAND = "/secrets";
|
|
10
|
+
export declare const SHELL_GRANTS: readonly ['fnox', 'exec', '--shell-grants', '--'];
|
|
11
|
+
export declare const MODEL_LINE = "Credentials are env vars (`$NAME`) holding placeholders; `secret list` shows them and where each works. The vault fills in the real value only in the listed header, for the listed domain, method and path, over HTTPS (curl, git, fetch). Adding a rule means editing `/etc/fnox/config.toml` with sudo, which the user approves. `fnox exec` gives real values only for secrets the user enabled for exec, and the secrets listed as 'in every bash' already hold real values in your commands. Everything is logged, and stored values are replaced by their placeholder in everything you see; edit around placeholders, since files show them too. Never ask the user to paste a credential into the chat.";
|
|
12
|
+
export declare function scrubResult(result: ToolExecutionResult, scrub: Pick<Scrub, 'texts'>): Promise<ToolExecutionResult | undefined>;
|
|
13
|
+
export declare function renderSecrets(names: readonly SecretName[]): string | undefined;
|
|
14
|
+
export declare function secretsEntry(names: readonly SecretName[]): {
|
|
15
|
+
kind: string;
|
|
16
|
+
data: {
|
|
17
|
+
names: JsonValue;
|
|
18
|
+
};
|
|
19
|
+
model: {
|
|
20
|
+
role: 'user';
|
|
21
|
+
content: string;
|
|
22
|
+
timestamp: number;
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
export declare function shellGrants(names: Pick<Names, 'state'>): (argv: readonly string[]) => readonly string[];
|
|
26
|
+
export declare function pinned<T extends AgentChange>(change: T): T;
|
|
27
|
+
export declare function repin(harness: Pick<Harness, 'conversation'>, storage: Pick<Storage, 'scanConversations'>, context: Context): Promise<number>;
|
|
28
|
+
export declare function secretsExtension(deps: {
|
|
29
|
+
names: Pick<Names, 'state'>;
|
|
30
|
+
vault: Pick<Vault, 'ready' | 'texts'>;
|
|
31
|
+
}): Extension;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Context, type MutableReplicatedState } from '@earendil-works/chord';
|
|
2
|
+
import type { ExecutionEnv } from '@earendil-works/pi-durable/env';
|
|
3
|
+
import type { Vault } from './vault.ts';
|
|
4
|
+
export interface SecretRule {
|
|
5
|
+
domain: string;
|
|
6
|
+
header?: string;
|
|
7
|
+
methods?: string[];
|
|
8
|
+
paths?: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface SecretName {
|
|
11
|
+
name: string;
|
|
12
|
+
placeholder: string;
|
|
13
|
+
exec: false | 'any' | 'argv' | 'shell';
|
|
14
|
+
rules: SecretRule[];
|
|
15
|
+
}
|
|
16
|
+
export declare const LIST = "secret list --json";
|
|
17
|
+
export declare function parseNames(text: string): SecretName[];
|
|
18
|
+
export declare function listNames(env: ExecutionEnv, context: Context): Promise<SecretName[]>;
|
|
19
|
+
export interface Names {
|
|
20
|
+
readonly state: MutableReplicatedState<SecretName[]>;
|
|
21
|
+
refresh(context: Context): Promise<void>;
|
|
22
|
+
close(): void;
|
|
23
|
+
}
|
|
24
|
+
export declare function secretNames(env: ExecutionEnv, vault: Pick<Vault, 'state'>): Names;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type Scrubbable = string | Uint8Array;
|
|
2
|
+
export interface ScrubStream {
|
|
3
|
+
push(chunk: Uint8Array): Promise<Uint8Array>;
|
|
4
|
+
end(): Promise<Uint8Array>;
|
|
5
|
+
drop(): void;
|
|
6
|
+
}
|
|
7
|
+
export interface Scrub {
|
|
8
|
+
texts<T extends Scrubbable>(texts: readonly T[]): Promise<T[]>;
|
|
9
|
+
stream(): ScrubStream;
|
|
10
|
+
}
|
|
11
|
+
export declare const IDENTITY: Scrub;
|
|
12
|
+
export declare function scrubWith(next: Scrub): void;
|
|
13
|
+
export declare function scrubTexts<T extends Scrubbable>(texts: readonly T[]): Promise<T[]>;
|
|
14
|
+
export declare function scrubText(text: string): Promise<string>;
|
|
15
|
+
export declare function scrubItems<T extends {
|
|
16
|
+
type: string;
|
|
17
|
+
text?: string;
|
|
18
|
+
}>(items: readonly T[]): Promise<T[]>;
|
|
19
|
+
export declare function scrubbedOutput(api: {
|
|
20
|
+
output(text: string): unknown;
|
|
21
|
+
}, text: string): Promise<boolean>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type MutableReplicatedState } from '@earendil-works/chord';
|
|
2
|
+
import type { Scrub, Scrubbable, ScrubStream } from './scrub.ts';
|
|
3
|
+
export type ScrubPair = {
|
|
4
|
+
needed: boolean;
|
|
5
|
+
version: number;
|
|
6
|
+
};
|
|
7
|
+
export type Locked = 'no' | 'scrubbing' | 'passkey';
|
|
8
|
+
export interface VaultState {
|
|
9
|
+
port: 'none' | 'ready' | 'waiting';
|
|
10
|
+
needed: boolean;
|
|
11
|
+
version: number;
|
|
12
|
+
locked: Locked;
|
|
13
|
+
held: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const WAITING_MS = 2000;
|
|
16
|
+
export declare const WAITING = "waiting for the vault";
|
|
17
|
+
export declare class Vault implements Scrub {
|
|
18
|
+
#private;
|
|
19
|
+
readonly state: MutableReplicatedState<VaultState>;
|
|
20
|
+
constructor(now?: () => number);
|
|
21
|
+
get needed(): boolean;
|
|
22
|
+
connect(port: MessagePort | undefined, scrub: unknown): void;
|
|
23
|
+
ready(): Promise<void>;
|
|
24
|
+
texts<T extends Scrubbable>(texts: readonly T[]): Promise<T[]>;
|
|
25
|
+
stream(): ScrubStream;
|
|
26
|
+
}
|
|
27
|
+
export declare function holdText(state: VaultState): string | undefined;
|
|
28
|
+
export declare function listenVault(scope: {
|
|
29
|
+
addEventListener(type: 'message', listener: (event: MessageEvent) => void): void;
|
|
30
|
+
}, vault: Vault): void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SecretName } from './names.ts';
|
|
2
|
+
import type { VaultState } from './vault.ts';
|
|
3
|
+
export declare const SECRETS_KIND = "slicc.secrets";
|
|
4
|
+
export interface VaultHold {
|
|
5
|
+
reason: 'waiting' | 'locked';
|
|
6
|
+
held: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function vaultHold(state: VaultState | undefined): VaultHold | null;
|
|
9
|
+
export declare function listedLine(names: readonly SecretName[]): string;
|
package/dist/types/services.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { FrozenCone } from './freezer/index.ts';
|
|
|
5
5
|
import type { MemoryEntry, MemoryScope, MemoryTag } from './memory/format.ts';
|
|
6
6
|
import type { AgentRemote } from './remote/host.ts';
|
|
7
7
|
import type { AgentPages } from './remote/pages.ts';
|
|
8
|
+
import type { VaultState } from './secrets/vault.ts';
|
|
8
9
|
import type { Sprinkle } from './sprinkles/kind.ts';
|
|
9
10
|
export type SendMode = 'steer' | 'followUp' | 'reject';
|
|
10
11
|
export interface SendRequest {
|
|
@@ -222,11 +223,12 @@ export interface AgentTranscript {
|
|
|
222
223
|
readonly frozen: ReplicatedState<FrozenCone[]>;
|
|
223
224
|
readonly changes: ReplicatedState<ChangesView>;
|
|
224
225
|
readonly monitor: ReplicatedState<MonitorFeed>;
|
|
226
|
+
readonly vault: ReplicatedState<VaultState>;
|
|
225
227
|
}
|
|
226
228
|
export interface Command {
|
|
227
229
|
name: string;
|
|
228
230
|
description: string;
|
|
229
|
-
kind: 'prompt' | 'skill';
|
|
231
|
+
kind: 'prompt' | 'skill' | 'action';
|
|
230
232
|
}
|
|
231
233
|
export declare const AgentTranscript: import("@earendil-works/chord").Service<AgentTranscript>;
|
|
232
234
|
export interface AgentSessions {
|
|
@@ -41,5 +41,6 @@ export declare function problemLick(problem: Diagnostic, home: string): {
|
|
|
41
41
|
severity: 'warn';
|
|
42
42
|
eventId: string;
|
|
43
43
|
};
|
|
44
|
+
export declare const SECRETS_ACTION: Command;
|
|
44
45
|
export declare function commandsOf(skills: readonly Skill[], templates: readonly PromptTemplate[]): Command[];
|
|
45
46
|
export declare function setupSkills(registry: Registry, licks: Licks): SkillsSetup;
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import type { Agent, AgentEvents, AgentPort, FrozenCone, Message, Outgoing, SlashCommand, Thinking, UserMessage } from '@ai-ecoverse/slicc-spectrum/ui';
|
|
2
2
|
import type { AgentConnection } from '../client.ts';
|
|
3
|
+
import { type VaultHold } from '../secrets/view.ts';
|
|
4
|
+
import type { Command } from '../services.ts';
|
|
3
5
|
import { Emitter } from './emitter.ts';
|
|
4
6
|
export declare const CONE = "cone";
|
|
5
|
-
export declare
|
|
7
|
+
export declare function slashCommand({ kind, ...command }: Command): SlashCommand;
|
|
8
|
+
export type AgentHold = VaultHold;
|
|
9
|
+
export type AgentAdapterEvents = AgentEvents & {
|
|
10
|
+
hold: AgentHold | null;
|
|
11
|
+
};
|
|
12
|
+
export declare class AgentAdapter extends Emitter<AgentAdapterEvents> implements AgentPort {
|
|
6
13
|
#private;
|
|
7
14
|
constructor(connection: AgentConnection);
|
|
8
15
|
ready(): Promise<void>;
|
|
16
|
+
hold(): AgentHold | null;
|
|
9
17
|
list(): readonly Agent[];
|
|
10
18
|
active(): string;
|
|
11
19
|
select(id: string): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-agent",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.45.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",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@ai-ecoverse/slicc-kernel": "1.47.1",
|
|
65
|
-
"@ai-ecoverse/slicc-shared-web": "1.13.
|
|
66
|
-
"@ai-ecoverse/slicc-spectrum": "1.
|
|
65
|
+
"@ai-ecoverse/slicc-shared-web": "1.13.1",
|
|
66
|
+
"@ai-ecoverse/slicc-spectrum": "1.62.0",
|
|
67
67
|
"@ai-ecoverse/wasm-bash": "5.3.0-17",
|
|
68
68
|
"@ai-ecoverse/wasm-coreutils": "9.12.0-5",
|
|
69
69
|
"@ai-ecoverse/wasm-git": "2.55.0-15",
|