@ai-ecoverse/slicc-agent 7.35.0 → 7.36.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 +4 -1
- package/dist/approvals/record.js +2 -0
- package/dist/approvals/record.js.map +2 -2
- package/dist/approvals/verdict-shown.js +19 -0
- package/dist/approvals/verdict-shown.js.map +7 -0
- package/dist/host.js +10 -3
- package/dist/host.js.map +2 -2
- package/dist/page.js.map +2 -2
- package/dist/readonly.js +8 -1
- package/dist/readonly.js.map +2 -2
- package/dist/remote/approvals.js +27 -0
- package/dist/remote/approvals.js.map +7 -0
- package/dist/remote/client.js +39 -13
- package/dist/remote/client.js.map +2 -2
- package/dist/remote/decide.js +23 -0
- package/dist/remote/decide.js.map +7 -0
- package/dist/remote/host.js.map +2 -2
- package/dist/services.js +2 -1
- package/dist/services.js.map +2 -2
- package/dist/spectrum/approvals-port.js +1 -15
- package/dist/spectrum/approvals-port.js.map +2 -2
- package/dist/types/approvals/record.d.ts +1 -0
- package/dist/types/approvals/verdict-shown.d.ts +10 -0
- package/dist/types/host.d.ts +1 -1
- package/dist/types/page.d.ts +1 -1
- package/dist/types/readonly.d.ts +2 -1
- package/dist/types/remote/approvals.d.ts +27 -0
- package/dist/types/remote/client.d.ts +18 -1
- package/dist/types/remote/decide.d.ts +20 -0
- package/dist/types/remote/host.d.ts +3 -1
- package/dist/types/services.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Approval, ApprovalKind } from '../approvals/record.ts';
|
|
2
|
+
import type { AgentsSummary } from '../services.ts';
|
|
3
|
+
export interface LinkApproval {
|
|
4
|
+
id: string;
|
|
5
|
+
kind: ApprovalKind;
|
|
6
|
+
agentId?: string;
|
|
7
|
+
agentName?: string;
|
|
8
|
+
requester: {
|
|
9
|
+
kind: Approval['requester']['kind'];
|
|
10
|
+
name: string;
|
|
11
|
+
where?: string;
|
|
12
|
+
};
|
|
13
|
+
detail: Approval['detail'];
|
|
14
|
+
tier: string;
|
|
15
|
+
always: boolean;
|
|
16
|
+
stoppable: boolean;
|
|
17
|
+
verdict?: {
|
|
18
|
+
level?: 1 | 2 | 3;
|
|
19
|
+
aligned?: boolean;
|
|
20
|
+
reason: string;
|
|
21
|
+
};
|
|
22
|
+
judging?: boolean;
|
|
23
|
+
verdictError?: string;
|
|
24
|
+
createdAt: number;
|
|
25
|
+
expiresAt: number;
|
|
26
|
+
}
|
|
27
|
+
export declare function pendingApprovals(items: readonly Approval[] | undefined, agents: AgentsSummary | undefined): LinkApproval[];
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
import type { ApprovalDecision } from '../approvals/record.ts';
|
|
1
2
|
import type { SendAttachment } from '../attachments.ts';
|
|
2
3
|
import type { AgentConnection } from '../client.ts';
|
|
3
4
|
import type { Delivered, InventorySnapshot, SendMode } from '../services.ts';
|
|
5
|
+
import { type LinkApproval } from './approvals.ts';
|
|
4
6
|
import type { RemoteEvent } from './events.ts';
|
|
7
|
+
export type { LinkApproval } from './approvals.ts';
|
|
5
8
|
export type { RemoteEvent } from './events.ts';
|
|
6
9
|
export declare const POLL_MS = 25000;
|
|
7
10
|
export interface RemoteOptions {
|
|
8
11
|
agent?: () => string | null;
|
|
12
|
+
device?: string;
|
|
9
13
|
}
|
|
10
14
|
export interface RemoteControl {
|
|
11
15
|
prompt(request: {
|
|
@@ -46,5 +50,18 @@ export interface RemoteControl {
|
|
|
46
50
|
snapshot: InventorySnapshot;
|
|
47
51
|
events?: AsyncIterable<InventorySnapshot>;
|
|
48
52
|
}>;
|
|
53
|
+
approvals(request?: {
|
|
54
|
+
watch?: boolean;
|
|
55
|
+
}): Promise<{
|
|
56
|
+
approvals: LinkApproval[];
|
|
57
|
+
events?: AsyncIterable<LinkApproval[]>;
|
|
58
|
+
}>;
|
|
59
|
+
decide(request: {
|
|
60
|
+
id: string;
|
|
61
|
+
answer: ApprovalDecision;
|
|
62
|
+
reason?: string | null;
|
|
63
|
+
}): Promise<{
|
|
64
|
+
ok: true;
|
|
65
|
+
}>;
|
|
49
66
|
}
|
|
50
|
-
export declare function remoteControl(connection: Pick<AgentConnection, 'remote'> & Pick<Partial<AgentConnection>, 'inventory'>, options?: RemoteOptions): RemoteControl;
|
|
67
|
+
export declare function remoteControl(connection: Pick<AgentConnection, 'remote'> & Pick<Partial<AgentConnection>, 'inventory' | 'approvals' | 'agents' | 'readOnly'>, options?: RemoteOptions): RemoteControl;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Context } from '@earendil-works/chord';
|
|
2
|
+
import type { ApprovalDecided, Decider } from '../approvals/index.ts';
|
|
3
|
+
import { type ApprovalDecision } from '../approvals/record.ts';
|
|
4
|
+
export interface RemoteDecide {
|
|
5
|
+
id: string;
|
|
6
|
+
answer: string;
|
|
7
|
+
reason: string | null;
|
|
8
|
+
device: string | null;
|
|
9
|
+
}
|
|
10
|
+
export type RemoteDecided = {
|
|
11
|
+
ok: true;
|
|
12
|
+
} | {
|
|
13
|
+
ok: false;
|
|
14
|
+
code: 'EINVAL' | 'ENOENT' | 'EACCES' | 'EOPNOTSUPP';
|
|
15
|
+
message: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const BAD_ANSWER = "An answer is once, always, deny or stop.";
|
|
18
|
+
type Decide = (id: string, decision: ApprovalDecision, reason: string | null, context: Context) => Promise<ApprovalDecided>;
|
|
19
|
+
export declare function linkDecide(decide: (by: Decider) => Decide, linked: string | undefined): (request: RemoteDecide, context: Context) => Promise<RemoteDecided>;
|
|
20
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import { type Conversation, type EntryRecord, type Harness, type LiveState, type
|
|
|
3
3
|
import type { SendAttachment } from '../attachments.ts';
|
|
4
4
|
import { type VaultState } from '../secrets/vault.ts';
|
|
5
5
|
import type { Delivered, SendMode, SendRequest, SendResponse } from '../services.ts';
|
|
6
|
+
import type { RemoteDecide, RemoteDecided } from './decide.ts';
|
|
6
7
|
import { Mapper, type RemoteEvent } from './events.ts';
|
|
7
8
|
import { type RemoteHistory } from './history.ts';
|
|
8
9
|
export declare const VAULT_BACK = "the vault is answering again";
|
|
@@ -51,6 +52,7 @@ export interface AgentRemote {
|
|
|
51
52
|
abort(agentId: string | null, context: Context): Promise<{
|
|
52
53
|
aborted: boolean;
|
|
53
54
|
}>;
|
|
55
|
+
decide(request: RemoteDecide, context: Context): Promise<RemoteDecided>;
|
|
54
56
|
}
|
|
55
57
|
export interface RemoteHost {
|
|
56
58
|
harness: Harness;
|
|
@@ -77,6 +79,6 @@ export declare class Follower {
|
|
|
77
79
|
drain(): RemoteEvent[];
|
|
78
80
|
take(entries: readonly EntryRecord[], live: LiveState | undefined, record: SubmissionRecord | undefined): boolean;
|
|
79
81
|
}
|
|
80
|
-
export declare function createRemote(host: RemoteHost): AgentRemote & {
|
|
82
|
+
export declare function createRemote(host: RemoteHost): Omit<AgentRemote, 'decide'> & {
|
|
81
83
|
dispose(): Promise<void>;
|
|
82
84
|
};
|
package/dist/types/services.d.ts
CHANGED
|
@@ -327,7 +327,7 @@ export interface Command {
|
|
|
327
327
|
}
|
|
328
328
|
export declare const TRANSCRIPT_STATES: ("agents" | "approvalPolicy" | "approvalRunnable" | "approvals" | "changes" | "commands" | "deliveries" | "frozen" | "guests" | "importing" | "labels" | "memories" | "memoryScopes" | "monitor" | "privateRevision" | "sprinkles" | "state" | "vault" | "views")[];
|
|
329
329
|
export declare const AgentTranscript: RemoteContract;
|
|
330
|
-
export declare const REMOTE_METHODS: ("abort" | "close" | "history" | "next" | "prompt" | "watch")[];
|
|
330
|
+
export declare const REMOTE_METHODS: ("abort" | "close" | "decide" | "history" | "next" | "prompt" | "watch")[];
|
|
331
331
|
export declare const REMOTE_READS: readonly (keyof AgentRemote & string)[];
|
|
332
332
|
export interface GuestShown {
|
|
333
333
|
id: string;
|
package/package.json
CHANGED