@ai-ecoverse/slicc-agent 7.16.1 → 7.18.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 +16 -14
- package/dist/approvals/aligned.js +7 -0
- package/dist/approvals/aligned.js.map +7 -0
- package/dist/approvals/index.js +88 -42
- package/dist/approvals/index.js.map +2 -2
- package/dist/approvals/intent.js +6 -2
- package/dist/approvals/intent.js.map +2 -2
- package/dist/approvals/judge.js +257 -83
- package/dist/approvals/judge.js.map +2 -2
- package/dist/approvals/present.js +1 -6
- package/dist/approvals/present.js.map +2 -2
- package/dist/approvals/record.js +19 -0
- package/dist/approvals/record.js.map +2 -2
- package/dist/approvals/sudo.js +19 -2
- package/dist/approvals/sudo.js.map +2 -2
- package/dist/index.js +2 -4
- package/dist/index.js.map +2 -2
- package/dist/spectrum/approvals-port.js +16 -1
- package/dist/spectrum/approvals-port.js.map +2 -2
- package/dist/titles/generate.js +19 -19
- package/dist/titles/generate.js.map +2 -2
- package/dist/types/approvals/aligned.d.ts +2 -0
- package/dist/types/approvals/intent.d.ts +4 -1
- package/dist/types/approvals/judge.d.ts +52 -25
- package/dist/types/approvals/present.d.ts +2 -2
- package/dist/types/approvals/record.d.ts +20 -3
- package/dist/types/approvals/sudo.d.ts +3 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/titles/generate.d.ts +5 -2
- package/package.json +4 -4
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { fits, JUDGE_ALLOW } from './aligned.ts';
|
|
2
|
+
export { fits, JUDGE_ALLOW };
|
|
1
3
|
export type ApprovalKind = 'guest-message' | 'guest-tool' | 'sudo';
|
|
2
4
|
export type ApprovalState = 'pending' | 'approved' | 'rejected' | 'unanswered' | 'withdrawn';
|
|
3
5
|
export type ApprovalTier = 'user' | 'agent' | 'cone' | `scoop:${string}`;
|
|
@@ -11,11 +13,16 @@ export type ApprovalRequester = {
|
|
|
11
13
|
where?: string;
|
|
12
14
|
device?: string;
|
|
13
15
|
};
|
|
16
|
+
export type ApprovalLevel = 1 | 2 | 3;
|
|
14
17
|
export type ApprovalVerdict = {
|
|
15
|
-
|
|
18
|
+
level?: ApprovalLevel;
|
|
19
|
+
routine?: number;
|
|
20
|
+
aligned?: number | boolean;
|
|
21
|
+
always?: boolean;
|
|
16
22
|
reason: string;
|
|
23
|
+
via?: 'classifier' | 'chat';
|
|
24
|
+
decision: 'allow' | 'deny' | 'unsure';
|
|
17
25
|
risk?: number;
|
|
18
|
-
aligned?: number;
|
|
19
26
|
model?: string;
|
|
20
27
|
};
|
|
21
28
|
export type ApprovalAttachment = {
|
|
@@ -33,11 +40,15 @@ export type GuestToolDetail = {
|
|
|
33
40
|
arguments?: string;
|
|
34
41
|
task?: number;
|
|
35
42
|
};
|
|
43
|
+
export type SudoStdin = 'tty' | 'none' | 'pipe' | 'file';
|
|
36
44
|
export type SudoDetail = {
|
|
37
45
|
command: string;
|
|
38
46
|
target?: string;
|
|
39
47
|
cwd?: string;
|
|
40
48
|
alwaysScope?: 'cwd';
|
|
49
|
+
stdin?: SudoStdin;
|
|
50
|
+
rootOnly?: Record<string, boolean>;
|
|
51
|
+
writable?: boolean;
|
|
41
52
|
};
|
|
42
53
|
type Base = {
|
|
43
54
|
id: string;
|
|
@@ -52,6 +63,8 @@ type Base = {
|
|
|
52
63
|
reviewer?: string;
|
|
53
64
|
reason?: string;
|
|
54
65
|
verdict?: ApprovalVerdict;
|
|
66
|
+
judging?: boolean;
|
|
67
|
+
verdictError?: string;
|
|
55
68
|
always: boolean;
|
|
56
69
|
createdAt: number;
|
|
57
70
|
expiresAt: number;
|
|
@@ -109,6 +122,11 @@ export declare function answerer(by: DecidedBy, item: Pick<Approval, 'tier' | 'r
|
|
|
109
122
|
export type SudoApprover = 'user' | 'agent';
|
|
110
123
|
export declare const sudoApprover: (value: unknown) => SudoApprover;
|
|
111
124
|
export declare const tierOf: (kind: ApprovalKind, tier: string, sudo: SudoApprover) => string;
|
|
125
|
+
export type Gate = 'person' | 'judge';
|
|
126
|
+
export type Routed = 'approve' | 'deny' | 'ask';
|
|
127
|
+
export declare const gateOf: (tier: string) => Gate;
|
|
128
|
+
export declare function route(verdict: ApprovalVerdict | undefined, requester: Pick<ApprovalRequester, 'kind'>, gate: Gate, present: boolean): Routed;
|
|
129
|
+
export declare function alwaysOffered(item: Approval): boolean;
|
|
112
130
|
export declare function gone(state: ApprovalState): string;
|
|
113
131
|
export declare function cleanReason(reason: unknown): string | undefined;
|
|
114
132
|
export declare function prune(items: Approval[], kept?: number): Approval[];
|
|
@@ -123,4 +141,3 @@ export type Ruling = {
|
|
|
123
141
|
answer?: 'once' | 'always';
|
|
124
142
|
};
|
|
125
143
|
export declare function ruled(item: Approval, answer: unknown, reason: unknown, by: DecidedBy, at: number): Ruling;
|
|
126
|
-
export {};
|
|
@@ -2,7 +2,7 @@ import type { Context, ReplicatedState } from '@earendil-works/chord';
|
|
|
2
2
|
import type { AgentsState } from '../agents.ts';
|
|
3
3
|
import type { Licks } from '../licks/licks.ts';
|
|
4
4
|
import type { Approvals } from './index.ts';
|
|
5
|
-
import { type Approval, type ApprovalRequester, type SudoDetail } from './record.ts';
|
|
5
|
+
import { type Approval, type ApprovalRequester, type SudoDetail, type SudoStdin } from './record.ts';
|
|
6
6
|
export type SudoAnswer = 'once' | 'always' | 'deny';
|
|
7
7
|
export type SudoDenial = {
|
|
8
8
|
answer: 'deny';
|
|
@@ -25,6 +25,8 @@ export interface SudoRequest {
|
|
|
25
25
|
createdAt?: number;
|
|
26
26
|
expiresAt: number;
|
|
27
27
|
always?: boolean;
|
|
28
|
+
stdin?: SudoStdin;
|
|
29
|
+
rootOnly?: Record<string, boolean>;
|
|
28
30
|
}
|
|
29
31
|
export type SudoAsked = {
|
|
30
32
|
id: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ADOBE, ADOBE_PROXY, type AdobeConfig, type AdobeModelInfo, adobeClassifiers, adobeConfig, adobeIdentity, adobeModel, adobeProvider, adobeUsage, type Budget, SESSION_HEADER, VERSION_HEADER, withAdobeIdentity, } from './adobe.ts';
|
|
2
2
|
export { type Agent, type AgentOptions, answerText, openAgent } from './agent.ts';
|
|
3
|
-
export { APPROVAL_MS, type Approval, type ApprovalAnswer, type ApprovalDecided, type ApprovalDraft, type ApprovalJudge, type ApprovalKind, type ApprovalRequester, type ApprovalState, type Approvals, ApprovalsDoc, type ApprovalTier, type ApprovalVerdict, ASK_MIN_MS, approvalJudge, attachApprovals, DEFAULT_POLICY, type DecidedBy, type Decider, JUDGE_ALLOW,
|
|
3
|
+
export { APPROVAL_MS, type Approval, type ApprovalAnswer, type ApprovalDecided, type ApprovalDraft, type ApprovalJudge, type ApprovalKind, type ApprovalRequester, type ApprovalState, type Approvals, ApprovalsDoc, type ApprovalTier, type ApprovalVerdict, ASK_MIN_MS, approvalJudge, attachApprovals, DEFAULT_POLICY, type DecidedBy, type Decider, JUDGE_ALLOW, JUDGE_KIND, JUDGE_MODEL, JUDGE_QUESTIONS, type Judgement, judgeModelOf, judgeSpender, judgeState, type OwnerIntent, ownerIntent, POLICY_FILE, REASONS, route, seedPolicy, VERDICT_REASONS, verdictOf, verdictRecorder, } from './approvals/index.ts';
|
|
4
4
|
export { type ApprovalPolicy, type ApprovalPolicyChange, type ApprovalPolicySet, DEFAULT_APPROVAL_POLICY, type SudoPolicy, } from './approvals/policy.ts';
|
|
5
5
|
export type { AgentSudo, SudoAnswer, SudoDenial, SudoReply, SudoRequest, } from './approvals/sudo.ts';
|
|
6
6
|
export { FILE_LIMIT, IMAGE_LIMIT, type SendAttachment, type ShownAttachment, splitUser, TOTAL_LIMIT, userParts, } from './attachments.ts';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Context } from '@earendil-works/chord';
|
|
2
|
-
import type { AssistantMessage } from '@earendil-works/pi-ai';
|
|
2
|
+
import type { Api, AssistantMessage, Model } from '@earendil-works/pi-ai';
|
|
3
3
|
import type { Models } from '@earendil-works/pi-ai/models';
|
|
4
4
|
import type { EntryRecord } from '@earendil-works/pi-durable';
|
|
5
5
|
import type { ExecutionEnv } from '@earendil-works/pi-durable/env';
|
|
@@ -10,13 +10,16 @@ export declare function titlesOn(text: string | undefined): boolean;
|
|
|
10
10
|
export declare function labelsOn(text: string | undefined): boolean;
|
|
11
11
|
export declare function settingsText(env: Pick<ExecutionEnv, 'readTextFile'>, home: string, dir?: string): (context: Context) => Promise<string | undefined>;
|
|
12
12
|
export declare function transcriptOf(entries: readonly EntryRecord[]): string;
|
|
13
|
-
export declare function scrubbed(raw: string): Promise<string>;
|
|
13
|
+
export declare function scrubbed(raw: string, limit?: number): Promise<string>;
|
|
14
14
|
export declare function scrubTranscript(entries: readonly EntryRecord[]): Promise<string>;
|
|
15
15
|
type Settings = (context: Context) => Promise<string | undefined>;
|
|
16
16
|
export type Asked = {
|
|
17
17
|
text: string;
|
|
18
18
|
answer: AssistantMessage;
|
|
19
19
|
};
|
|
20
|
+
export declare function completeText(models: Pick<Models, 'completeSimple'>, found: Model<Api>, text: string, max: number, options?: {
|
|
21
|
+
signal?: AbortSignal;
|
|
22
|
+
}): Promise<Asked | undefined>;
|
|
20
23
|
export declare function titler(models: Models, settings: Settings): (transcript: string, model: string, context: Context) => Promise<string | undefined>;
|
|
21
24
|
export declare function labeler(models: Models, settings: Settings): (transcript: string, model: string, context: Context, admit?: () => boolean) => Promise<Asked | undefined>;
|
|
22
25
|
export type Labeler = ReturnType<typeof labeler>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-agent",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.18.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",
|
|
@@ -73,10 +73,10 @@
|
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@ai-ecoverse/slicc-jsh": "0.64.0",
|
|
76
|
-
"@ai-ecoverse/slicc-kernel": "1.
|
|
76
|
+
"@ai-ecoverse/slicc-kernel": "1.174.0",
|
|
77
77
|
"@ai-ecoverse/slicc-scrub": "1.1.0",
|
|
78
78
|
"@ai-ecoverse/slicc-shared-web": "2.13.10",
|
|
79
|
-
"@ai-ecoverse/slicc-spectrum": "1.
|
|
79
|
+
"@ai-ecoverse/slicc-spectrum": "1.112.0",
|
|
80
80
|
"@ai-ecoverse/wasi-fnox": "1.43.0-1",
|
|
81
81
|
"@ai-ecoverse/wasm-bash": "5.3.0-23",
|
|
82
82
|
"@ai-ecoverse/wasm-coreutils": "9.12.0-15",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"esbuild": "0.28.2",
|
|
87
87
|
"fake-indexeddb": "6.2.6",
|
|
88
88
|
"lefthook": "2.2.2",
|
|
89
|
-
"monocart-coverage-reports": "3.
|
|
89
|
+
"monocart-coverage-reports": "3.2.0",
|
|
90
90
|
"playwright-core": "1.64.1",
|
|
91
91
|
"semantic-release": "25.0.9",
|
|
92
92
|
"slicc-agent-5": "npm:@ai-ecoverse/slicc-agent@5.10.1",
|