@ai-ecoverse/slicc-agent 5.9.0 → 5.10.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/dist/agent.js +4 -0
- package/dist/agent.js.map +2 -2
- package/dist/approvals/index.js +14 -0
- package/dist/approvals/index.js.map +2 -2
- package/dist/approvals/record.js +14 -6
- package/dist/approvals/record.js.map +2 -2
- package/dist/guests/client.js +0 -2
- package/dist/guests/client.js.map +2 -2
- package/dist/guests/guard.js +19 -5
- package/dist/guests/guard.js.map +2 -2
- package/dist/guests/index.js +1 -2
- package/dist/guests/index.js.map +2 -2
- package/dist/guests/policy.js +2 -4
- package/dist/guests/policy.js.map +2 -2
- package/dist/guests/scoop.js +268 -0
- package/dist/guests/scoop.js.map +7 -0
- package/dist/host.js +13 -4
- package/dist/host.js.map +2 -2
- package/dist/main.js +8 -4
- package/dist/main.js.map +2 -2
- package/dist/scoops/cli.js +15 -0
- package/dist/scoops/cli.js.map +2 -2
- package/dist/types/agent.d.ts +2 -0
- package/dist/types/approvals/index.d.ts +5 -0
- package/dist/types/approvals/record.d.ts +8 -2
- package/dist/types/guests/guard.d.ts +8 -2
- package/dist/types/guests/policy.d.ts +0 -1
- package/dist/types/guests/scoop.d.ts +45 -0
- package/dist/types/host.d.ts +3 -0
- package/dist/types/main.d.ts +1 -0
- package/package.json +2 -2
|
@@ -25,16 +25,21 @@ export interface Approvals {
|
|
|
25
25
|
}, context: Context): Promise<Approval>;
|
|
26
26
|
decide(id: string, answer: unknown, reason: string | null, by: Decider, context: Context): Promise<ApprovalDecided>;
|
|
27
27
|
settled(id: string, context: Context): Promise<Approval>;
|
|
28
|
+
assign(id: string, reviewer: string, context: Context): Promise<Approval | undefined>;
|
|
28
29
|
withdraw(id: string, reason: string | null, context: Context): Promise<Approval | undefined>;
|
|
29
30
|
withdrawSeat(seat: string, context: Context): Promise<number>;
|
|
30
31
|
expire(id: string, context: Context): Promise<Approval | undefined>;
|
|
31
32
|
close(): void;
|
|
32
33
|
}
|
|
34
|
+
export interface ScoopRouter {
|
|
35
|
+
route(item: Approval): Promise<void>;
|
|
36
|
+
}
|
|
33
37
|
export interface ApprovalsAttach {
|
|
34
38
|
harness: Pick<Harness, 'commit' | 'documentState'>;
|
|
35
39
|
now?: () => number;
|
|
36
40
|
ttlMs?: number;
|
|
37
41
|
judge?: ApprovalJudge;
|
|
42
|
+
scoops?: ScoopRouter;
|
|
38
43
|
guestAlways?: (kind: ApprovalKind) => boolean;
|
|
39
44
|
sudoApprover?: () => unknown;
|
|
40
45
|
}
|
|
@@ -2,7 +2,7 @@ export type ApprovalKind = 'guest-message' | 'guest-tool' | 'sudo';
|
|
|
2
2
|
export type ApprovalState = 'pending' | 'approved' | 'rejected' | 'unanswered' | 'withdrawn';
|
|
3
3
|
export type ApprovalTier = 'user' | 'agent' | 'cone' | `scoop:${string}`;
|
|
4
4
|
export type ApprovalAnswer = 'once' | 'always' | 'deny';
|
|
5
|
-
export type DecidedBy = 'owner' | 'follower' | 'judge' | 'host'
|
|
5
|
+
export type DecidedBy = 'owner' | 'follower' | 'judge' | 'host' | `scoop:${string}`;
|
|
6
6
|
export type ApprovalRequester = {
|
|
7
7
|
kind: 'guest' | 'agent' | 'user';
|
|
8
8
|
name: string;
|
|
@@ -49,6 +49,7 @@ type Base = {
|
|
|
49
49
|
decidedBy: DecidedBy | null;
|
|
50
50
|
device?: string;
|
|
51
51
|
answer?: 'once' | 'always';
|
|
52
|
+
reviewer?: string;
|
|
52
53
|
reason?: string;
|
|
53
54
|
verdict?: ApprovalVerdict;
|
|
54
55
|
always: boolean;
|
|
@@ -93,13 +94,18 @@ export declare const REASONS: {
|
|
|
93
94
|
readonly revoked: 'revoked';
|
|
94
95
|
readonly aborted: 'aborted';
|
|
95
96
|
readonly disconnected: 'disconnected';
|
|
97
|
+
readonly noScoop: 'no-scoop';
|
|
98
|
+
readonly scoopStopped: 'scoop-stopped';
|
|
99
|
+
readonly scoopAsked: 'scoop-asked';
|
|
100
|
+
readonly scoopUndecided: 'scoop-undecided';
|
|
96
101
|
};
|
|
97
102
|
export declare const guestKind: (kind: ApprovalKind) => boolean;
|
|
103
|
+
export declare const scoopTier: (tier: unknown) => tier is `scoop:${string}`;
|
|
98
104
|
export declare function knownTier(tier: unknown): tier is ApprovalTier;
|
|
99
105
|
export declare function routable(kind: ApprovalKind, tier: ApprovalTier): boolean;
|
|
100
106
|
export declare function answerOf(value: unknown): ApprovalAnswer | null;
|
|
101
107
|
export declare const personal: (by: DecidedBy) => boolean;
|
|
102
|
-
export declare function answerer(by: DecidedBy,
|
|
108
|
+
export declare function answerer(by: DecidedBy, item: Pick<Approval, 'tier' | 'reviewer'>): boolean;
|
|
103
109
|
export type SudoApprover = 'user' | 'agent';
|
|
104
110
|
export declare const sudoApprover: (value: unknown) => SudoApprover;
|
|
105
111
|
export declare const tierOf: (kind: ApprovalKind, tier: string, sudo: SudoApprover) => string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { Context } from '@earendil-works/chord';
|
|
2
|
+
import { type Extension, type Harness, type SubmissionId } from '@earendil-works/pi-durable';
|
|
2
3
|
import type { Approval, Approvals } from '../approvals/index.ts';
|
|
3
4
|
import { type GuestPolicy } from './policy.ts';
|
|
5
|
+
import { type SeatRecord } from './seats.ts';
|
|
4
6
|
export declare const GUEST_GUARD = "slicc-guest-guard";
|
|
5
7
|
export declare const GUEST_REQUEST = "guest:";
|
|
6
8
|
export declare const GUEST_TOOL_MEMO = "slicc.guest-tool";
|
|
@@ -12,7 +14,6 @@ export declare const GATE_REASONS: {
|
|
|
12
14
|
readonly judged: 'The automatic check declined this tool call in a run a guest started';
|
|
13
15
|
readonly unanswered: 'Nobody approved this tool call in a run a guest started in time.';
|
|
14
16
|
readonly unroutable: "The cone can't review a tool call it is itself waiting on.";
|
|
15
|
-
readonly scoop: "This review isn't available yet.";
|
|
16
17
|
readonly withdrawn: 'The review of this tool call was withdrawn.';
|
|
17
18
|
};
|
|
18
19
|
export interface GateHost {
|
|
@@ -25,8 +26,13 @@ export interface GuestToolGate {
|
|
|
25
26
|
bind(host: GateHost): void;
|
|
26
27
|
}
|
|
27
28
|
type Held = Pick<Harness, 'submission' | 'commit' | 'waitForTask'>;
|
|
29
|
+
type Taint = {
|
|
30
|
+
seat: SeatRecord | null;
|
|
31
|
+
tier: string;
|
|
32
|
+
};
|
|
28
33
|
export declare function canonical(value: unknown): string;
|
|
29
34
|
export declare function summaryOf(args: Record<string, unknown>): string;
|
|
30
35
|
export declare function reasonOf(item: Approval): string;
|
|
36
|
+
export declare function taintsOf(inputs: readonly SubmissionId[], seats: Readonly<Record<string, SeatRecord>>, harness: Pick<Harness, 'submission'>, context: Context): Promise<Taint[]>;
|
|
31
37
|
export declare function guestToolGate(harness: () => Held | undefined): GuestToolGate;
|
|
32
38
|
export {};
|
|
@@ -13,7 +13,6 @@ export type GuestPolicy = {
|
|
|
13
13
|
export type GuestPolicyChange = Partial<GuestPolicy>;
|
|
14
14
|
export declare const GATE_KINDS: readonly GateKind[];
|
|
15
15
|
export declare const DEFAULT_GUEST_POLICY: GuestPolicy;
|
|
16
|
-
export declare const SCOOP_REVIEW_LATER = "This review isn't available yet.";
|
|
17
16
|
export declare const MAX_SEAT_DAYS = 365;
|
|
18
17
|
export declare const DAY_MS: number;
|
|
19
18
|
export declare const GUESTS_MANAGE_DENIED = "The owner's guest policy doesn't let guests manage guests.";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { Context } from '@earendil-works/chord';
|
|
2
|
+
import { type Extension, type Harness } from '@earendil-works/pi-durable';
|
|
3
|
+
import { type AgentsState, type ScoopRecord } from '../agents.ts';
|
|
4
|
+
import type { Approval, Approvals } from '../approvals/index.ts';
|
|
5
|
+
import { type OwnerIntent } from '../approvals/judge.ts';
|
|
6
|
+
export declare const SCOOP_DECIDE = "approval_decide";
|
|
7
|
+
export declare const SCOOP_APPROVALS = "slicc-scoop-approvals";
|
|
8
|
+
export declare const SCOOP_REVIEW_TASK = "slicc.scoop-approval";
|
|
9
|
+
export declare const SCOOP_REQUEST = "scoop-approval:";
|
|
10
|
+
export type ScoopReview = {
|
|
11
|
+
approval: string;
|
|
12
|
+
scoop: string;
|
|
13
|
+
name: string;
|
|
14
|
+
};
|
|
15
|
+
export declare const ScoopReviewDoc: import("@earendil-works/pi-durable").ConversationDocToken<ScoopReview>;
|
|
16
|
+
export declare const ScoopRoutesDoc: import("@earendil-works/pi-durable").SessionDocToken<{
|
|
17
|
+
routes: Record<string, number>;
|
|
18
|
+
}>;
|
|
19
|
+
export interface ScoopReviewHost {
|
|
20
|
+
approvals: Pick<Approvals, 'decide' | 'assign'>;
|
|
21
|
+
agents: {
|
|
22
|
+
state(): Readonly<AgentsState>;
|
|
23
|
+
};
|
|
24
|
+
harness: Pick<Harness, 'commit'>;
|
|
25
|
+
intent?: (item: Approval, context: Context) => Promise<OwnerIntent | null>;
|
|
26
|
+
nonce?: () => string;
|
|
27
|
+
}
|
|
28
|
+
export interface ScoopReviews {
|
|
29
|
+
readonly extension: Extension;
|
|
30
|
+
route(item: Approval): Promise<void>;
|
|
31
|
+
bind(host: ScoopReviewHost): void;
|
|
32
|
+
}
|
|
33
|
+
export type Reviewer = {
|
|
34
|
+
id: string;
|
|
35
|
+
record: ScoopRecord;
|
|
36
|
+
};
|
|
37
|
+
export declare function reviewerOf(state: Readonly<AgentsState>, agentId: string, tier: string): Reviewer | undefined;
|
|
38
|
+
export declare function askedOf(item: Approval, reviewer: Reviewer): boolean;
|
|
39
|
+
export declare function reviewersOf(harness: Pick<Harness, 'snapshot' | 'submission'>, state: Readonly<AgentsState>, cone: string, context: Context): Promise<string[]>;
|
|
40
|
+
export declare function reviewPrompt(item: Approval, name: string, seat: {
|
|
41
|
+
id: string;
|
|
42
|
+
label: string;
|
|
43
|
+
gates: object;
|
|
44
|
+
} | null, intent: OwnerIntent | null, nonce: string): string;
|
|
45
|
+
export declare function scoopReviews(): ScoopReviews;
|
package/dist/types/host.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { ChangesRuntime } from './changes/index.ts';
|
|
|
6
6
|
import { type HostLicks, type HostScoops } from './control.ts';
|
|
7
7
|
import type { FreezerRuntime } from './freezer/index.ts';
|
|
8
8
|
import { type Guests } from './guests/index.ts';
|
|
9
|
+
import type { ScoopReviewHost } from './guests/scoop.ts';
|
|
9
10
|
import type { UserClients } from './kernel/users.ts';
|
|
10
11
|
import type { McpRuntime } from './mcp/index.ts';
|
|
11
12
|
import type { MemoryRuntime } from './memory/index.ts';
|
|
@@ -67,6 +68,8 @@ export declare function hostAgent(agent: Agent, options?: {
|
|
|
67
68
|
labels?: LabelsRuntime;
|
|
68
69
|
approvals?: Approvals;
|
|
69
70
|
judge?: ApprovalJudge;
|
|
71
|
+
intent?: ScoopReviewHost['intent'];
|
|
72
|
+
approvalMs?: number;
|
|
70
73
|
}): Promise<AgentHost>;
|
|
71
74
|
interface Served {
|
|
72
75
|
trusted: AgentControl;
|
package/dist/types/main.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export interface AgentWorkerOptions {
|
|
|
31
31
|
catalog?: string;
|
|
32
32
|
users?: boolean;
|
|
33
33
|
mcpRedirect?: string;
|
|
34
|
+
approvalMs?: number;
|
|
34
35
|
}
|
|
35
36
|
export declare function usersOf(admin: MessagePort | undefined, wanted: boolean | undefined, attach: KernelAttach): UserClients | undefined;
|
|
36
37
|
export declare const STORE_DIR = "/.slicc";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-agent",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.10.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",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@ai-ecoverse/wasm-coreutils": "9.12.0-8",
|
|
72
72
|
"@ai-ecoverse/wasm-git": "2.55.0-15",
|
|
73
73
|
"@biomejs/biome": "2.5.15",
|
|
74
|
-
"@types/node": "24.19.
|
|
74
|
+
"@types/node": "24.19.2",
|
|
75
75
|
"esbuild": "0.28.2",
|
|
76
76
|
"fake-indexeddb": "6.2.5",
|
|
77
77
|
"lefthook": "2.2.1",
|