@leuduan/lagent 0.0.0-stage → 44.0.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/LICENSE +16 -0
- package/README.md +157 -2
- package/dist/chunks/2GCIWSOA.js +5 -0
- package/dist/chunks/2P47AHNK.js +7 -0
- package/dist/chunks/34KW6VNQ.js +1 -0
- package/dist/chunks/3UMZMPWW.js +1 -0
- package/dist/chunks/5IRF47YB.js +1 -0
- package/dist/chunks/6DRCKZ2C.js +1 -0
- package/dist/chunks/6FRNHMCV.js +1 -0
- package/dist/chunks/7LI64H5X.js +17 -0
- package/dist/chunks/7VAPNE3L.js +1 -0
- package/dist/chunks/ASSQZH3F.js +1 -0
- package/dist/chunks/B4FXK5ER.js +77 -0
- package/dist/chunks/BBCW2FZK.js +1 -0
- package/dist/chunks/BPRCULZH.js +1 -0
- package/dist/chunks/CANPZYTH.js +24 -0
- package/dist/chunks/CQEVREBT.js +1 -0
- package/dist/chunks/CUK7CGC7.js +1 -0
- package/dist/chunks/D4PQP5MA.js +3 -0
- package/dist/chunks/DDANMY45.js +3 -0
- package/dist/chunks/DDZ7YF26.js +1 -0
- package/dist/chunks/EMRB4KCN.js +6 -0
- package/dist/chunks/EPYQ5M3B.js +3 -0
- package/dist/chunks/FJLU4UH3.js +1 -0
- package/dist/chunks/G44LG6VL.js +1 -0
- package/dist/chunks/GGSVIIWJ.js +2 -0
- package/dist/chunks/HK6ZSONF.js +1 -0
- package/dist/chunks/IAAEP6VL.js +30 -0
- package/dist/chunks/JCTBX33H.js +36 -0
- package/dist/chunks/JFX2MXBA.js +4 -0
- package/dist/chunks/JFZZXVWD.js +15 -0
- package/dist/chunks/KUZCL2SH.js +1 -0
- package/dist/chunks/MHC6VPB4.js +7 -0
- package/dist/chunks/MMNNZCBO.js +5 -0
- package/dist/chunks/MNJ4SRF7.js +1 -0
- package/dist/chunks/N6IXG2VL.js +1 -0
- package/dist/chunks/OCBPT7KE.js +1 -0
- package/dist/chunks/OL5A6ITQ.js +1 -0
- package/dist/chunks/PUSUPTAT.js +1 -0
- package/dist/chunks/Q75FUN7D.js +2 -0
- package/dist/chunks/Q7S5LFGN.js +1 -0
- package/dist/chunks/RCIHV3KG.js +1 -0
- package/dist/chunks/S34ZA2R6.js +1 -0
- package/dist/chunks/SS3B5W34.js +12 -0
- package/dist/chunks/VYMT4TXD.js +1 -0
- package/dist/chunks/W57RW55W.js +1 -0
- package/dist/compositions/base.d.ts +11 -0
- package/dist/compositions/codex.d.ts +66 -0
- package/dist/compositions/codexPrompts.d.ts +56 -0
- package/dist/context.d.ts +109 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.js +1 -0
- package/dist/journal/catalog.d.ts +112 -0
- package/dist/journal/forkChain.d.ts +16 -0
- package/dist/journal/index.d.ts +15 -0
- package/dist/journal/journal.d.ts +475 -0
- package/dist/journal/projection.d.ts +87 -0
- package/dist/journal/store.d.ts +181 -0
- package/dist/llm/client.d.ts +135 -0
- package/dist/llm/content.d.ts +52 -0
- package/dist/llm/failure.d.ts +82 -0
- package/dist/llm/index.d.ts +22 -0
- package/dist/llm/index.js +1 -0
- package/dist/llm/primitives.d.ts +286 -0
- package/dist/llm/prompt.d.ts +21 -0
- package/dist/llm/provider.d.ts +74 -0
- package/dist/llm/readLedger.d.ts +24 -0
- package/dist/llm/request.d.ts +58 -0
- package/dist/loop/agent.d.ts +18 -0
- package/dist/loop/authorization.d.ts +41 -0
- package/dist/loop/auxiliary.d.ts +58 -0
- package/dist/loop/chunks.d.ts +27 -0
- package/dist/loop/completion.d.ts +17 -0
- package/dist/loop/errors.d.ts +139 -0
- package/dist/loop/hooks.d.ts +274 -0
- package/dist/loop/index.d.ts +16 -0
- package/dist/loop/runner.d.ts +134 -0
- package/dist/loop/runtime.d.ts +76 -0
- package/dist/loop/strategy.d.ts +80 -0
- package/dist/loop/surfacePrepare.d.ts +30 -0
- package/dist/loop/tool.d.ts +106 -0
- package/dist/loop/toolCalls.d.ts +35 -0
- package/dist/plugin.d.ts +50 -0
- package/dist/plugin.js +1 -0
- package/dist/plugins/agentsMd.d.ts +80 -0
- package/dist/plugins/agentsMd.js +1 -0
- package/dist/plugins/ask/index.d.ts +26 -0
- package/dist/plugins/ask/index.js +1 -0
- package/dist/plugins/ask/service.d.ts +125 -0
- package/dist/plugins/ask/tools.d.ts +9 -0
- package/dist/plugins/commands/index.d.ts +43 -0
- package/dist/plugins/commands/index.js +1 -0
- package/dist/plugins/commands/output.d.ts +115 -0
- package/dist/plugins/commands/record.d.ts +558 -0
- package/dist/plugins/commands/service.d.ts +321 -0
- package/dist/plugins/commands/shell.d.ts +25 -0
- package/dist/plugins/commands/tools.d.ts +10 -0
- package/dist/plugins/compaction/checkpoint.d.ts +94 -0
- package/dist/plugins/compaction/config.d.ts +133 -0
- package/dist/plugins/compaction/estimate.d.ts +37 -0
- package/dist/plugins/compaction/index.d.ts +87 -0
- package/dist/plugins/compaction/index.js +7 -0
- package/dist/plugins/compaction/planner.d.ts +207 -0
- package/dist/plugins/compaction/prune.d.ts +9 -0
- package/dist/plugins/compaction/record.d.ts +227 -0
- package/dist/plugins/compaction/segments.d.ts +23 -0
- package/dist/plugins/compaction/state.d.ts +68 -0
- package/dist/plugins/compaction/summarize.d.ts +13 -0
- package/dist/plugins/dateAndBranch.d.ts +47 -0
- package/dist/plugins/dateAndBranch.js +1 -0
- package/dist/plugins/delegations/answers.d.ts +39 -0
- package/dist/plugins/delegations/assignmentKey.d.ts +22 -0
- package/dist/plugins/delegations/cleanup.d.ts +161 -0
- package/dist/plugins/delegations/constraint.d.ts +76 -0
- package/dist/plugins/delegations/index.d.ts +39 -0
- package/dist/plugins/delegations/index.js +1 -0
- package/dist/plugins/delegations/notices.d.ts +261 -0
- package/dist/plugins/delegations/obligations.d.ts +210 -0
- package/dist/plugins/delegations/record.d.ts +633 -0
- package/dist/plugins/delegations/request.d.ts +384 -0
- package/dist/plugins/delegations/role.d.ts +30 -0
- package/dist/plugins/delegations/service.d.ts +563 -0
- package/dist/plugins/delegations/standing.d.ts +19 -0
- package/dist/plugins/delegations/stopCheck.d.ts +21 -0
- package/dist/plugins/delegations/tools.d.ts +71 -0
- package/dist/plugins/delegations/waitContracts.d.ts +118 -0
- package/dist/plugins/delegations/waitResolver.d.ts +116 -0
- package/dist/plugins/diagnostics/digest.d.ts +14 -0
- package/dist/plugins/diagnostics/index.d.ts +68 -0
- package/dist/plugins/diagnostics/index.js +1 -0
- package/dist/plugins/fileTools/config.d.ts +10 -0
- package/dist/plugins/fileTools/editFiles.d.ts +117 -0
- package/dist/plugins/fileTools/fsRead.d.ts +17 -0
- package/dist/plugins/fileTools/gitDiscovery.d.ts +9 -0
- package/dist/plugins/fileTools/index.d.ts +18 -0
- package/dist/plugins/fileTools/index.js +1 -0
- package/dist/plugins/fileTools/ripgrep.d.ts +20 -0
- package/dist/plugins/fileTools/textEdit.d.ts +67 -0
- package/dist/plugins/fileTools/tools.d.ts +6 -0
- package/dist/plugins/historyRecall/history.d.ts +9 -0
- package/dist/plugins/historyRecall/index.d.ts +31 -0
- package/dist/plugins/historyRecall/index.js +1 -0
- package/dist/plugins/historyRecall/render.d.ts +34 -0
- package/dist/plugins/historyRecall/tools.d.ts +4 -0
- package/dist/plugins/mcp/catalog.d.ts +36 -0
- package/dist/plugins/mcp/config.d.ts +63 -0
- package/dist/plugins/mcp/connection.d.ts +53 -0
- package/dist/plugins/mcp/errors.d.ts +32 -0
- package/dist/plugins/mcp/index.d.ts +33 -0
- package/dist/plugins/mcp/index.js +5 -0
- package/dist/plugins/mcp/mount.d.ts +98 -0
- package/dist/plugins/mcp/names.d.ts +25 -0
- package/dist/plugins/mcp/render.d.ts +29 -0
- package/dist/plugins/mcp/slots.d.ts +15 -0
- package/dist/plugins/mcp/stdio.d.ts +49 -0
- package/dist/plugins/mcp/tools.d.ts +41 -0
- package/dist/plugins/mcp/version.d.ts +2 -0
- package/dist/plugins/routeNotice.d.ts +22 -0
- package/dist/plugins/routeNotice.js +1 -0
- package/dist/plugins/sandbox/absent.d.ts +33 -0
- package/dist/plugins/sandbox/client.d.ts +39 -0
- package/dist/plugins/sandbox/files.d.ts +28 -0
- package/dist/plugins/sandbox/index.d.ts +52 -0
- package/dist/plugins/sandbox/index.js +4 -0
- package/dist/plugins/sandbox/mode.d.ts +57 -0
- package/dist/plugins/sandbox/policy.d.ts +163 -0
- package/dist/plugins/sandbox/protocol.d.ts +107 -0
- package/dist/plugins/sandbox/service.d.ts +153 -0
- package/dist/plugins/sandbox/worker.d.ts +12 -0
- package/dist/plugins/sandbox/worker.js +1 -0
- package/dist/plugins/schedules/index.d.ts +21 -0
- package/dist/plugins/schedules/index.js +5 -0
- package/dist/plugins/schedules/record.d.ts +396 -0
- package/dist/plugins/schedules/service.d.ts +120 -0
- package/dist/plugins/schedules/time.d.ts +26 -0
- package/dist/plugins/schedules/tools.d.ts +6 -0
- package/dist/plugins/skills/discovery.d.ts +83 -0
- package/dist/plugins/skills/index.d.ts +31 -0
- package/dist/plugins/skills/index.js +1 -0
- package/dist/plugins/skills/tools.d.ts +11 -0
- package/dist/plugins/subAgents/availableRoutes.d.ts +53 -0
- package/dist/plugins/subAgents/index.d.ts +67 -0
- package/dist/plugins/subAgents/index.js +1 -0
- package/dist/plugins/subAgents/tools.d.ts +67 -0
- package/dist/plugins/threadDirs.d.ts +36 -0
- package/dist/plugins/threadDirs.js +1 -0
- package/dist/plugins/toolPolicy/index.d.ts +61 -0
- package/dist/plugins/toolPolicy/index.js +1 -0
- package/dist/plugins/truncateToolOutput.d.ts +30 -0
- package/dist/plugins/truncateToolOutput.js +6 -0
- package/dist/plugins/usage/index.d.ts +26 -0
- package/dist/plugins/usage/index.js +1 -0
- package/dist/plugins/usage/tracker.d.ts +34 -0
- package/dist/plugins/verify/index.d.ts +27 -0
- package/dist/plugins/verify/index.js +6 -0
- package/dist/plugins/verify/judgement.d.ts +16 -0
- package/dist/plugins/verify/record.d.ts +382 -0
- package/dist/plugins/verify/service.d.ts +93 -0
- package/dist/plugins/verify/state.d.ts +58 -0
- package/dist/plugins/webTools/html.d.ts +23 -0
- package/dist/plugins/webTools/index.d.ts +34 -0
- package/dist/plugins/webTools/index.js +1 -0
- package/dist/plugins/webTools/network.d.ts +23 -0
- package/dist/plugins/webTools/web.d.ts +32 -0
- package/dist/plugins/workflows/assignment.d.ts +20 -0
- package/dist/plugins/workflows/cleanup.d.ts +38 -0
- package/dist/plugins/workflows/definition.d.ts +184 -0
- package/dist/plugins/workflows/entryPlan.d.ts +95 -0
- package/dist/plugins/workflows/hostBindings.d.ts +146 -0
- package/dist/plugins/workflows/index.d.ts +28 -0
- package/dist/plugins/workflows/index.js +11 -0
- package/dist/plugins/workflows/observations.d.ts +81 -0
- package/dist/plugins/workflows/participantModels.d.ts +28 -0
- package/dist/plugins/workflows/participants.d.ts +143 -0
- package/dist/plugins/workflows/policy.d.ts +112 -0
- package/dist/plugins/workflows/record.d.ts +2849 -0
- package/dist/plugins/workflows/routing.d.ts +116 -0
- package/dist/plugins/workflows/schema.d.ts +26 -0
- package/dist/plugins/workflows/service.d.ts +477 -0
- package/dist/plugins/workflows/state.d.ts +373 -0
- package/dist/plugins/workflows/stopCheck.d.ts +13 -0
- package/dist/plugins/workflows/tools.d.ts +13 -0
- package/dist/plugins/workflows/view.d.ts +103 -0
- package/dist/plugins/workflows/workStatus.d.ts +21 -0
- package/dist/plugins/workspaceNotice.d.ts +36 -0
- package/dist/plugins/workspaceNotice.js +1 -0
- package/dist/providers/anthropic.d.ts +178 -0
- package/dist/providers/anthropicMessages.d.ts +66 -0
- package/dist/providers/codex.d.ts +71 -0
- package/dist/providers/codexAuth.d.ts +116 -0
- package/dist/providers/deepseek.d.ts +59 -0
- package/dist/providers/failure.d.ts +23 -0
- package/dist/providers/gateway.d.ts +24 -0
- package/dist/providers/index.d.ts +18 -0
- package/dist/providers/index.js +6 -0
- package/dist/providers/openaiChat.d.ts +73 -0
- package/dist/providers/openaiResponses.d.ts +109 -0
- package/dist/providers/opencodeCopilot.d.ts +23 -0
- package/dist/providers/opencodeGo.d.ts +109 -0
- package/dist/providers/shared.d.ts +112 -0
- package/dist/providers/stream.d.ts +156 -0
- package/dist/records/index.d.ts +13 -0
- package/dist/records/index.js +1 -0
- package/dist/records/journal.d.ts +2968 -0
- package/dist/records/toolResult.d.ts +65 -0
- package/dist/services/agents.d.ts +62 -0
- package/dist/services/catalogContributions.d.ts +73 -0
- package/dist/services/confinement/files.d.ts +118 -0
- package/dist/services/confinement/service.d.ts +219 -0
- package/dist/services/core.d.ts +28 -0
- package/dist/services/extensionEvents.d.ts +181 -0
- package/dist/services/journal.d.ts +26 -0
- package/dist/services/llm.d.ts +82 -0
- package/dist/services/modes.d.ts +65 -0
- package/dist/services/plugins.d.ts +34 -0
- package/dist/services/presets/definition.d.ts +154 -0
- package/dist/services/presets/installations.d.ts +139 -0
- package/dist/services/prompts.d.ts +85 -0
- package/dist/services/threads/activation.d.ts +100 -0
- package/dist/services/threads/admission.d.ts +174 -0
- package/dist/services/threads/birth.d.ts +219 -0
- package/dist/services/threads/index.d.ts +14 -0
- package/dist/services/threads/runEvents.d.ts +79 -0
- package/dist/services/threads/runOwner.d.ts +368 -0
- package/dist/services/threads/service.d.ts +450 -0
- package/dist/services/threads/thread.d.ts +268 -0
- package/dist/services/threads/view.d.ts +93 -0
- package/dist/services/tools.d.ts +118 -0
- package/dist/state/birth.d.ts +62 -0
- package/dist/state/chain.d.ts +46 -0
- package/dist/state/confirmations.d.ts +64 -0
- package/dist/state/continuation.d.ts +167 -0
- package/dist/state/decide.d.ts +72 -0
- package/dist/state/dispatches.d.ts +54 -0
- package/dist/state/errors.d.ts +26 -0
- package/dist/state/forks.d.ts +61 -0
- package/dist/state/holds.d.ts +104 -0
- package/dist/state/inbox.d.ts +188 -0
- package/dist/state/index.d.ts +31 -0
- package/dist/state/inputs.d.ts +58 -0
- package/dist/state/installations.d.ts +28 -0
- package/dist/state/limits.d.ts +14 -0
- package/dist/state/prompt.d.ts +13 -0
- package/dist/state/recovery.d.ts +7 -0
- package/dist/state/replace.d.ts +33 -0
- package/dist/state/requests.d.ts +129 -0
- package/dist/state/route.d.ts +61 -0
- package/dist/state/summary.d.ts +16 -0
- package/dist/state/surface.d.ts +153 -0
- package/dist/state/surfaceRead.d.ts +20 -0
- package/dist/state/thread.d.ts +73 -0
- package/dist/state/turns.d.ts +87 -0
- package/dist/state/waits.d.ts +38 -0
- package/dist/state/wake.d.ts +32 -0
- package/dist/stores/durableObject.d.ts +23 -0
- package/dist/stores/durableObject.js +1 -0
- package/dist/stores/durableObjectConnection.d.ts +27 -0
- package/dist/stores/memory.d.ts +29 -0
- package/dist/stores/sql.d.ts +59 -0
- package/dist/stores/sqlite.d.ts +31 -0
- package/dist/stores/sqlite.js +1 -0
- package/dist/sys/environment.d.ts +42 -0
- package/dist/sys/git.d.ts +47 -0
- package/dist/sys/paths.d.ts +9 -0
- package/dist/sys/spawn.d.ts +186 -0
- package/dist/testing/clock.d.ts +17 -0
- package/dist/testing/fakeLlm.d.ts +76 -0
- package/dist/testing/fedLlm.d.ts +34 -0
- package/dist/testing/helpers.d.ts +362 -0
- package/dist/testing/index.d.ts +13 -0
- package/dist/testing/index.js +1 -0
- package/dist/testing/processes.d.ts +13 -0
- package/dist/testing/settlement.d.ts +6 -0
- package/dist/testing/tmpDirs.d.ts +17 -0
- package/dist/util/async.d.ts +8 -0
- package/dist/util/diff.d.ts +25 -0
- package/dist/util/dispatch.d.ts +8 -0
- package/dist/util/errors.d.ts +28 -0
- package/dist/util/foldState.d.ts +17 -0
- package/dist/util/freeze.d.ts +2 -0
- package/dist/util/ids.d.ts +2 -0
- package/dist/util/json.d.ts +37 -0
- package/dist/util/jsonSchema.d.ts +7 -0
- package/dist/util/log.d.ts +6 -0
- package/dist/util/retries.d.ts +25 -0
- package/dist/util/text.d.ts +21 -0
- package/dist/util/timers.d.ts +43 -0
- package/package.json +183 -3
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const VERIFY_PRESET = "verify";
|
|
3
|
+
/** Repair continuations per verification since person input or genuinely new assignment arming. */
|
|
4
|
+
export declare const VERIFY_REPAIRS = 2;
|
|
5
|
+
export type Verification = {
|
|
6
|
+
readonly command: string;
|
|
7
|
+
readonly cwd: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const notice: {
|
|
10
|
+
record: (value: {
|
|
11
|
+
command: string;
|
|
12
|
+
cwd: string;
|
|
13
|
+
}) => import("../../records/journal.js").ExtensionRecord;
|
|
14
|
+
parse: (value: {
|
|
15
|
+
command: string;
|
|
16
|
+
cwd: string;
|
|
17
|
+
}) => {
|
|
18
|
+
command: string;
|
|
19
|
+
cwd: string;
|
|
20
|
+
};
|
|
21
|
+
entry: (value: {
|
|
22
|
+
command: string;
|
|
23
|
+
cwd: string;
|
|
24
|
+
}, options: import("../../plugin.js").AppendOptions) => {
|
|
25
|
+
type: "ext";
|
|
26
|
+
data: {
|
|
27
|
+
plugin: string;
|
|
28
|
+
instance_id: string;
|
|
29
|
+
kind: string;
|
|
30
|
+
version: number;
|
|
31
|
+
data: z.core.util.JSONType;
|
|
32
|
+
};
|
|
33
|
+
options: import("../../plugin.js").AppendOptions;
|
|
34
|
+
};
|
|
35
|
+
append(journal: import("../../plugin.js").PluginJournal, value: {
|
|
36
|
+
command: string;
|
|
37
|
+
cwd: string;
|
|
38
|
+
}, options: import("../../plugin.js").AppendOptions): Promise<import("../../records/journal.js").JournalEvent<"ext">>;
|
|
39
|
+
read(event: import("../../records/journal.js").JournalEvent): {
|
|
40
|
+
command: string;
|
|
41
|
+
cwd: string;
|
|
42
|
+
} | undefined;
|
|
43
|
+
contribution(message: {
|
|
44
|
+
role?: import("../../records/journal.js").InputRole;
|
|
45
|
+
content: string | readonly import("../../llm/content.js").ContentPartInput[];
|
|
46
|
+
}, value: {
|
|
47
|
+
command: string;
|
|
48
|
+
cwd: string;
|
|
49
|
+
}, options?: {
|
|
50
|
+
sourceSeqs?: readonly import("../../records/journal.js").Seq[];
|
|
51
|
+
}): import("../../records/journal.js").StepContribution;
|
|
52
|
+
matchesSource(record: import("../../util/json.js").DeepReadonly<import("../../records/journal.js").ExtensionRecord>): boolean;
|
|
53
|
+
rejection(reason: string, value: {
|
|
54
|
+
command: string;
|
|
55
|
+
cwd: string;
|
|
56
|
+
}): {
|
|
57
|
+
decision: "reject";
|
|
58
|
+
reason: string;
|
|
59
|
+
source: import("../../records/journal.js").ExtensionRecord;
|
|
60
|
+
};
|
|
61
|
+
readContribution: (event: import("../../records/journal.js").JournalEvent) => {
|
|
62
|
+
command: string;
|
|
63
|
+
cwd: string;
|
|
64
|
+
} | undefined;
|
|
65
|
+
readSource: (source: import("../../util/json.js").DeepReadonly<import("../../records/journal.js").ExtensionRecord> | null) => {
|
|
66
|
+
command: string;
|
|
67
|
+
cwd: string;
|
|
68
|
+
} | undefined;
|
|
69
|
+
told: import("../../plugin.js").PluginProjection<import("../../services/extensionEvents.js").ToldNotices<{
|
|
70
|
+
command: string;
|
|
71
|
+
cwd: string;
|
|
72
|
+
}>>;
|
|
73
|
+
projection<State>(fold: {
|
|
74
|
+
key: string;
|
|
75
|
+
init(): State;
|
|
76
|
+
apply(state: State, value: {
|
|
77
|
+
command: string;
|
|
78
|
+
cwd: string;
|
|
79
|
+
}, event: import("../../records/journal.js").JournalEvent<"ext">): State;
|
|
80
|
+
onFork?: "inherit" | "reset";
|
|
81
|
+
}): import("../../plugin.js").PluginProjection<State>;
|
|
82
|
+
};
|
|
83
|
+
export declare const repair: {
|
|
84
|
+
record: (value: {
|
|
85
|
+
command: string;
|
|
86
|
+
cwd: string;
|
|
87
|
+
}) => import("../../records/journal.js").ExtensionRecord;
|
|
88
|
+
parse: (value: {
|
|
89
|
+
command: string;
|
|
90
|
+
cwd: string;
|
|
91
|
+
}) => {
|
|
92
|
+
command: string;
|
|
93
|
+
cwd: string;
|
|
94
|
+
};
|
|
95
|
+
entry: (value: {
|
|
96
|
+
command: string;
|
|
97
|
+
cwd: string;
|
|
98
|
+
}, options: import("../../plugin.js").AppendOptions) => {
|
|
99
|
+
type: "ext";
|
|
100
|
+
data: {
|
|
101
|
+
plugin: string;
|
|
102
|
+
instance_id: string;
|
|
103
|
+
kind: string;
|
|
104
|
+
version: number;
|
|
105
|
+
data: z.core.util.JSONType;
|
|
106
|
+
};
|
|
107
|
+
options: import("../../plugin.js").AppendOptions;
|
|
108
|
+
};
|
|
109
|
+
append(journal: import("../../plugin.js").PluginJournal, value: {
|
|
110
|
+
command: string;
|
|
111
|
+
cwd: string;
|
|
112
|
+
}, options: import("../../plugin.js").AppendOptions): Promise<import("../../records/journal.js").JournalEvent<"ext">>;
|
|
113
|
+
read(event: import("../../records/journal.js").JournalEvent): {
|
|
114
|
+
command: string;
|
|
115
|
+
cwd: string;
|
|
116
|
+
} | undefined;
|
|
117
|
+
contribution(message: {
|
|
118
|
+
role?: import("../../records/journal.js").InputRole;
|
|
119
|
+
content: string | readonly import("../../llm/content.js").ContentPartInput[];
|
|
120
|
+
}, value: {
|
|
121
|
+
command: string;
|
|
122
|
+
cwd: string;
|
|
123
|
+
}, options?: {
|
|
124
|
+
sourceSeqs?: readonly import("../../records/journal.js").Seq[];
|
|
125
|
+
}): import("../../records/journal.js").StepContribution;
|
|
126
|
+
matchesSource(record: import("../../util/json.js").DeepReadonly<import("../../records/journal.js").ExtensionRecord>): boolean;
|
|
127
|
+
rejection(reason: string, value: {
|
|
128
|
+
command: string;
|
|
129
|
+
cwd: string;
|
|
130
|
+
}): {
|
|
131
|
+
decision: "reject";
|
|
132
|
+
reason: string;
|
|
133
|
+
source: import("../../records/journal.js").ExtensionRecord;
|
|
134
|
+
};
|
|
135
|
+
readContribution: (event: import("../../records/journal.js").JournalEvent) => {
|
|
136
|
+
command: string;
|
|
137
|
+
cwd: string;
|
|
138
|
+
} | undefined;
|
|
139
|
+
readSource: (source: import("../../util/json.js").DeepReadonly<import("../../records/journal.js").ExtensionRecord> | null) => {
|
|
140
|
+
command: string;
|
|
141
|
+
cwd: string;
|
|
142
|
+
} | undefined;
|
|
143
|
+
told: import("../../plugin.js").PluginProjection<import("../../services/extensionEvents.js").ToldNotices<{
|
|
144
|
+
command: string;
|
|
145
|
+
cwd: string;
|
|
146
|
+
}>>;
|
|
147
|
+
projection<State>(fold: {
|
|
148
|
+
key: string;
|
|
149
|
+
init(): State;
|
|
150
|
+
apply(state: State, value: {
|
|
151
|
+
command: string;
|
|
152
|
+
cwd: string;
|
|
153
|
+
}, event: import("../../records/journal.js").JournalEvent<"ext">): State;
|
|
154
|
+
onFork?: "inherit" | "reset";
|
|
155
|
+
}): import("../../plugin.js").PluginProjection<State>;
|
|
156
|
+
};
|
|
157
|
+
export declare const rejected: {
|
|
158
|
+
record: (value: {
|
|
159
|
+
cause: "execution" | "denied" | "unverified";
|
|
160
|
+
command: string;
|
|
161
|
+
cwd: string;
|
|
162
|
+
}) => import("../../records/journal.js").ExtensionRecord;
|
|
163
|
+
parse: (value: {
|
|
164
|
+
cause: "execution" | "denied" | "unverified";
|
|
165
|
+
command: string;
|
|
166
|
+
cwd: string;
|
|
167
|
+
}) => {
|
|
168
|
+
cause: "execution" | "denied" | "unverified";
|
|
169
|
+
command: string;
|
|
170
|
+
cwd: string;
|
|
171
|
+
};
|
|
172
|
+
entry: (value: {
|
|
173
|
+
cause: "execution" | "denied" | "unverified";
|
|
174
|
+
command: string;
|
|
175
|
+
cwd: string;
|
|
176
|
+
}, options: import("../../plugin.js").AppendOptions) => {
|
|
177
|
+
type: "ext";
|
|
178
|
+
data: {
|
|
179
|
+
plugin: string;
|
|
180
|
+
instance_id: string;
|
|
181
|
+
kind: string;
|
|
182
|
+
version: number;
|
|
183
|
+
data: z.core.util.JSONType;
|
|
184
|
+
};
|
|
185
|
+
options: import("../../plugin.js").AppendOptions;
|
|
186
|
+
};
|
|
187
|
+
append(journal: import("../../plugin.js").PluginJournal, value: {
|
|
188
|
+
cause: "execution" | "denied" | "unverified";
|
|
189
|
+
command: string;
|
|
190
|
+
cwd: string;
|
|
191
|
+
}, options: import("../../plugin.js").AppendOptions): Promise<import("../../records/journal.js").JournalEvent<"ext">>;
|
|
192
|
+
read(event: import("../../records/journal.js").JournalEvent): {
|
|
193
|
+
cause: "execution" | "denied" | "unverified";
|
|
194
|
+
command: string;
|
|
195
|
+
cwd: string;
|
|
196
|
+
} | undefined;
|
|
197
|
+
contribution(message: {
|
|
198
|
+
role?: import("../../records/journal.js").InputRole;
|
|
199
|
+
content: string | readonly import("../../llm/content.js").ContentPartInput[];
|
|
200
|
+
}, value: {
|
|
201
|
+
cause: "execution" | "denied" | "unverified";
|
|
202
|
+
command: string;
|
|
203
|
+
cwd: string;
|
|
204
|
+
}, options?: {
|
|
205
|
+
sourceSeqs?: readonly import("../../records/journal.js").Seq[];
|
|
206
|
+
}): import("../../records/journal.js").StepContribution;
|
|
207
|
+
matchesSource(record: import("../../util/json.js").DeepReadonly<import("../../records/journal.js").ExtensionRecord>): boolean;
|
|
208
|
+
rejection(reason: string, value: {
|
|
209
|
+
cause: "execution" | "denied" | "unverified";
|
|
210
|
+
command: string;
|
|
211
|
+
cwd: string;
|
|
212
|
+
}): {
|
|
213
|
+
decision: "reject";
|
|
214
|
+
reason: string;
|
|
215
|
+
source: import("../../records/journal.js").ExtensionRecord;
|
|
216
|
+
};
|
|
217
|
+
readContribution: (event: import("../../records/journal.js").JournalEvent) => {
|
|
218
|
+
cause: "execution" | "denied" | "unverified";
|
|
219
|
+
command: string;
|
|
220
|
+
cwd: string;
|
|
221
|
+
} | undefined;
|
|
222
|
+
readSource: (source: import("../../util/json.js").DeepReadonly<import("../../records/journal.js").ExtensionRecord> | null) => {
|
|
223
|
+
cause: "execution" | "denied" | "unverified";
|
|
224
|
+
command: string;
|
|
225
|
+
cwd: string;
|
|
226
|
+
} | undefined;
|
|
227
|
+
told: import("../../plugin.js").PluginProjection<import("../../services/extensionEvents.js").ToldNotices<{
|
|
228
|
+
cause: "execution" | "denied" | "unverified";
|
|
229
|
+
command: string;
|
|
230
|
+
cwd: string;
|
|
231
|
+
}>>;
|
|
232
|
+
projection<State>(fold: {
|
|
233
|
+
key: string;
|
|
234
|
+
init(): State;
|
|
235
|
+
apply(state: State, value: {
|
|
236
|
+
cause: "execution" | "denied" | "unverified";
|
|
237
|
+
command: string;
|
|
238
|
+
cwd: string;
|
|
239
|
+
}, event: import("../../records/journal.js").JournalEvent<"ext">): State;
|
|
240
|
+
onFork?: "inherit" | "reset";
|
|
241
|
+
}): import("../../plugin.js").PluginProjection<State>;
|
|
242
|
+
};
|
|
243
|
+
/**
|
|
244
|
+
* A verification owed for one assignment, recorded on the thread serving it: the assignment's
|
|
245
|
+
* identity (its owner, id and participant generation, as an assignment origin names them), the
|
|
246
|
+
* input whose claim activates it, and the pinned verification. Its identity is the assignment's.
|
|
247
|
+
*/
|
|
248
|
+
declare const RequirementSchema: z.ZodObject<{
|
|
249
|
+
owner: z.ZodString;
|
|
250
|
+
assignment: z.ZodString;
|
|
251
|
+
generation: z.ZodNumber;
|
|
252
|
+
input: z.ZodString;
|
|
253
|
+
command: z.ZodString;
|
|
254
|
+
cwd: z.ZodString;
|
|
255
|
+
}, z.core.$strict>;
|
|
256
|
+
export type RequirementInput = z.input<typeof RequirementSchema>;
|
|
257
|
+
export type Requirement = z.output<typeof RequirementSchema>;
|
|
258
|
+
export declare const requirement: {
|
|
259
|
+
record: (value: {
|
|
260
|
+
owner: string;
|
|
261
|
+
assignment: string;
|
|
262
|
+
generation: number;
|
|
263
|
+
input: string;
|
|
264
|
+
command: string;
|
|
265
|
+
cwd: string;
|
|
266
|
+
}) => import("../../records/journal.js").ExtensionRecord;
|
|
267
|
+
parse: (value: {
|
|
268
|
+
owner: string;
|
|
269
|
+
assignment: string;
|
|
270
|
+
generation: number;
|
|
271
|
+
input: string;
|
|
272
|
+
command: string;
|
|
273
|
+
cwd: string;
|
|
274
|
+
}) => {
|
|
275
|
+
owner: string;
|
|
276
|
+
assignment: string;
|
|
277
|
+
generation: number;
|
|
278
|
+
input: string;
|
|
279
|
+
command: string;
|
|
280
|
+
cwd: string;
|
|
281
|
+
};
|
|
282
|
+
entry: (value: {
|
|
283
|
+
owner: string;
|
|
284
|
+
assignment: string;
|
|
285
|
+
generation: number;
|
|
286
|
+
input: string;
|
|
287
|
+
command: string;
|
|
288
|
+
cwd: string;
|
|
289
|
+
}, options: import("../../plugin.js").AppendOptions) => {
|
|
290
|
+
type: "ext";
|
|
291
|
+
data: {
|
|
292
|
+
plugin: string;
|
|
293
|
+
instance_id: string;
|
|
294
|
+
kind: string;
|
|
295
|
+
version: number;
|
|
296
|
+
data: z.core.util.JSONType;
|
|
297
|
+
};
|
|
298
|
+
options: import("../../plugin.js").AppendOptions;
|
|
299
|
+
};
|
|
300
|
+
append(journal: import("../../plugin.js").PluginJournal, value: {
|
|
301
|
+
owner: string;
|
|
302
|
+
assignment: string;
|
|
303
|
+
generation: number;
|
|
304
|
+
input: string;
|
|
305
|
+
command: string;
|
|
306
|
+
cwd: string;
|
|
307
|
+
}, options: import("../../plugin.js").AppendOptions): Promise<import("../../records/journal.js").JournalEvent<"ext">>;
|
|
308
|
+
read(event: import("../../records/journal.js").JournalEvent): {
|
|
309
|
+
owner: string;
|
|
310
|
+
assignment: string;
|
|
311
|
+
generation: number;
|
|
312
|
+
input: string;
|
|
313
|
+
command: string;
|
|
314
|
+
cwd: string;
|
|
315
|
+
} | undefined;
|
|
316
|
+
contribution(message: {
|
|
317
|
+
role?: import("../../records/journal.js").InputRole;
|
|
318
|
+
content: string | readonly import("../../llm/content.js").ContentPartInput[];
|
|
319
|
+
}, value: {
|
|
320
|
+
owner: string;
|
|
321
|
+
assignment: string;
|
|
322
|
+
generation: number;
|
|
323
|
+
input: string;
|
|
324
|
+
command: string;
|
|
325
|
+
cwd: string;
|
|
326
|
+
}, options?: {
|
|
327
|
+
sourceSeqs?: readonly import("../../records/journal.js").Seq[];
|
|
328
|
+
}): import("../../records/journal.js").StepContribution;
|
|
329
|
+
matchesSource(record: import("../../util/json.js").DeepReadonly<import("../../records/journal.js").ExtensionRecord>): boolean;
|
|
330
|
+
rejection(reason: string, value: {
|
|
331
|
+
owner: string;
|
|
332
|
+
assignment: string;
|
|
333
|
+
generation: number;
|
|
334
|
+
input: string;
|
|
335
|
+
command: string;
|
|
336
|
+
cwd: string;
|
|
337
|
+
}): {
|
|
338
|
+
decision: "reject";
|
|
339
|
+
reason: string;
|
|
340
|
+
source: import("../../records/journal.js").ExtensionRecord;
|
|
341
|
+
};
|
|
342
|
+
readContribution: (event: import("../../records/journal.js").JournalEvent) => {
|
|
343
|
+
owner: string;
|
|
344
|
+
assignment: string;
|
|
345
|
+
generation: number;
|
|
346
|
+
input: string;
|
|
347
|
+
command: string;
|
|
348
|
+
cwd: string;
|
|
349
|
+
} | undefined;
|
|
350
|
+
readSource: (source: import("../../util/json.js").DeepReadonly<import("../../records/journal.js").ExtensionRecord> | null) => {
|
|
351
|
+
owner: string;
|
|
352
|
+
assignment: string;
|
|
353
|
+
generation: number;
|
|
354
|
+
input: string;
|
|
355
|
+
command: string;
|
|
356
|
+
cwd: string;
|
|
357
|
+
} | undefined;
|
|
358
|
+
told: import("../../plugin.js").PluginProjection<import("../../services/extensionEvents.js").ToldNotices<{
|
|
359
|
+
owner: string;
|
|
360
|
+
assignment: string;
|
|
361
|
+
generation: number;
|
|
362
|
+
input: string;
|
|
363
|
+
command: string;
|
|
364
|
+
cwd: string;
|
|
365
|
+
}>>;
|
|
366
|
+
projection<State>(fold: {
|
|
367
|
+
key: string;
|
|
368
|
+
init(): State;
|
|
369
|
+
apply(state: State, value: {
|
|
370
|
+
owner: string;
|
|
371
|
+
assignment: string;
|
|
372
|
+
generation: number;
|
|
373
|
+
input: string;
|
|
374
|
+
command: string;
|
|
375
|
+
cwd: string;
|
|
376
|
+
}, event: import("../../records/journal.js").JournalEvent<"ext">): State;
|
|
377
|
+
onFork?: "inherit" | "reset";
|
|
378
|
+
}): import("../../plugin.js").PluginProjection<State>;
|
|
379
|
+
};
|
|
380
|
+
/** `value` validated as a requirement, its directory normalized as a placed run's is. */
|
|
381
|
+
export declare function requirementValue(value: RequirementInput): Requirement;
|
|
382
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { Service, type Context } from '@leuduan/cordis';
|
|
2
|
+
import { type WriteRows } from '../../state/index.js';
|
|
3
|
+
import { type Verification } from './record.js';
|
|
4
|
+
declare module '@leuduan/cordis' {
|
|
5
|
+
interface Context {
|
|
6
|
+
/** Verification: the gates and assignment requirements of every thread (optional plugin). */
|
|
7
|
+
verify: VerifyService;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The constraint owner a thread owing verification requires (`requires` in its creation, its own
|
|
12
|
+
* or a thread's above it by origin): while the `verify` service is not mounted, the thread is held
|
|
13
|
+
* `missing`, and a judgment made without this registration does not end its turn (core's fence on
|
|
14
|
+
* required registrations).
|
|
15
|
+
*/
|
|
16
|
+
export declare const VERIFY_OWNER = "lagent:verify";
|
|
17
|
+
/** The verification one assignment owes, as its owner records it with {@link VerifyService.owed}. */
|
|
18
|
+
export type OwedVerification = {
|
|
19
|
+
/** The owner that schedules the assignment, as an assignment origin names it. */
|
|
20
|
+
readonly owner: string;
|
|
21
|
+
/** The assignment's id. */
|
|
22
|
+
readonly assignment: string;
|
|
23
|
+
/** The participant generation serving it. */
|
|
24
|
+
readonly generation: number;
|
|
25
|
+
/** The input whose claim activates the assignment, which arms the requirement. */
|
|
26
|
+
readonly inputId: string;
|
|
27
|
+
/** The pinned command runtime executes when completion needs proof. */
|
|
28
|
+
readonly command: string;
|
|
29
|
+
/** The absolute directory it must run in. */
|
|
30
|
+
readonly cwd: string;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Verification, the one judge of every thread's answers on it. Two things put a verification in
|
|
34
|
+
* force on a thread: a gate the verify preset mounts there ({@link gate}), which demands a pass
|
|
35
|
+
* after the last change; and the requirement an owner recorded for the assignment the thread
|
|
36
|
+
* serves ({@link owed}), armed when the assignment's input is claimed, which demands a pass after
|
|
37
|
+
* both its arming and the last change, whether or not the thread changed anything. A gate and a
|
|
38
|
+
* requirement on one verification are judged once, together; a later requirement supersedes an
|
|
39
|
+
* earlier one, as does a delegation task opened on the thread after it armed, and replaying one
|
|
40
|
+
* renews no repair allowance. Core executes its pure preparation plans through current policy;
|
|
41
|
+
* ordinary model commands never establish proof.
|
|
42
|
+
*
|
|
43
|
+
* Each verification covers the thread's delegated work too: a change any thread its calls started
|
|
44
|
+
* made, at any depth, its passing runs of the same verification included, needs a pass after it, read from that thread's facts when it is loaded and
|
|
45
|
+
* otherwise from the catalog, which the service contributes every thread's changes to.
|
|
46
|
+
*
|
|
47
|
+
* It registers {@link VERIFY_OWNER}: a thread owing verification requires it, so while the service
|
|
48
|
+
* is not mounted the thread is held rather than its answer accepted unchecked.
|
|
49
|
+
*/
|
|
50
|
+
export declare class VerifyService extends Service {
|
|
51
|
+
static inject: string[];
|
|
52
|
+
/** The gates mounted now, by thread: each mount's verification. */
|
|
53
|
+
private readonly gates;
|
|
54
|
+
constructor(ctx: Context);
|
|
55
|
+
/**
|
|
56
|
+
* Puts `verification` in force on `threadId` until the returned function is called: what the
|
|
57
|
+
* verify preset's setup does for the thread it serves, for as long as it is mounted.
|
|
58
|
+
*/
|
|
59
|
+
gate(threadId: string, verification: Verification): () => void;
|
|
60
|
+
/**
|
|
61
|
+
* The rows recording `requirement` on the thread a write schedules its assignment on, for that
|
|
62
|
+
* write's `rows`. Decided inside the write, refused: unless the thread requires
|
|
63
|
+
* {@link VERIFY_OWNER}, by its own creation or a thread's above it by origin, so its run is held
|
|
64
|
+
* while this service is missing; when a verify preset installed on the thread, or a gate mounted
|
|
65
|
+
* there now, names another verification, which the two would demand in turn and never both pass;
|
|
66
|
+
* and for one recorded under the same assignment and generation differently. None for one
|
|
67
|
+
* recorded already exactly so: a replay renews nothing.
|
|
68
|
+
*/
|
|
69
|
+
owed(requirement: OwedVerification): WriteRows;
|
|
70
|
+
/**
|
|
71
|
+
* The thread's say on its answer: every verification in force on it, each judged once, a gate's
|
|
72
|
+
* on the same verification as the requirement judged with the requirement's arming. Any rejection
|
|
73
|
+
* wins, then the first continuation. It declares what the say rests on (`observed`) whichever it
|
|
74
|
+
* is, an abstention too, so a change while another check awaited sends the answer to be judged again.
|
|
75
|
+
*/
|
|
76
|
+
private judge;
|
|
77
|
+
/**
|
|
78
|
+
* What a verdict on the thread rests on, as one token: each verification in force with its arming
|
|
79
|
+
* and what its judgment reads of the thread's facts, and the last change of its delegated work.
|
|
80
|
+
*/
|
|
81
|
+
private observed;
|
|
82
|
+
/** The same call-origin ownership scope as delegated mutation coverage, with affirmative cleanup evidence. */
|
|
83
|
+
private work;
|
|
84
|
+
/**
|
|
85
|
+
* The verifications in force on the thread, by {@link commandKey}, each with the moment its
|
|
86
|
+
* requirement armed (`null` for a gate alone), and its delegated work's last change.
|
|
87
|
+
*/
|
|
88
|
+
private reading;
|
|
89
|
+
/** The verifications the thread is configured with: its installed verify presets, and the gates mounted on it now. */
|
|
90
|
+
private inPlace;
|
|
91
|
+
/** Whether the thread, or one above it by origin, requires {@link VERIFY_OWNER}; its opening when the write opens it. */
|
|
92
|
+
private required;
|
|
93
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type PluginJournal } from '../../journal/index.js';
|
|
2
|
+
import { type Refusal } from '../../state/index.js';
|
|
3
|
+
import type { Seq } from '../../records/journal.js';
|
|
4
|
+
import type { ToolResult } from '../../records/toolResult.js';
|
|
5
|
+
import { type Verification, type Requirement, requirement } from './record.js';
|
|
6
|
+
export declare const commandKey: (command: string, cwd: string) => string;
|
|
7
|
+
type Attempt = {
|
|
8
|
+
seq: Seq;
|
|
9
|
+
candidate: Seq;
|
|
10
|
+
key: string;
|
|
11
|
+
verification: Verification;
|
|
12
|
+
authorizedAt: Seq | null;
|
|
13
|
+
resultAt: Seq | null;
|
|
14
|
+
result: ToolResult | null;
|
|
15
|
+
};
|
|
16
|
+
export type VerifyFacts = {
|
|
17
|
+
calls: Map<string, Seq | null>;
|
|
18
|
+
changedAt: Seq | null;
|
|
19
|
+
personAt: Seq | null;
|
|
20
|
+
repairs: Map<string, Seq[]>;
|
|
21
|
+
attempts: Map<Seq, Attempt>;
|
|
22
|
+
};
|
|
23
|
+
export declare const later: (a: Seq | null, b: Seq | null) => Seq | null;
|
|
24
|
+
/** All ordinary commands are mutations; only durable runtime results can establish proof. */
|
|
25
|
+
export declare const verifyFacts: import("../../journal/projection.js").PluginProjection<VerifyFacts>;
|
|
26
|
+
export declare const changes: import("../../services/catalogContributions.js").ContributionDefinition<{
|
|
27
|
+
changed_at: number | null;
|
|
28
|
+
}>;
|
|
29
|
+
export type DelegatedChange = {
|
|
30
|
+
readonly at: Seq | null;
|
|
31
|
+
} | {
|
|
32
|
+
readonly unreadable: string;
|
|
33
|
+
};
|
|
34
|
+
/** Call-origin descendants belong to the caller; assignment-origin work is verified independently. */
|
|
35
|
+
export declare function workScope(journal: PluginJournal, threadId: string): Set<string>;
|
|
36
|
+
export declare function delegatedChange(journal: PluginJournal, threadId: string): DelegatedChange;
|
|
37
|
+
/**
|
|
38
|
+
* The rows recording `value` on `threadId`, decided inside its write: one row for a requirement
|
|
39
|
+
* not recorded yet; none for one recorded already exactly so (a replay renews nothing); a refusal
|
|
40
|
+
* for one recorded under its identity otherwise. A thread being opened has none recorded.
|
|
41
|
+
*/
|
|
42
|
+
export declare function requirementRows(journal: PluginJournal, threadId: string, opening: boolean, parsed: Requirement): ReturnType<typeof requirement.entry>[] | {
|
|
43
|
+
refuse: Refusal;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The requirement in force on a thread: the one armed last, with the moment it armed, the later of
|
|
47
|
+
* its input's claim and its own row (so one recorded after the claim arms at its row); `null` while
|
|
48
|
+
* none has armed. A participant serves one assignment at a time, so a later arming supersedes every
|
|
49
|
+
* earlier requirement: two of them, pinned to different commands, would otherwise each count the
|
|
50
|
+
* other's runs as changes and never both pass. A requirement lives for the assignment that armed it:
|
|
51
|
+
* a delegation task opened on the thread after it armed, a successor assignment owing no
|
|
52
|
+
* verification included, retires it. Row seqs are one journal's, so the two compare directly.
|
|
53
|
+
*/
|
|
54
|
+
export declare function inForce(journal: PluginJournal, threadId: string): {
|
|
55
|
+
verification: Verification;
|
|
56
|
+
at: Seq;
|
|
57
|
+
} | null;
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTML to readable plain text in one linear pass, with no DOM and no dependency.
|
|
3
|
+
*
|
|
4
|
+
* The text is the page's content region when it marks one — `<main>` or `role="main"`, else its
|
|
5
|
+
* only top-level `<article>` — and the whole document otherwise. What a reader would not read is
|
|
6
|
+
* dropped: scripts and styles, navigation, form controls, page banners, footers and sidebars outside
|
|
7
|
+
* the content, and hidden elements. Paragraphs, list items, table rows and preformatted text keep
|
|
8
|
+
* their shape.
|
|
9
|
+
*
|
|
10
|
+
* The parser is forgiving rather than spec-complete: a close tag pops back to its nearest open
|
|
11
|
+
* match, a few elements close an open sibling, and an element left open ends with its parent.
|
|
12
|
+
*/
|
|
13
|
+
export type HtmlLink = {
|
|
14
|
+
text: string;
|
|
15
|
+
href: string;
|
|
16
|
+
};
|
|
17
|
+
export type HtmlText = {
|
|
18
|
+
title: string | null;
|
|
19
|
+
text: string;
|
|
20
|
+
/** The links in `text`, in document order, with `href` as written. */
|
|
21
|
+
links: HtmlLink[];
|
|
22
|
+
};
|
|
23
|
+
export declare function htmlToText(html: string): HtmlText;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Plugin } from '@leuduan/cordis';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export type { WebSearchConfig } from './web.js';
|
|
4
|
+
/**
|
|
5
|
+
* What the web tools are configured with, all of it the host's choice: what `web_fetch` may reach
|
|
6
|
+
* (`privateNetwork`: `refuse` keeps it on the public internet) and the Codex login `web_search`
|
|
7
|
+
* searches through (`search`; with `null` there is no `web_search`).
|
|
8
|
+
*/
|
|
9
|
+
declare const WebToolsConfigSchema: z.ZodObject<{
|
|
10
|
+
privateNetwork: z.ZodEnum<{
|
|
11
|
+
allow: "allow";
|
|
12
|
+
refuse: "refuse";
|
|
13
|
+
}>;
|
|
14
|
+
search: z.ZodNullable<z.ZodObject<{
|
|
15
|
+
authPath: z.ZodString;
|
|
16
|
+
refreshTimeoutMs: z.ZodNumber;
|
|
17
|
+
model: z.ZodString;
|
|
18
|
+
maxOutputTokens: z.ZodNumber;
|
|
19
|
+
responseLength: z.ZodEnum<{
|
|
20
|
+
medium: "medium";
|
|
21
|
+
short: "short";
|
|
22
|
+
long: "long";
|
|
23
|
+
}>;
|
|
24
|
+
}, z.core.$strict>>;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
export type WebToolsConfig = z.input<typeof WebToolsConfigSchema>;
|
|
27
|
+
/** The tools that fetch and search the web; `web_search` only where the host configures `search`. */
|
|
28
|
+
export declare const WEB_TOOLS: readonly ["web_fetch", "web_search"];
|
|
29
|
+
/**
|
|
30
|
+
* Registers `web_fetch`, and `web_search` when `search` names a Codex login, for the life of the
|
|
31
|
+
* plugin. Neither touches the workspace: they reach the network under the policy configured here.
|
|
32
|
+
* The host names the private-network policy and the search login; there is no default for either.
|
|
33
|
+
*/
|
|
34
|
+
export declare const webTools: Plugin.Object<WebToolsConfig>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"../../chunks/SS3B5W34.js";import"../../chunks/Q75FUN7D.js";import"../../chunks/34KW6VNQ.js";import"../../chunks/JFX2MXBA.js";import"../../chunks/CUK7CGC7.js";import"../../chunks/BPRCULZH.js";import"../../chunks/FJLU4UH3.js";import"../../chunks/DDANMY45.js";import"../../chunks/BBCW2FZK.js";import"../../chunks/MMNNZCBO.js";import"../../chunks/G44LG6VL.js";import"../../chunks/D4PQP5MA.js";export{a as WEB_TOOLS,b as webTools};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { LookupAddress, LookupAllOptions } from 'node:dns';
|
|
2
|
+
import { type LookupFunction } from 'node:net';
|
|
3
|
+
/** What a refused address is, for the message that names it. */
|
|
4
|
+
type AddressKind = string;
|
|
5
|
+
/**
|
|
6
|
+
* Why an IP address is not on the public internet, or `null` when it is. A zone index (`%eth0`) is
|
|
7
|
+
* ignored; anything that is not an IP address is `null`, for the resolver to judge.
|
|
8
|
+
*/
|
|
9
|
+
export declare function privateAddressKind(address: string): AddressKind | null;
|
|
10
|
+
/** Refuses a fetch that would reach a private address, naming the host and what the address is. */
|
|
11
|
+
export declare class PrivateAddressError extends Error {
|
|
12
|
+
readonly name = "PrivateAddressError";
|
|
13
|
+
constructor(host: string, address: string, kind: AddressKind);
|
|
14
|
+
}
|
|
15
|
+
/** Resolves every address of a host, as `dns.lookup` does with `all: true`. */
|
|
16
|
+
export type ResolveAll = (hostname: string, options: LookupAllOptions, callback: (error: NodeJS.ErrnoException | null, addresses: LookupAddress[]) => void) => void;
|
|
17
|
+
/**
|
|
18
|
+
* A socket `lookup` that resolves every address of the host and refuses the connection when any of
|
|
19
|
+
* them is private, so a mixed answer cannot pick its way past the check. The socket connects to an
|
|
20
|
+
* address checked here; TLS still verifies the certificate against the host name.
|
|
21
|
+
*/
|
|
22
|
+
export declare const refusingLookup: (resolveAll: ResolveAll) => LookupFunction;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* What web_fetch may reach: `refuse` keeps it on the public internet, refusing a host that is, or
|
|
4
|
+
* resolves to, a loopback, link-local, private, unique-local, CGNAT, unspecified, multicast or
|
|
5
|
+
* reserved address, in any of its IPv6 forms; `allow` reaches whatever the host can.
|
|
6
|
+
*/
|
|
7
|
+
export type PrivateNetwork = 'allow' | 'refuse';
|
|
8
|
+
/** web_fetch, reaching what {@link PrivateNetwork} allows. */
|
|
9
|
+
export declare const webFetchTool: (privateNetwork: PrivateNetwork) => import("../../plugin.js").Tool;
|
|
10
|
+
/**
|
|
11
|
+
* What `web_search` runs on: the Codex login it searches through (`authPath`, with the refresh
|
|
12
|
+
* deadline every client of that login shares), the model the endpoint requires, and how much one
|
|
13
|
+
* search may return (`maxOutputTokens` bounds the text, `responseLength` the number of results).
|
|
14
|
+
*/
|
|
15
|
+
export declare const WebSearchConfigSchema: z.ZodObject<{
|
|
16
|
+
authPath: z.ZodString;
|
|
17
|
+
refreshTimeoutMs: z.ZodNumber;
|
|
18
|
+
model: z.ZodString;
|
|
19
|
+
maxOutputTokens: z.ZodNumber;
|
|
20
|
+
responseLength: z.ZodEnum<{
|
|
21
|
+
medium: "medium";
|
|
22
|
+
short: "short";
|
|
23
|
+
long: "long";
|
|
24
|
+
}>;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
export type WebSearchConfig = z.output<typeof WebSearchConfigSchema>;
|
|
27
|
+
/**
|
|
28
|
+
* web_search, through Codex's search endpoint over the Codex login. The server's text is returned as
|
|
29
|
+
* it is: each result's title and URL, its age and an excerpt. `results`, the same list as data, is
|
|
30
|
+
* kept for the host in `metadata`, opaque, and `null` when the server sent none.
|
|
31
|
+
*/
|
|
32
|
+
export declare const webSearchTool: (config: WebSearchConfig) => import("../../plugin.js").Tool;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Context } from '@leuduan/cordis';
|
|
2
|
+
import { type ResultDecision } from './state.js';
|
|
3
|
+
import { type Governance } from './policy.js';
|
|
4
|
+
/**
|
|
5
|
+
* Presents each instance to the threads working it at the model steps they take (§6 of the design),
|
|
6
|
+
* at rank 2, after the rank-1 notices of what is in force (sandbox, verification, permission mode):
|
|
7
|
+
* to its root, its assignment, with everything needed to work it, or the decision, block or cleanup
|
|
8
|
+
* it waits on; to an isolated participant's child, its own assignment. Contributed only when no
|
|
9
|
+
* notice the thread can still see says the same: at the step that claims the assignment's activation
|
|
10
|
+
* input, and again after compaction or a replacement took it away; a contribution never wakes the
|
|
11
|
+
* thread. An instance that ended is told so to its root once, and only while an earlier presentation
|
|
12
|
+
* that restricted it is still visible. Notice visibility decides what is told, never authority,
|
|
13
|
+
* which the activation's claim alone gives.
|
|
14
|
+
*/
|
|
15
|
+
export declare function presentAssignments(ctx: Context, governance: Governance): void;
|
|
16
|
+
/**
|
|
17
|
+
* A host decision on `step` as the model is told it, by a transition's notice or the attempt it
|
|
18
|
+
* opened: its verdict and option, and its feedback, defused, in a block of its own.
|
|
19
|
+
*/
|
|
20
|
+
export declare function toldDecision(step: string, decided: ResultDecision): string;
|