@oyasmi/pipiclaw 0.9.2-beta.6 → 0.9.3-beta.1
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.en.md +250 -0
- package/README.md +2 -0
- package/dist/agent/channel-runner.d.ts +43 -2
- package/dist/agent/channel-runner.js +135 -75
- package/dist/agent/job-manager.d.ts +76 -21
- package/dist/agent/job-manager.js +447 -63
- package/dist/agent/maintenance-context.js +4 -5
- package/dist/agent/prompt/manifest.d.ts +0 -2
- package/dist/agent/prompt/manifest.js +2 -3
- package/dist/agent/prompt/sections.js +3 -3
- package/dist/agent/session-events.js +4 -8
- package/dist/agent/turn-prompt.d.ts +7 -7
- package/dist/agent/turn-prompt.js +6 -9
- package/dist/agent/types.d.ts +12 -0
- package/dist/agent/types.js +1 -0
- package/dist/channel/channel-context.d.ts +13 -0
- package/dist/channel/channel-context.js +21 -1
- package/dist/commands/catalog.js +47 -20
- package/dist/memory/commands.d.ts +8 -0
- package/dist/memory/commands.js +113 -148
- package/dist/memory/index-budget.d.ts +27 -0
- package/dist/memory/index-budget.js +99 -0
- package/dist/memory/journal.d.ts +20 -0
- package/dist/memory/journal.js +78 -0
- package/dist/memory/lifecycle.d.ts +9 -15
- package/dist/memory/lifecycle.js +55 -145
- package/dist/memory/maintenance-gates.d.ts +13 -47
- package/dist/memory/maintenance-gates.js +13 -92
- package/dist/memory/maintenance-state.d.ts +10 -16
- package/dist/memory/maintenance-state.js +12 -59
- package/dist/memory/maintenance-tuning.d.ts +7 -27
- package/dist/memory/maintenance-tuning.js +11 -28
- package/dist/memory/migrate.d.ts +15 -0
- package/dist/memory/migrate.js +364 -0
- package/dist/memory/reflect-job.d.ts +43 -0
- package/dist/memory/reflect-job.js +117 -0
- package/dist/memory/reflect.d.ts +52 -0
- package/dist/memory/reflect.js +313 -0
- package/dist/memory/render.d.ts +14 -0
- package/dist/memory/render.js +28 -0
- package/dist/memory/review-log.d.ts +2 -1
- package/dist/memory/scheduler.d.ts +2 -3
- package/dist/memory/scheduler.js +14 -49
- package/dist/memory/search.d.ts +35 -0
- package/dist/memory/search.js +297 -0
- package/dist/memory/session-search.js +1 -1
- package/dist/memory/store.d.ts +108 -0
- package/dist/memory/store.js +418 -0
- package/dist/memory/task-digest.d.ts +2 -2
- package/dist/memory/task-digest.js +29 -36
- package/dist/memory/tombstones.d.ts +0 -11
- package/dist/memory/tombstones.js +6 -37
- package/dist/playbooks/agent-delegation.md +4 -2
- package/dist/playbooks/background-jobs.md +1 -1
- package/dist/playbooks/event-scheduling.md +6 -2
- package/dist/playbooks/memory-and-learning.md +18 -11
- package/dist/playbooks/outbound-media.md +1 -1
- package/dist/playbooks/runtime-orientation.md +9 -8
- package/dist/playbooks/task-loop.md +88 -0
- package/dist/runtime/bootstrap.d.ts +3 -3
- package/dist/runtime/bootstrap.js +66 -41
- package/dist/runtime/events.d.ts +9 -0
- package/dist/runtime/events.js +43 -4
- package/dist/runtime/task-commands.d.ts +14 -15
- package/dist/runtime/task-commands.js +249 -485
- package/dist/runtime/task-driver.d.ts +41 -29
- package/dist/runtime/task-driver.js +170 -317
- package/dist/runtime/task-migration.d.ts +34 -30
- package/dist/runtime/task-migration.js +229 -183
- package/dist/runtime/task-wake.d.ts +6 -3
- package/dist/runtime/task-wake.js +26 -19
- package/dist/settings.d.ts +0 -29
- package/dist/settings.js +12 -35
- package/dist/shared/markdown-sections.d.ts +0 -1
- package/dist/shared/markdown-sections.js +0 -3
- package/dist/subagents/discovery.d.ts +2 -2
- package/dist/subagents/discovery.js +21 -10
- package/dist/subagents/external/progress-tail.js +6 -1
- package/dist/subagents/external/run.js +1 -0
- package/dist/subagents/runs.d.ts +19 -2
- package/dist/subagents/runs.js +73 -4
- package/dist/subagents/tool.d.ts +10 -8
- package/dist/subagents/tool.js +55 -94
- package/dist/tasks/brief.d.ts +17 -0
- package/dist/tasks/brief.js +57 -0
- package/dist/tasks/budget.d.ts +26 -0
- package/dist/tasks/budget.js +59 -0
- package/dist/tasks/cycle.d.ts +48 -0
- package/dist/tasks/cycle.js +94 -0
- package/dist/tasks/frontmatter.d.ts +73 -0
- package/dist/tasks/frontmatter.js +175 -0
- package/dist/tasks/ledger.d.ts +66 -106
- package/dist/tasks/ledger.js +90 -546
- package/dist/tasks/log.d.ts +88 -0
- package/dist/tasks/log.js +97 -0
- package/dist/tasks/rounds.d.ts +43 -0
- package/dist/tasks/rounds.js +57 -0
- package/dist/tasks/session-path.d.ts +9 -0
- package/dist/tasks/session-path.js +16 -0
- package/dist/tasks/steer.d.ts +8 -0
- package/dist/tasks/steer.js +79 -0
- package/dist/tasks/store.d.ts +60 -35
- package/dist/tasks/store.js +166 -107
- package/dist/tasks/ticket.d.ts +102 -0
- package/dist/tasks/ticket.js +209 -0
- package/dist/tasks/verification.d.ts +16 -0
- package/dist/tasks/verification.js +40 -1
- package/dist/tools/index.d.ts +13 -4
- package/dist/tools/index.js +5 -10
- package/dist/tools/memory-manage.d.ts +6 -16
- package/dist/tools/memory-manage.js +108 -129
- package/dist/tools/presentation.js +2 -1
- package/dist/tools/registry.d.ts +11 -2
- package/dist/tools/registry.js +17 -6
- package/dist/tools/subagent-manage.d.ts +0 -9
- package/dist/tools/subagent-manage.js +8 -17
- package/dist/tools/task-manage/create.js +2 -2
- package/dist/tools/task-manage/lifecycle.d.ts +9 -4
- package/dist/tools/task-manage/lifecycle.js +139 -187
- package/dist/tools/task-manage/log-view.d.ts +8 -0
- package/dist/tools/task-manage/log-view.js +24 -0
- package/dist/tools/task-manage/schema.d.ts +38 -14
- package/dist/tools/task-manage/schema.js +46 -27
- package/dist/tools/task-manage/shared.d.ts +24 -31
- package/dist/tools/task-manage/shared.js +103 -141
- package/dist/tools/task-manage/step-end.d.ts +11 -0
- package/dist/tools/task-manage/step-end.js +136 -0
- package/dist/tools/task-manage/types.d.ts +23 -32
- package/dist/tools/task-manage.d.ts +4 -3
- package/dist/tools/task-manage.js +30 -15
- package/dist/tools/tool-details.d.ts +1 -1
- package/dist/tui/app.js +0 -2
- package/package.json +1 -1
- package/dist/agent/effect-ledger.d.ts +0 -32
- package/dist/agent/effect-ledger.js +0 -89
- package/dist/memory/bootstrap.d.ts +0 -17
- package/dist/memory/bootstrap.js +0 -120
- package/dist/memory/candidates.d.ts +0 -26
- package/dist/memory/candidates.js +0 -202
- package/dist/memory/consolidation.d.ts +0 -54
- package/dist/memory/consolidation.js +0 -292
- package/dist/memory/extraction.d.ts +0 -54
- package/dist/memory/extraction.js +0 -240
- package/dist/memory/files.d.ts +0 -71
- package/dist/memory/files.js +0 -419
- package/dist/memory/maintenance-jobs.d.ts +0 -41
- package/dist/memory/maintenance-jobs.js +0 -265
- package/dist/memory/metadata.d.ts +0 -57
- package/dist/memory/metadata.js +0 -142
- package/dist/memory/probation.d.ts +0 -17
- package/dist/memory/probation.js +0 -44
- package/dist/memory/promotion.d.ts +0 -38
- package/dist/memory/promotion.js +0 -36
- package/dist/memory/recall.d.ts +0 -59
- package/dist/memory/recall.js +0 -746
- package/dist/memory/session.d.ts +0 -24
- package/dist/memory/session.js +0 -273
- package/dist/playbooks/task-driving.md +0 -92
- package/dist/playbooks/task-planning.md +0 -58
- package/dist/tasks/control.d.ts +0 -56
- package/dist/tasks/control.js +0 -169
- package/dist/tasks/transitions.d.ts +0 -16
- package/dist/tasks/transitions.js +0 -48
- package/dist/tools/task-manage/verification.d.ts +0 -19
- package/dist/tools/task-manage/verification.js +0 -91
|
@@ -9,16 +9,11 @@ export interface TaskDriverOptions {
|
|
|
9
9
|
/** Optional observability hook. It runs after every production dispatch attempt. */
|
|
10
10
|
onDispatch?: (event: ChannelEvent, accepted: boolean) => void;
|
|
11
11
|
getSettings: () => PipiclawTaskDriverSettings;
|
|
12
|
-
/**
|
|
13
|
-
* Externally visible effects produced by this task's own turns so far (spec 031, D7).
|
|
14
|
-
* Defaults to a constant, which simply makes the fingerprint depend on ledger fields alone.
|
|
15
|
-
*/
|
|
16
|
-
getEffectCount?: (channelId: string, taskId: string) => number;
|
|
17
12
|
/** Master autonomy switch (`tools.tasks.enabled`); re-read every tick. Defaults to on. */
|
|
18
13
|
isEnabled?: () => boolean;
|
|
19
14
|
/** Test-only override for the idle-sleep cap; production uses `settings.maxSleepMinutes`. */
|
|
20
15
|
intervalMs?: number;
|
|
21
|
-
/** Direct, non-LLM receipt for deterministic
|
|
16
|
+
/** Direct, non-LLM receipt for deterministic runtime stops. */
|
|
22
17
|
notify?: (event: ChannelEvent) => boolean | Promise<boolean>;
|
|
23
18
|
}
|
|
24
19
|
/**
|
|
@@ -27,14 +22,26 @@ export interface TaskDriverOptions {
|
|
|
27
22
|
*/
|
|
28
23
|
export declare function discoverTaskChannels(workspaceDir: string, knownChannelIds?: Iterable<string>): Promise<string[]>;
|
|
29
24
|
export declare function createTaskDriverEvent(channelId: string, entry: TaskLedgerEntry, nowMs: number): ChannelEvent;
|
|
30
|
-
export declare function taskGovernorReceipt(channelId: string, entry: TaskLedgerEntry, reason: string, nowMs: number): ChannelEvent;
|
|
31
25
|
/**
|
|
32
|
-
*
|
|
26
|
+
* The deterministic receipt a runtime stop produces (spec 051, D11). It is delivered directly,
|
|
27
|
+
* without opening a model turn: the user needs to know their task stopped, and spending an LLM
|
|
28
|
+
* call to phrase that is exactly the kind of cost this design removes.
|
|
29
|
+
*/
|
|
30
|
+
export declare function taskStopReceipt(channelId: string, entry: TaskLedgerEntry, reason: string, nowMs: number): ChannelEvent;
|
|
31
|
+
/**
|
|
32
|
+
* Native, ticket-driven scheduler for the persistent task ledger (spec 051, D9).
|
|
33
33
|
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
34
|
+
* Four jobs, in this order per channel: redeem due `time`/`schedule` tickets, apply the backstop
|
|
35
|
+
* to expired ones, open cycles for recurring tasks, and queue one step for a runnable task.
|
|
36
|
+
* `run`/`job`/`ask`/`signal` tickets are never polled — their owners push them — so the scan
|
|
37
|
+
* stays a cheap read of a handful of frontmatters.
|
|
38
|
+
*
|
|
39
|
+
* What is deliberately *not* here any more: the ten-field ledger fingerprint, the process-local
|
|
40
|
+
* effect ledger, the futile-wake and wake-per-cycle counters, and the three-tier backoff table.
|
|
41
|
+
* They existed to guess whether a wake had accomplished anything; in production they fired twice
|
|
42
|
+
* in four months while the failure that actually happened — a task parked with no redeemable
|
|
43
|
+
* source, silent for 13 days — was invisible to all of them. Stopping is now the loop's own job
|
|
44
|
+
* (a budget it can see) and liveness is the ticket's (a backstop the runtime enforces).
|
|
38
45
|
*/
|
|
39
46
|
export declare class TaskDriver {
|
|
40
47
|
private readonly options;
|
|
@@ -43,16 +50,14 @@ export declare class TaskDriver {
|
|
|
43
50
|
private loopActive;
|
|
44
51
|
private running;
|
|
45
52
|
private nextChannelIndex;
|
|
46
|
-
/** Absolute ms of the next moment worth waking for
|
|
53
|
+
/** Absolute ms of the next moment worth waking for, recomputed each scan. */
|
|
47
54
|
private nextWakeMs;
|
|
48
|
-
|
|
55
|
+
/** Last dispatch time per task, so one in-flight step is not queued again on the next tick. */
|
|
56
|
+
private readonly lastDispatchMs;
|
|
49
57
|
/**
|
|
50
|
-
* Last task id dispatched per channel.
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* starving every other ready task (including its own unlocked dependents) in the same
|
|
54
|
-
* channel. Remembering the last pick and starting the search just after it gives ready
|
|
55
|
-
* candidates in a channel the same round-robin fairness across ticks.
|
|
58
|
+
* Last task id dispatched per channel. Starting the search just after it gives every ready
|
|
59
|
+
* task in a channel the same round-robin fairness an actively-progressing task would
|
|
60
|
+
* otherwise monopolise.
|
|
56
61
|
*/
|
|
57
62
|
private readonly lastDispatchedTaskId;
|
|
58
63
|
constructor(options: TaskDriverOptions);
|
|
@@ -60,22 +65,29 @@ export declare class TaskDriver {
|
|
|
60
65
|
start(): void;
|
|
61
66
|
stop(): void;
|
|
62
67
|
/**
|
|
63
|
-
* In-process wake: after a
|
|
64
|
-
*
|
|
65
|
-
*
|
|
68
|
+
* In-process wake: after a step ends or a task file is written, re-scan promptly instead of
|
|
69
|
+
* waiting out the current sleep. This is what makes `outcome: continue` cost nothing — the
|
|
70
|
+
* next step is queued on the same nudge rather than after a continuation delay.
|
|
66
71
|
*/
|
|
67
72
|
nudge(): void;
|
|
68
73
|
private tick;
|
|
69
74
|
private scheduleNext;
|
|
70
75
|
/** Fold `candidate` into the earliest interesting wake moment. */
|
|
71
76
|
private noteHorizon;
|
|
72
|
-
|
|
77
|
+
/** Stop one task and notify. Delivery failure is logged, never fatal: the durable stop already happened. */
|
|
78
|
+
private notifyStop;
|
|
79
|
+
/**
|
|
80
|
+
* Deterministic, zero-token maintenance for one channel: redeem due tickets, apply expiry
|
|
81
|
+
* backstops, open recurring cycles. Runs whether or not the channel is busy — only model
|
|
82
|
+
* dispatch is gated on an idle channel.
|
|
83
|
+
*/
|
|
84
|
+
private maintain;
|
|
73
85
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
86
|
+
* Stop a loop that is talking to itself: two consecutive steps that produced no tool call at
|
|
87
|
+
* all. This is the honest replacement for v3's futile-wake counter — the loop log records what
|
|
88
|
+
* each step actually did, so "no progress" is an observed fact rather than a fingerprint
|
|
89
|
+
* comparison a `echo x` could defeat.
|
|
78
90
|
*/
|
|
79
|
-
private
|
|
91
|
+
private detectIdleLoop;
|
|
80
92
|
runOnce(now?: Date): Promise<void>;
|
|
81
93
|
}
|