@ai-ecoverse/slicc-agent 7.14.0 → 7.14.2
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 +5 -4
- package/dist/approvals/index.js +27 -16
- package/dist/approvals/index.js.map +2 -2
- package/dist/approvals/judge.js +4 -0
- package/dist/approvals/judge.js.map +2 -2
- package/dist/approvals/present.js +24 -0
- package/dist/approvals/present.js.map +7 -0
- package/dist/approvals/sudo-client.js +14 -1
- package/dist/approvals/sudo-client.js.map +2 -2
- package/dist/approvals/sudo.js.map +2 -2
- package/dist/codemode/index.js +3 -1
- package/dist/codemode/index.js.map +2 -2
- package/dist/host.js +21 -5
- package/dist/host.js.map +2 -2
- package/dist/index.js +4 -0
- package/dist/index.js.map +2 -2
- package/dist/owner.js.map +1 -1
- package/dist/page.js +2 -1
- package/dist/page.js.map +2 -2
- package/dist/spectrum/approvals-port.js +4 -2
- package/dist/spectrum/approvals-port.js.map +2 -2
- package/dist/types/approvals/index.d.ts +3 -1
- package/dist/types/approvals/judge.d.ts +2 -0
- package/dist/types/approvals/present.d.ts +13 -0
- package/dist/types/approvals/sudo-client.d.ts +4 -2
- package/dist/types/approvals/sudo.d.ts +5 -0
- package/dist/types/host.d.ts +19 -7
- package/dist/types/index.d.ts +2 -2
- package/dist/types/owner.d.ts +2 -2
- package/dist/types/page.d.ts +2 -2
- package/package.json +4 -4
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Context } from '@earendil-works/chord';
|
|
2
|
+
import type { IntentSources } from './intent.ts';
|
|
3
|
+
import type { Approval } from './record.ts';
|
|
4
|
+
export interface Attendance {
|
|
5
|
+
attend(): () => void;
|
|
6
|
+
attended(): boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function attendance(): Attendance;
|
|
9
|
+
export interface PresenceSources {
|
|
10
|
+
attended(): boolean;
|
|
11
|
+
agents: Pick<IntentSources['agents'], 'state'>;
|
|
12
|
+
}
|
|
13
|
+
export declare function ownerPresent(sources: PresenceSources): (item: Approval, _context: Context) => Promise<boolean>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type PortEndpoint } from '../wire.ts';
|
|
2
2
|
import type { Approval } from './record.ts';
|
|
3
|
-
import type { SudoAnswer, SudoRequest } from './sudo.ts';
|
|
3
|
+
import type { SudoAnswer, SudoReply, SudoRequest } from './sudo.ts';
|
|
4
4
|
export interface ApproveOptions {
|
|
5
5
|
signal?: AbortSignal;
|
|
6
6
|
where?: string;
|
|
@@ -8,5 +8,7 @@ export interface ApproveOptions {
|
|
|
8
8
|
export declare const UNAVAILABLE = "The agent can't take this sudo request.";
|
|
9
9
|
export declare const unavailable: (cause?: unknown) => Error;
|
|
10
10
|
export declare function answerOf(item: Approval | undefined): SudoAnswer | null;
|
|
11
|
+
export declare const JUDGE_DENIED = "sudo: denied by the approval judge";
|
|
12
|
+
export declare function replyOf(item: Approval | undefined): SudoReply | null;
|
|
11
13
|
export declare const WITHDRAW_MS = 5000;
|
|
12
|
-
export declare function askSudo(endpoint: PortEndpoint, request: SudoRequest, options?: ApproveOptions, stop?: AbortSignal): Promise<
|
|
14
|
+
export declare function askSudo(endpoint: PortEndpoint, request: SudoRequest, options?: ApproveOptions, stop?: AbortSignal): Promise<SudoReply>;
|
|
@@ -4,6 +4,11 @@ import type { Licks } from '../licks/licks.ts';
|
|
|
4
4
|
import type { Approvals } from './index.ts';
|
|
5
5
|
import { type Approval, type ApprovalRequester, type SudoDetail } from './record.ts';
|
|
6
6
|
export type SudoAnswer = 'once' | 'always' | 'deny';
|
|
7
|
+
export type SudoDenial = {
|
|
8
|
+
answer: 'deny';
|
|
9
|
+
message: string;
|
|
10
|
+
};
|
|
11
|
+
export type SudoReply = SudoAnswer | SudoDenial;
|
|
7
12
|
export interface SudoRequest {
|
|
8
13
|
id: string;
|
|
9
14
|
kind: 'sudo';
|
package/dist/types/host.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type Context, type Host, type Readable, type ReplicatedState } from '@earendil-works/chord';
|
|
2
2
|
import type { ConversationView } from '@earendil-works/pi-durable';
|
|
3
3
|
import type { Agent } from './agent.ts';
|
|
4
|
-
import { type ApprovalJudge, type Approvals, type Decider } from './approvals/index.ts';
|
|
4
|
+
import { type ApprovalJudge, type Approvals, type Attendance, type Decider } from './approvals/index.ts';
|
|
5
|
+
import { type ApprovalPolicies } from './approvals/policy.ts';
|
|
5
6
|
import { type AgentSudo } from './approvals/sudo.ts';
|
|
6
7
|
import type { ChangesRuntime } from './changes/index.ts';
|
|
7
8
|
import { type HostLicks, type HostScoops } from './control.ts';
|
|
@@ -54,7 +55,20 @@ export interface HostSecrets {
|
|
|
54
55
|
list(): SecretListing;
|
|
55
56
|
close?(): void;
|
|
56
57
|
}
|
|
57
|
-
|
|
58
|
+
type ApprovalOptions = {
|
|
59
|
+
approvals?: Approvals;
|
|
60
|
+
judge?: ApprovalJudge;
|
|
61
|
+
intent?: ScoopReviewHost['intent'];
|
|
62
|
+
approvalMs?: number;
|
|
63
|
+
};
|
|
64
|
+
export declare function approvalsOf(agent: Agent, policy: ApprovalPolicies, options: ApprovalOptions, context: Context): Promise<{
|
|
65
|
+
approvals: Approvals;
|
|
66
|
+
serving: {
|
|
67
|
+
decide: (by: Decider) => AgentControl['decide'];
|
|
68
|
+
owners: Attendance;
|
|
69
|
+
};
|
|
70
|
+
}>;
|
|
71
|
+
export type HostOptions = {
|
|
58
72
|
serverId?: string;
|
|
59
73
|
context?: Context;
|
|
60
74
|
settings?: AgentSettings;
|
|
@@ -73,11 +87,8 @@ export declare function hostAgent(agent: Agent, options?: {
|
|
|
73
87
|
uploads?: Uploads;
|
|
74
88
|
thumbnail?: Thumbnail;
|
|
75
89
|
labels?: LabelsRuntime;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
intent?: ScoopReviewHost['intent'];
|
|
79
|
-
approvalMs?: number;
|
|
80
|
-
}): Promise<AgentHost>;
|
|
90
|
+
} & ApprovalOptions;
|
|
91
|
+
export declare function hostAgent(agent: Agent, options?: HostOptions): Promise<AgentHost>;
|
|
81
92
|
interface Served {
|
|
82
93
|
trusted: AgentControl;
|
|
83
94
|
viewed: AgentControl;
|
|
@@ -93,6 +104,7 @@ interface Served {
|
|
|
93
104
|
dispose(): void;
|
|
94
105
|
} | undefined;
|
|
95
106
|
decide: (by: Decider) => AgentControl['decide'];
|
|
107
|
+
owners?: Attendance;
|
|
96
108
|
}
|
|
97
109
|
export declare const CLOSED_TO_GUESTS = "a guest seat has only its transcript and propose";
|
|
98
110
|
export declare const openToGuests: <F extends object>(factory: F) => F;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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, approvalJudge, attachApprovals, DEFAULT_POLICY, type DecidedBy, type Decider, JUDGE_ALLOW, JUDGE_DENY, JUDGE_KIND, JUDGE_MODEL, JUDGE_QUESTIONS, type Judgement, judgeModelOf, judgeSpender, judgeState, type OwnerIntent, ownerIntent, POLICY_FILE, REASONS, seedPolicy, VERDICT_REASONS, verdictOf, verdictRecorder, } from './approvals/index.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, JUDGE_DENY, JUDGE_KIND, JUDGE_MODEL, JUDGE_QUESTIONS, type Judgement, judgeModelOf, judgeSpender, judgeState, type OwnerIntent, ownerIntent, POLICY_FILE, REASONS, routed, 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
|
-
export type { AgentSudo, SudoAnswer, SudoRequest } from './approvals/sudo.ts';
|
|
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';
|
|
7
7
|
export { type AgentConnection, connectAgent } from './client.ts';
|
|
8
8
|
export type { Clock } from './clock.ts';
|
package/dist/types/owner.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SudoReply, SudoRequest } from './approvals/sudo.ts';
|
|
2
2
|
import { type ApproveOptions } from './approvals/sudo-client.ts';
|
|
3
3
|
import { type AgentConnection } from './client.ts';
|
|
4
4
|
import { type KernelSource } from './kernel/users.ts';
|
|
@@ -20,7 +20,7 @@ export interface PortOptions {
|
|
|
20
20
|
export interface AgentOwner {
|
|
21
21
|
connect(options?: PortOptions): Promise<AgentConnection>;
|
|
22
22
|
port(options?: PortOptions): Promise<PortEndpoint & Transferable>;
|
|
23
|
-
approve(request: SudoRequest, options?: ApproveOptions): Promise<
|
|
23
|
+
approve(request: SudoRequest, options?: ApproveOptions): Promise<SudoReply>;
|
|
24
24
|
restart(): Promise<void>;
|
|
25
25
|
release(): Promise<void>;
|
|
26
26
|
}
|
package/dist/types/page.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export type { SudoAnswer, SudoRequest } from './approvals/sudo.ts';
|
|
2
|
-
export { type ApproveOptions, UNAVAILABLE } from './approvals/sudo-client.ts';
|
|
1
|
+
export type { SudoAnswer, SudoDenial, SudoReply, SudoRequest } from './approvals/sudo.ts';
|
|
2
|
+
export { type ApproveOptions, JUDGE_DENIED, UNAVAILABLE } from './approvals/sudo-client.ts';
|
|
3
3
|
export { type AgentConnection, connectAgent } from './client.ts';
|
|
4
4
|
export { connectGuest, GUEST_ONLY, type GuestConnection, SEAT_REFUSED, } from './guests/client.ts';
|
|
5
5
|
export { type ByteSink, bridgePort, encodeFrame, FrameReader, type LinkEnd, linkEndpoint, MAX_FRAME, } from './link.ts';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-agent",
|
|
3
|
-
"version": "7.14.
|
|
3
|
+
"version": "7.14.2",
|
|
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",
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@ai-ecoverse/slicc-kernel": "1.171.0",
|
|
76
76
|
"@ai-ecoverse/slicc-scrub": "1.1.0",
|
|
77
|
-
"@ai-ecoverse/slicc-shared-web": "2.13.
|
|
78
|
-
"@ai-ecoverse/slicc-spectrum": "1.108.
|
|
79
|
-
"@ai-ecoverse/wasi-fnox": "1.
|
|
77
|
+
"@ai-ecoverse/slicc-shared-web": "2.13.10",
|
|
78
|
+
"@ai-ecoverse/slicc-spectrum": "1.108.4",
|
|
79
|
+
"@ai-ecoverse/wasi-fnox": "1.43.0-1",
|
|
80
80
|
"@ai-ecoverse/wasm-bash": "5.3.0-23",
|
|
81
81
|
"@ai-ecoverse/wasm-coreutils": "9.12.0-15",
|
|
82
82
|
"@ai-ecoverse/wasm-git": "2.55.0-22",
|