@oyasmi/pipiclaw 0.9.5-beta.2 → 0.9.5-beta.3
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 +9 -11
- package/README.md +9 -11
- package/dist/agent/channel-runner.d.ts +12 -24
- package/dist/agent/channel-runner.js +74 -30
- package/dist/agent/maintenance-context.d.ts +2 -0
- package/dist/agent/maintenance-context.js +15 -0
- package/dist/agent/prompt/sections.js +8 -6
- package/dist/agent/prompt/types.d.ts +1 -1
- package/dist/agent/runner-factory.js +1 -1
- package/dist/agent/session/command-extension.js +11 -0
- package/dist/agent/session/compaction-summary.js +6 -2
- package/dist/agent/session/execution-trace.d.ts +14 -0
- package/dist/agent/session/execution-trace.js +57 -0
- package/dist/agent/session/session-events.d.ts +2 -7
- package/dist/agent/session/session-events.js +35 -12
- package/dist/agent/session/session-host.d.ts +12 -22
- package/dist/agent/session/session-host.js +46 -65
- package/dist/agent/turn/task-digest.d.ts +1 -2
- package/dist/agent/turn/task-digest.js +33 -33
- package/dist/agent/turn/turn-context.d.ts +1 -1
- package/dist/agent/turn/turn-context.js +1 -1
- package/dist/agent/turn/turn-finish.d.ts +2 -2
- package/dist/agent/turn/turn-finish.js +3 -2
- package/dist/agent/turn/turn-pipeline.d.ts +4 -2
- package/dist/agent/turn/turn-pipeline.js +33 -5
- package/dist/agent/types.d.ts +64 -14
- package/dist/agent/types.js +3 -0
- package/dist/app/home.js +3 -4
- package/dist/channel/channel-event.d.ts +4 -12
- package/dist/channel/ingress.d.ts +1 -9
- package/dist/channel/store.d.ts +1 -1
- package/dist/commands/catalog.js +25 -19
- package/dist/commands/router.d.ts +5 -2
- package/dist/commands/router.js +9 -4
- package/dist/config/settings.d.ts +5 -12
- package/dist/config/settings.js +0 -7
- package/dist/config/tools.d.ts +2 -2
- package/dist/config/tools.js +2 -2
- package/dist/dingtalk/bot.d.ts +2 -0
- package/dist/dingtalk/bot.js +4 -0
- package/dist/dingtalk/cards.d.ts +7 -0
- package/dist/dingtalk/cards.js +32 -2
- package/dist/dingtalk/delivery.d.ts +5 -1
- package/dist/dingtalk/delivery.js +157 -142
- package/dist/dingtalk/progress.d.ts +55 -6
- package/dist/dingtalk/progress.js +195 -16
- package/dist/file-store.d.ts +4 -0
- package/dist/file-store.js +6 -1
- package/dist/jobs/completion-observer.d.ts +20 -0
- package/dist/jobs/completion-observer.js +107 -0
- package/dist/jobs/completion-signal.d.ts +9 -0
- package/dist/jobs/completion-signal.js +32 -0
- package/dist/jobs/completion-wake.d.ts +1 -1
- package/dist/jobs/completion-wake.js +2 -13
- package/dist/jobs/manager.d.ts +11 -29
- package/dist/jobs/manager.js +103 -176
- package/dist/jobs/probe.d.ts +3 -0
- package/dist/jobs/probe.js +42 -0
- package/dist/jobs/record.d.ts +3 -6
- package/dist/jobs/runtime.d.ts +28 -0
- package/dist/jobs/runtime.js +69 -0
- package/dist/memory/boundary-work.d.ts +2 -0
- package/dist/memory/boundary-work.js +79 -37
- package/dist/memory/commands.js +4 -1
- package/dist/memory/index-budget.js +18 -15
- package/dist/memory/journal.js +2 -1
- package/dist/memory/lifecycle.d.ts +4 -8
- package/dist/memory/lifecycle.js +21 -51
- package/dist/memory/reflect-job.d.ts +0 -6
- package/dist/memory/reflect-job.js +13 -34
- package/dist/memory/reflect.d.ts +4 -0
- package/dist/memory/reflect.js +32 -5
- package/dist/memory/review-log.d.ts +13 -0
- package/dist/memory/review-log.js +49 -0
- package/dist/memory/search.js +7 -4
- package/dist/memory/source-window.d.ts +18 -1
- package/dist/memory/source-window.js +59 -9
- package/dist/memory/store.d.ts +2 -0
- package/dist/memory/store.js +45 -13
- package/dist/playbooks/agent-delegation.md +10 -4
- package/dist/playbooks/background-jobs.md +4 -4
- package/dist/playbooks/event-scheduling.md +2 -2
- package/dist/playbooks/memory-and-learning.md +3 -3
- package/dist/playbooks/outbound-media.md +2 -2
- package/dist/playbooks/runtime-orientation.md +10 -6
- package/dist/playbooks/task-lead.md +54 -33
- package/dist/runtime/bootstrap.d.ts +11 -24
- package/dist/runtime/bootstrap.js +92 -59
- package/dist/runtime/channel-queue.d.ts +2 -0
- package/dist/runtime/channel-queue.js +5 -1
- package/dist/runtime/durable-dispatch.d.ts +7 -0
- package/dist/runtime/durable-dispatch.js +66 -7
- package/dist/runtime/ingress-busy.d.ts +1 -2
- package/dist/runtime/ingress-busy.js +2 -35
- package/dist/runtime/ingress-commands.d.ts +1 -1
- package/dist/runtime/ingress-commands.js +28 -20
- package/dist/runtime/ingress-deps.d.ts +4 -7
- package/dist/runtime/ingress.js +23 -13
- package/dist/runtime/shutdown.d.ts +1 -1
- package/dist/runtime/shutdown.js +2 -2
- package/dist/runtime/task-close.d.ts +4 -0
- package/dist/runtime/task-close.js +102 -0
- package/dist/runtime/task-control.d.ts +34 -0
- package/dist/runtime/task-control.js +225 -0
- package/dist/runtime/task-input.d.ts +13 -0
- package/dist/runtime/task-input.js +129 -0
- package/dist/runtime/task-lane-types.d.ts +123 -0
- package/dist/runtime/task-lane-types.js +14 -0
- package/dist/runtime/task-lane.d.ts +99 -0
- package/dist/runtime/task-lane.js +703 -0
- package/dist/runtime/task-pending.d.ts +8 -0
- package/dist/runtime/task-pending.js +40 -0
- package/dist/runtime/task-spawn.d.ts +4 -4
- package/dist/runtime/task-spawn.js +4 -4
- package/dist/runtime/task-step.d.ts +32 -0
- package/dist/runtime/task-step.js +276 -0
- package/dist/runtime/turn-run.d.ts +4 -16
- package/dist/runtime/turn-run.js +17 -155
- package/dist/runtime/wake-coalescing.d.ts +1 -3
- package/dist/runtime/wake-coalescing.js +2 -4
- package/dist/shared/format.d.ts +0 -6
- package/dist/shared/format.js +0 -17
- package/dist/shared/host-process.d.ts +2 -0
- package/dist/shared/host-process.js +16 -1
- package/dist/shared/jsonl-appender.d.ts +5 -0
- package/dist/shared/jsonl-appender.js +25 -2
- package/dist/skills/catalog.d.ts +9 -0
- package/dist/skills/catalog.js +34 -0
- package/dist/skills/commands.d.ts +3 -12
- package/dist/skills/commands.js +36 -22
- package/dist/skills/loader.d.ts +2 -31
- package/dist/skills/loader.js +101 -68
- package/dist/skills/roots.d.ts +12 -0
- package/dist/skills/roots.js +18 -0
- package/dist/skills/types.d.ts +24 -0
- package/dist/skills/types.js +1 -0
- package/dist/subagents/completion-wake.js +0 -10
- package/dist/subagents/discovery.d.ts +1 -1
- package/dist/subagents/discovery.js +10 -16
- package/dist/subagents/dispatch.js +8 -16
- package/dist/subagents/external/cursor-cli.d.ts +2 -0
- package/dist/subagents/external/cursor-cli.js +256 -0
- package/dist/subagents/external/harness.d.ts +5 -5
- package/dist/subagents/external/reconciliation.d.ts +7 -0
- package/dist/subagents/external/reconciliation.js +105 -0
- package/dist/subagents/external/recovery.d.ts +20 -0
- package/dist/subagents/external/recovery.js +71 -0
- package/dist/subagents/external/registry.js +2 -0
- package/dist/subagents/external/role-warnings.d.ts +17 -0
- package/dist/subagents/external/role-warnings.js +42 -0
- package/dist/subagents/external/run.js +18 -22
- package/dist/subagents/format.d.ts +1 -1
- package/dist/subagents/format.js +1 -1
- package/dist/subagents/grace.d.ts +2 -2
- package/dist/subagents/grace.js +3 -3
- package/dist/subagents/internal/run.js +7 -5
- package/dist/subagents/internal/worker.js +31 -2
- package/dist/subagents/result.js +2 -3
- package/dist/subagents/run-record.d.ts +4 -7
- package/dist/subagents/run-record.js +2 -2
- package/dist/subagents/runs.d.ts +33 -46
- package/dist/subagents/runs.js +126 -245
- package/dist/subagents/task-settlement.d.ts +3 -0
- package/dist/subagents/task-settlement.js +20 -0
- package/dist/subagents/types.d.ts +1 -2
- package/dist/subagents/workspace-summary.js +5 -1
- package/dist/tasks/archive.d.ts +11 -0
- package/dist/tasks/archive.js +141 -0
- package/dist/tasks/board.d.ts +5 -12
- package/dist/tasks/board.js +4 -30
- package/dist/tasks/bound-work.d.ts +12 -6
- package/dist/tasks/bound-work.js +37 -24
- package/dist/tasks/brief.d.ts +38 -14
- package/dist/tasks/brief.js +128 -70
- package/dist/tasks/budget.d.ts +3 -3
- package/dist/tasks/budget.js +9 -4
- package/dist/tasks/commands.d.ts +14 -9
- package/dist/tasks/commands.js +190 -121
- package/dist/tasks/completion.d.ts +12 -0
- package/dist/tasks/completion.js +35 -0
- package/dist/tasks/contract.d.ts +8 -17
- package/dist/tasks/contract.js +41 -43
- package/dist/tasks/control.d.ts +138 -0
- package/dist/tasks/control.js +1 -0
- package/dist/tasks/create.d.ts +1 -1
- package/dist/tasks/create.js +3 -3
- package/dist/tasks/delivery.d.ts +24 -0
- package/dist/tasks/delivery.js +221 -0
- package/dist/tasks/file-mutation.d.ts +5 -0
- package/dist/tasks/file-mutation.js +38 -0
- package/dist/tasks/frontmatter.d.ts +43 -28
- package/dist/tasks/frontmatter.js +83 -40
- package/dist/tasks/input-receipts.d.ts +7 -0
- package/dist/tasks/input-receipts.js +60 -0
- package/dist/tasks/loop-log.d.ts +147 -28
- package/dist/tasks/loop-log.js +239 -28
- package/dist/tasks/receipts.d.ts +19 -0
- package/dist/tasks/receipts.js +48 -0
- package/dist/tasks/state.d.ts +93 -0
- package/dist/tasks/state.js +156 -0
- package/dist/tasks/store.d.ts +81 -49
- package/dist/tasks/store.js +244 -147
- package/dist/tools/bash.d.ts +3 -5
- package/dist/tools/bash.js +8 -22
- package/dist/tools/contract/details.d.ts +6 -6
- package/dist/tools/contract/details.js +6 -6
- package/dist/tools/contract/execution-trace.d.ts +4 -0
- package/dist/tools/contract/execution-trace.js +23 -0
- package/dist/tools/contract/presentation.js +6 -2
- package/dist/tools/edit.d.ts +1 -0
- package/dist/tools/edit.js +45 -42
- package/dist/tools/index.d.ts +8 -12
- package/dist/tools/index.js +16 -6
- package/dist/tools/memory-manage.js +8 -1
- package/dist/tools/registry.d.ts +7 -11
- package/dist/tools/registry.js +52 -25
- package/dist/tools/skill.d.ts +2 -2
- package/dist/tools/skill.js +24 -10
- package/dist/tools/subagent-manage.js +7 -4
- package/dist/tools/subagent.d.ts +0 -2
- package/dist/tools/subagent.js +2 -7
- package/dist/tools/task-manage/control-tools.d.ts +4 -0
- package/dist/tools/task-manage/control-tools.js +65 -0
- package/dist/tools/task-manage/create.js +2 -1
- package/dist/tools/task-manage/factory.d.ts +12 -6
- package/dist/tools/task-manage/factory.js +72 -57
- package/dist/tools/task-manage/lifecycle.d.ts +7 -12
- package/dist/tools/task-manage/lifecycle.js +118 -66
- package/dist/tools/task-manage/log-view.js +8 -5
- package/dist/tools/task-manage/schema.d.ts +21 -26
- package/dist/tools/task-manage/schema.js +29 -35
- package/dist/tools/task-manage/shared.d.ts +8 -39
- package/dist/tools/task-manage/shared.js +19 -68
- package/dist/tools/task-manage/step-tools.d.ts +5 -0
- package/dist/tools/task-manage/step-tools.js +103 -0
- package/dist/tools/task-manage/types.d.ts +25 -18
- package/dist/tools/write-content.d.ts +1 -0
- package/dist/tools/write-content.js +6 -1
- package/dist/tools/write.d.ts +1 -0
- package/dist/tools/write.js +1 -0
- package/dist/usage/ledger.d.ts +4 -4
- package/dist/usage/render.js +2 -2
- package/dist/web/search-providers.js +0 -33
- package/dist/webapi/request-policy.js +1 -1
- package/examples/sub-agents/README.md +23 -16
- package/examples/sub-agents/agents/claude-high.md +1 -1
- package/examples/sub-agents/agents/claude-main.md +1 -1
- package/examples/sub-agents/agents/codex-flash.md +1 -1
- package/examples/sub-agents/agents/codex-high.md +1 -1
- package/examples/sub-agents/agents/codex-main.md +4 -4
- package/examples/sub-agents/agents/cursor-high.md +22 -0
- package/examples/sub-agents/agents/cursor-main.md +22 -0
- package/examples/sub-agents/agents/glm-flash.md +1 -1
- package/examples/sub-agents/agents/glm-high.md +2 -2
- package/examples/sub-agents/agents/scout.md +30 -0
- package/package.json +6 -6
- package/dist/runtime/task-driver.d.ts +0 -116
- package/dist/runtime/task-driver.js +0 -443
- package/dist/runtime/task-wake.d.ts +0 -48
- package/dist/runtime/task-wake.js +0 -32
- package/dist/shared/wake-claim.d.ts +0 -23
- package/dist/shared/wake-claim.js +0 -26
- package/dist/skills/validation.d.ts +0 -8
- package/dist/skills/validation.js +0 -91
- package/dist/skills/workspace.d.ts +0 -33
- package/dist/skills/workspace.js +0 -116
- package/dist/tasks/steer.d.ts +0 -8
- package/dist/tasks/steer.js +0 -81
- package/dist/tasks/ticket.d.ts +0 -71
- package/dist/tasks/ticket.js +0 -138
- package/dist/tools/task-manage/step-end.d.ts +0 -11
- package/dist/tools/task-manage/step-end.js +0 -117
|
@@ -37,7 +37,7 @@ export class TurnFinisher {
|
|
|
37
37
|
* response with the length of the conversation.
|
|
38
38
|
*/
|
|
39
39
|
continuationOf() {
|
|
40
|
-
if (this.deps.
|
|
40
|
+
if (this.deps.profile.kind === "request")
|
|
41
41
|
return { continuation: snapshotContext(this.host.session.messages) };
|
|
42
42
|
const sessionFile = this.host.sessionManager.getSessionFile();
|
|
43
43
|
const leafId = this.host.sessionManager.getLeafId();
|
|
@@ -77,7 +77,7 @@ export class TurnFinisher {
|
|
|
77
77
|
// Debug dump (PIPICLAW_DEBUG=1). Written after the run so `systemPrompt` is the
|
|
78
78
|
// string the provider actually received — base sections, pi's tail, and the boundary
|
|
79
79
|
// footer the prompt extension appends at before_agent_start.
|
|
80
|
-
if (process.env.PIPICLAW_DEBUG &&
|
|
80
|
+
if (process.env.PIPICLAW_DEBUG && this.deps.profile.kind === "chat") {
|
|
81
81
|
const debugContext = {
|
|
82
82
|
systemPrompt: this.host.lastFinalPrompt ?? this.host.agent.state.systemPrompt,
|
|
83
83
|
promptManifest: this.host.lastPromptBuild
|
|
@@ -140,6 +140,7 @@ export class TurnFinisher {
|
|
|
140
140
|
total: this.runState.assistantUsage.total,
|
|
141
141
|
},
|
|
142
142
|
cost: { ...this.runState.assistantUsage.cost },
|
|
143
|
+
costKnown: this.runState.assistantCostKnown,
|
|
143
144
|
});
|
|
144
145
|
if (responseModel &&
|
|
145
146
|
responseModel !== formatModelReference(currentRunModel) &&
|
|
@@ -4,7 +4,7 @@ import type { DeskConversation } from "../../desk/types.js";
|
|
|
4
4
|
import type { FallbackRunDeps } from "../../models/fallback.js";
|
|
5
5
|
import type { ModelSelection } from "../session/model-selection.js";
|
|
6
6
|
import type { SessionHost } from "../session/session-host.js";
|
|
7
|
-
import { type RunState } from "../types.js";
|
|
7
|
+
import { type RunnerProfile, type RunState, type TaskSteerScope } from "../types.js";
|
|
8
8
|
import { type PreparedInboundImages } from "./turn-input.js";
|
|
9
9
|
import type { TurnOutput } from "./turn-output.js";
|
|
10
10
|
import type { TurnHandle, TurnStateMachine } from "./turn-state.js";
|
|
@@ -21,6 +21,7 @@ export interface TurnProgress {
|
|
|
21
21
|
}
|
|
22
22
|
export declare function createTurnProgress(): TurnProgress;
|
|
23
23
|
export interface TurnPipelineDeps {
|
|
24
|
+
profile: RunnerProfile;
|
|
24
25
|
conversation: DeskConversation;
|
|
25
26
|
workspaceDir: string;
|
|
26
27
|
/** The channel's human name for the capsule; absent when the channel index has none. */
|
|
@@ -66,6 +67,7 @@ export declare class TurnPipeline {
|
|
|
66
67
|
* while this call was suspended.
|
|
67
68
|
*/
|
|
68
69
|
private assertBusyWindowOpen;
|
|
69
|
-
queueBusyMessage(text: string, userName?: string, images?: InboundImage[]): Promise<
|
|
70
|
+
queueBusyMessage(text: string, userName?: string, images?: InboundImage[], scope?: TaskSteerScope): Promise<"queued" | "stale">;
|
|
71
|
+
private acceptsScope;
|
|
70
72
|
maybeRunPreventiveCompactionForIncomingText(incomingText: string, imageCount?: number): Promise<void>;
|
|
71
73
|
}
|
|
@@ -73,9 +73,9 @@ export class TurnPipeline {
|
|
|
73
73
|
// Settled into a result object rather than left as a bare promise: if the bootstrap
|
|
74
74
|
// throws first we would otherwise leave a rejection unobserved, which Node's default
|
|
75
75
|
// policy turns into a process exit. Rethrown at the await, so a digest failure still
|
|
76
|
-
// fails the turn exactly as it did when this ran inline. A task step gets none: its
|
|
77
|
-
// already carries its own task, and the
|
|
78
|
-
const taskDigestPromise = (this.host.tasksEnabled &&
|
|
76
|
+
// fails the turn exactly as it did when this ran inline. A task step gets none: its
|
|
77
|
+
// brief already carries its own task, and the desk's other tasks are noise there.
|
|
78
|
+
const taskDigestPromise = (this.host.tasksEnabled && this.deps.profile.kind !== "task"
|
|
79
79
|
? buildTaskDigestForTurn(this.deskDir, this.channelId)
|
|
80
80
|
: Promise.resolve("")).then((text) => ({ text }), (error) => ({ error }));
|
|
81
81
|
// Spec 050, D1: the memory index is injected in full on the first turn of a session
|
|
@@ -220,7 +220,9 @@ export class TurnPipeline {
|
|
|
220
220
|
}
|
|
221
221
|
throw new Error("No task is currently running.");
|
|
222
222
|
}
|
|
223
|
-
async queueBusyMessage(text, userName, images) {
|
|
223
|
+
async queueBusyMessage(text, userName, images, scope) {
|
|
224
|
+
if (scope && !this.acceptsScope(scope))
|
|
225
|
+
return "stale";
|
|
224
226
|
this.assertBusyWindowOpen();
|
|
225
227
|
await this.host.ensureSessionReady();
|
|
226
228
|
const oversized = text.replace(/\r/g, "").trim().length > MAX_USER_MESSAGE_CHARS;
|
|
@@ -237,12 +239,38 @@ export class TurnPipeline {
|
|
|
237
239
|
for (const notice of preparedImages.notices) {
|
|
238
240
|
this.runState.ctx?.emit({ type: "commentary", level: "notice", text: notice });
|
|
239
241
|
}
|
|
242
|
+
if (scope && !this.acceptsScope(scope))
|
|
243
|
+
return "stale";
|
|
240
244
|
this.assertBusyWindowOpen();
|
|
241
245
|
const queueMessage = async () => {
|
|
246
|
+
if (scope && !this.acceptsScope(scope))
|
|
247
|
+
return "stale";
|
|
242
248
|
this.assertBusyWindowOpen();
|
|
249
|
+
if (scope) {
|
|
250
|
+
// Runtime task inputs are already prepared, rather than interactive commands.
|
|
251
|
+
// AgentSession.steer awaits input extensions; the public synchronous primitive
|
|
252
|
+
// keeps the final scope check adjacent to actual submission, including on stop.
|
|
253
|
+
this.session.agent.steer({
|
|
254
|
+
role: "user",
|
|
255
|
+
content: [{ type: "text", text: queuedMessage }, ...preparedImages.images],
|
|
256
|
+
timestamp: Date.now(),
|
|
257
|
+
});
|
|
258
|
+
return "queued";
|
|
259
|
+
}
|
|
243
260
|
await this.session.steer(queuedMessage, preparedImages.images.length > 0 ? preparedImages.images : undefined);
|
|
261
|
+
return "queued";
|
|
244
262
|
};
|
|
245
|
-
|
|
263
|
+
return this.host.runPrompt(queueMessage);
|
|
264
|
+
}
|
|
265
|
+
acceptsScope(scope) {
|
|
266
|
+
if (this.deps.isRetired() || this.deps.profile.kind !== "task" || !scope.isCurrent())
|
|
267
|
+
return false;
|
|
268
|
+
try {
|
|
269
|
+
return this.deps.profile.session.seq() === scope.seq;
|
|
270
|
+
}
|
|
271
|
+
catch {
|
|
272
|
+
return false;
|
|
273
|
+
}
|
|
246
274
|
}
|
|
247
275
|
async maybeRunPreventiveCompactionForIncomingText(incomingText, imageCount = 0) {
|
|
248
276
|
if (incomingText.trimStart().startsWith("/"))
|
package/dist/agent/types.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type { MemoryMaintenanceRuntimeContext } from "../memory/scheduler.js";
|
|
|
12
12
|
import type { LoadedSecurityConfig } from "../security/config.js";
|
|
13
13
|
import type { SubAgentDiscoveryResult } from "../subagents/discovery.js";
|
|
14
14
|
import type { SubAgentRunManager } from "../subagents/runs.js";
|
|
15
|
+
import type { TaskControl, TaskSessionContext } from "../tasks/control.js";
|
|
15
16
|
import { type UsageTotals } from "../usage/totals.js";
|
|
16
17
|
import type { TurnOutput } from "./turn/turn-output.js";
|
|
17
18
|
export interface RunnerStatusSnapshot {
|
|
@@ -43,7 +44,14 @@ export interface TurnStatus {
|
|
|
43
44
|
/** The message text this turn is processing (set by beginTurn). */
|
|
44
45
|
taskText?: string;
|
|
45
46
|
}
|
|
47
|
+
export interface TaskSteerScope {
|
|
48
|
+
seq: number;
|
|
49
|
+
/** Synchronous final validation after preparation, immediately before SDK submission. */
|
|
50
|
+
isCurrent(): boolean;
|
|
51
|
+
}
|
|
46
52
|
export interface AgentRunner {
|
|
53
|
+
/** In-process identity used to correlate task submissions with provider requests. */
|
|
54
|
+
readonly generation?: string;
|
|
47
55
|
/** The (desk, channel) pairing this runner serves; fixed for the runner's lifetime. */
|
|
48
56
|
readonly conversation: DeskConversation;
|
|
49
57
|
/** Run one turn for `turn`, writing its progress and answer to `ctx`. */
|
|
@@ -55,12 +63,24 @@ export interface AgentRunner {
|
|
|
55
63
|
costKnown?: boolean;
|
|
56
64
|
durationMs?: number;
|
|
57
65
|
silent?: boolean;
|
|
66
|
+
/** The text of the turn's last assistant message that had any (a task step's note). */
|
|
67
|
+
finalText?: string;
|
|
68
|
+
/** Tools the turn completed successfully, in call order (a task step's idle evidence). */
|
|
69
|
+
toolsUsed?: string[];
|
|
70
|
+
/** The turn's own model cost: assistant usage only, sub-agents are accounted when they settle. */
|
|
71
|
+
assistantCost?: {
|
|
72
|
+
usd: number;
|
|
73
|
+
estimated: boolean;
|
|
74
|
+
known?: boolean;
|
|
75
|
+
};
|
|
58
76
|
}>;
|
|
59
77
|
/** The reply to a runner-handled built-in command (`/help`, `/context`, …), failures included. */
|
|
60
78
|
handleBuiltinCommand(command: RunnerBuiltInCommand): Promise<string>;
|
|
61
79
|
/** True if `text` is a slash command the runtime or session layer can handle. */
|
|
62
80
|
isKnownSlashCommand(text: string): boolean;
|
|
63
|
-
queueSteer(text: string, userName?: string, images?: InboundImage[]): Promise<void>;
|
|
81
|
+
queueSteer(text: string, userName?: string, images?: InboundImage[], scope?: TaskSteerScope): Promise<void> | Promise<"queued" | "stale">;
|
|
82
|
+
/** Only the task lane calls this after submissions have drained and before another step. */
|
|
83
|
+
clearTaskStepQueue?(seq: number): void;
|
|
64
84
|
flushMemoryForShutdown(): Promise<void>;
|
|
65
85
|
getMemoryMaintenanceContext(): Promise<MemoryMaintenanceRuntimeContext>;
|
|
66
86
|
/** `undefined` while the SDK session is still being built. */
|
|
@@ -75,16 +95,14 @@ export interface AgentRunner {
|
|
|
75
95
|
isCompacting(): boolean;
|
|
76
96
|
/** Cancel context summarization synchronously; returns whether one was active. */
|
|
77
97
|
interruptCompaction(): boolean;
|
|
98
|
+
/** What the running turn is doing right now (spec 064, D26): the tool calls in flight and how many finished. */
|
|
99
|
+
getActivity(): RunnerActivity;
|
|
78
100
|
/**
|
|
79
|
-
*
|
|
80
|
-
*
|
|
101
|
+
* Whether the session's canonical context (what the model would see now — after compaction too)
|
|
102
|
+
* contains `needle`; waits for the session to be built. The task lane asks it whether the current contract is already in context
|
|
103
|
+
* (spec 064, D15) instead of keeping a flag of its own.
|
|
81
104
|
*/
|
|
82
|
-
|
|
83
|
-
bindChatSession(): Promise<void>;
|
|
84
|
-
/** The task whose session this runner is bound to right now, if a task step is running. */
|
|
85
|
-
getTaskLoop(): {
|
|
86
|
-
taskId: string;
|
|
87
|
-
} | undefined;
|
|
105
|
+
contextIncludes(needle: string): Promise<boolean>;
|
|
88
106
|
/** Permanently retire this runner generation after an out-of-band `/new`. */
|
|
89
107
|
retireForNewSession(): void;
|
|
90
108
|
/** Fence an unresponsive generation without changing the active session reference. */
|
|
@@ -119,6 +137,10 @@ export interface AgentRunner {
|
|
|
119
137
|
*/
|
|
120
138
|
dispose(): Promise<void>;
|
|
121
139
|
}
|
|
140
|
+
export interface RunnerActivity {
|
|
141
|
+
pendingTools: PendingTool[];
|
|
142
|
+
toolsDone: number;
|
|
143
|
+
}
|
|
122
144
|
export type FinalOutcome = {
|
|
123
145
|
kind: "none";
|
|
124
146
|
} | {
|
|
@@ -151,6 +173,9 @@ export interface RunState {
|
|
|
151
173
|
/** True only while every observed assistant/sub-agent usage source has known model pricing. */
|
|
152
174
|
costKnown: boolean;
|
|
153
175
|
usageSources: number;
|
|
176
|
+
/** Assistant-only pricing, so an unknown delegation is not charged to the task twice. */
|
|
177
|
+
assistantCostKnown: boolean;
|
|
178
|
+
assistantUsageSources: number;
|
|
154
179
|
stopReason: string;
|
|
155
180
|
errorMessage: string | undefined;
|
|
156
181
|
lastCompactionError: string | undefined;
|
|
@@ -160,11 +185,13 @@ export interface RunState {
|
|
|
160
185
|
/** An `answer` event was emitted this turn (the transport owns whether it reached the user). */
|
|
161
186
|
answerEmitted: boolean;
|
|
162
187
|
/**
|
|
163
|
-
* Names of the tools this turn actually completed, in call order (spec 051, D6). The task
|
|
164
|
-
* writes them into its
|
|
165
|
-
* heuristic v3's effect ledger tried and admitted was bypassable.
|
|
188
|
+
* Names of the tools this turn actually completed, in call order (spec 051, D6). The task lane
|
|
189
|
+
* writes them into its `step_end` record so "this step did nothing" is an observed fact rather
|
|
190
|
+
* than the heuristic v3's effect ledger tried and admitted was bypassable.
|
|
166
191
|
*/
|
|
167
192
|
toolsUsed: string[];
|
|
193
|
+
/** The text of the latest assistant message that had any, tool-calling messages included. */
|
|
194
|
+
lastAssistantText: string;
|
|
168
195
|
}
|
|
169
196
|
export declare function createEmptyRunState(): RunState;
|
|
170
197
|
export interface AssistantUsage {
|
|
@@ -283,9 +310,32 @@ export type AutoRetryStartEvent = Extract<SessionEvent, {
|
|
|
283
310
|
type: "auto_retry_start";
|
|
284
311
|
}>;
|
|
285
312
|
export declare const MAX_USER_MESSAGE_CHARS = 12000;
|
|
313
|
+
/**
|
|
314
|
+
* What a runner serves, fixed when it is built (spec 064, D13): the channel's chat, one Web API
|
|
315
|
+
* request, or one task. The profile decides the session it opens, whether memory is maintained, the
|
|
316
|
+
* tool set and whether the turn gets a task agenda — nothing switches at run time.
|
|
317
|
+
*/
|
|
318
|
+
export type RunnerProfile = {
|
|
319
|
+
kind: "chat";
|
|
320
|
+
}
|
|
321
|
+
/** Request-owned in-memory session: no persistent transcript or automatic memory maintenance. */
|
|
322
|
+
| {
|
|
323
|
+
kind: "request";
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* One task's own session (`tasks/.sessions/<id>.jsonl`): read-only memory bootstrap, no boundary
|
|
327
|
+
* reflection, the task-session tool set. Its `channelId` is the task's report channel.
|
|
328
|
+
*/
|
|
329
|
+
| {
|
|
330
|
+
kind: "task";
|
|
331
|
+
sessionPath: string;
|
|
332
|
+
session: TaskSessionContext;
|
|
333
|
+
};
|
|
286
334
|
export interface RunnerFactoryPaths {
|
|
287
|
-
|
|
288
|
-
|
|
335
|
+
fileStore?: FileStore;
|
|
336
|
+
profile?: RunnerProfile;
|
|
337
|
+
/** Chat only: resolves the task lane's control port (the lane is built after the runners' factory). */
|
|
338
|
+
getTaskControl?: () => TaskControl | undefined;
|
|
289
339
|
jobManager: DeskJobManager;
|
|
290
340
|
runManager: SubAgentRunManager;
|
|
291
341
|
appHomeDir: string;
|
package/dist/agent/types.js
CHANGED
|
@@ -10,12 +10,15 @@ export function createEmptyRunState() {
|
|
|
10
10
|
assistantUsage: createEmptyUsageTotals(),
|
|
11
11
|
costKnown: true,
|
|
12
12
|
usageSources: 0,
|
|
13
|
+
assistantCostKnown: true,
|
|
14
|
+
assistantUsageSources: 0,
|
|
13
15
|
stopReason: "stop",
|
|
14
16
|
errorMessage: undefined,
|
|
15
17
|
lastCompactionError: undefined,
|
|
16
18
|
finalOutcome: { kind: "none" },
|
|
17
19
|
userMessagesStarted: 0,
|
|
18
20
|
toolsUsed: [],
|
|
21
|
+
lastAssistantText: "",
|
|
19
22
|
answerEmitted: false,
|
|
20
23
|
};
|
|
21
24
|
}
|
package/dist/app/home.js
CHANGED
|
@@ -78,7 +78,7 @@ const TOOLS_CONFIG_TEMPLATE = {
|
|
|
78
78
|
enable: false,
|
|
79
79
|
proxy: null,
|
|
80
80
|
search: {
|
|
81
|
-
provider: "
|
|
81
|
+
provider: "duckduckgo",
|
|
82
82
|
apiKey: "",
|
|
83
83
|
maxResults: 5,
|
|
84
84
|
},
|
|
@@ -89,11 +89,10 @@ const TOOLS_CONFIG_TEMPLATE = {
|
|
|
89
89
|
},
|
|
90
90
|
_examples: {
|
|
91
91
|
proxy: "http://127.0.0.1:7890",
|
|
92
|
-
apiKey: "BSA...",
|
|
93
92
|
},
|
|
94
93
|
_notes: [
|
|
95
94
|
"Set tools.web.enable to true to register web_search and web_fetch.",
|
|
96
|
-
"
|
|
95
|
+
"Choose a search provider and configure its credentials if needed.",
|
|
97
96
|
"If needed, copy _examples.proxy to tools.web.proxy.",
|
|
98
97
|
"tools.tasks.enabled is the master switch for autonomous long-running tasks (task_* tools + task driver + task digest).",
|
|
99
98
|
],
|
|
@@ -152,7 +151,7 @@ function writeJsonFileIfMissing(path, value, label, created, mode) {
|
|
|
152
151
|
return writeTextFileIfMissing(path, `${JSON.stringify(value, null, 2)}\n`, label, created, mode);
|
|
153
152
|
}
|
|
154
153
|
// App-level config files that may hold secrets (DingTalk client secret, provider
|
|
155
|
-
// API keys
|
|
154
|
+
// API keys). They are created owner-only, and any pre-existing file with
|
|
156
155
|
// looser bits is tightened on startup.
|
|
157
156
|
const SECRET_FILE_MODE = 0o600;
|
|
158
157
|
function hardenExistingSecretFile(path) {
|
|
@@ -60,7 +60,7 @@ export interface HumanEvent extends EventBase {
|
|
|
60
60
|
}
|
|
61
61
|
export interface WakeEvent extends EventBase {
|
|
62
62
|
source: "wake";
|
|
63
|
-
/** Producer tag: JOB,
|
|
63
|
+
/** Producer tag: JOB, SUBAGENT, EVENT, … Shown to the model as the sender. */
|
|
64
64
|
producer: string;
|
|
65
65
|
/**
|
|
66
66
|
* The desk this wake was produced for (spec 058, D7). Every in-process producer must set it;
|
|
@@ -68,19 +68,11 @@ export interface WakeEvent extends EventBase {
|
|
|
68
68
|
* longer bound to this desk.
|
|
69
69
|
*/
|
|
70
70
|
desk: string;
|
|
71
|
-
/** Structured wake provenance created only by in-process producers; user text cannot manufacture it. */
|
|
72
|
-
internalWake?: {
|
|
73
|
-
kind: "job" | "subagent";
|
|
74
|
-
resourceId: string;
|
|
75
|
-
taskId: string;
|
|
76
|
-
dispatchId: string;
|
|
77
|
-
};
|
|
78
71
|
/**
|
|
79
72
|
* Purely a display hint: `"awaited"` marks a wake a human is actually waiting on (a delegation
|
|
80
|
-
* or background job finishing), as opposed to an autonomous check-in (
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* `internalWake` alone.
|
|
73
|
+
* or background job finishing), as opposed to an autonomous check-in (a scheduled event) that
|
|
74
|
+
* normally has nothing to say. All wakes deliver only their result; this metadata does not
|
|
75
|
+
* enable progress cards.
|
|
84
76
|
*/
|
|
85
77
|
presentation?: "awaited";
|
|
86
78
|
}
|
|
@@ -70,14 +70,6 @@ export type SteerResult = {
|
|
|
70
70
|
kind: "rejected";
|
|
71
71
|
code: "response_not_active" | "too_many_pending_steers" | "invalid_input";
|
|
72
72
|
};
|
|
73
|
-
/**
|
|
74
|
-
* What `/stop` actually did. Stopping a task step also pauses that task, which the user has to be
|
|
75
|
-
* told: a paused task is not picked up again until `/tasks resume`, so silence would read as "the
|
|
76
|
-
* turn was interrupted" while the whole task has in fact gone quiet.
|
|
77
|
-
*/
|
|
78
|
-
export interface StopOutcome {
|
|
79
|
-
pausedTaskId?: string;
|
|
80
|
-
}
|
|
81
73
|
export interface Ingress {
|
|
82
74
|
receive(message: InboundMessage): Promise<IngressResult>;
|
|
83
75
|
/** Isolated generation: no channel binding, transcript archive, or automatic reflection. */
|
|
@@ -85,7 +77,7 @@ export interface Ingress {
|
|
|
85
77
|
/** Inject `message` into the turn running on `channelId`. */
|
|
86
78
|
steer(channelId: string, message: InboundMessage): Promise<SteerResult>;
|
|
87
79
|
/** The same as `/stop`: the running turn ends and everything queued behind it is dropped. */
|
|
88
|
-
cancel(channelId: string): Promise<
|
|
80
|
+
cancel(channelId: string): Promise<void>;
|
|
89
81
|
/**
|
|
90
82
|
* Stop the turn running on `channelId` only if it answers the message that carried `ref`;
|
|
91
83
|
* whether it did. What is queued behind it, and anything another sender is waiting for, stays.
|
package/dist/channel/store.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export interface LoggedSubAgentRun {
|
|
|
41
41
|
/** Spec 040, D7: the run this entry archives, and its lifecycle context. Only set on terminal archiving. */
|
|
42
42
|
runId?: string;
|
|
43
43
|
runtime?: "internal" | "external";
|
|
44
|
-
harness?: "claude-code" | "codex-cli" | "exec";
|
|
44
|
+
harness?: "claude-code" | "codex-cli" | "cursor-cli" | "exec";
|
|
45
45
|
status?: "completed" | "failed" | "cancelled" | "lost";
|
|
46
46
|
taskId?: string;
|
|
47
47
|
artifactDir?: string;
|
package/dist/commands/catalog.js
CHANGED
|
@@ -26,7 +26,7 @@ export const BUILT_IN_COMMANDS = [
|
|
|
26
26
|
},
|
|
27
27
|
{
|
|
28
28
|
name: "stop",
|
|
29
|
-
description: "
|
|
29
|
+
description: "停止当前聊天回合并丢弃排在它后面的消息;后台任务不受影响,暂停任务用 /tasks pause",
|
|
30
30
|
examples: ["/stop"],
|
|
31
31
|
availableWhileBusy: true,
|
|
32
32
|
runnerHandled: true,
|
|
@@ -89,15 +89,15 @@ export const BUILT_IN_COMMANDS = [
|
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
name: "tasks",
|
|
92
|
-
argumentHint: "[show <id>|log <id>|
|
|
93
|
-
description: "
|
|
92
|
+
argumentHint: "[show <id>|log <id>|msg <id> <内容>|pause <id>|resume <id> [+steps N|+usd X]|cancel <id>|archive|doctor]",
|
|
93
|
+
description: "查看、对话、暂停与取消本工位在后台执行的长程任务;任务与聊天互不占用",
|
|
94
94
|
availableWhileBusy: true,
|
|
95
95
|
subcommands: [
|
|
96
96
|
{ name: "list", description: "列出本工位进行中的任务(默认动作,可省略)", example: "/tasks" },
|
|
97
97
|
{
|
|
98
98
|
name: "show",
|
|
99
99
|
args: "<id>",
|
|
100
|
-
description: "
|
|
100
|
+
description: "查看任务的当前活动、在途委派、工作项、最近记录与用量",
|
|
101
101
|
example: "/tasks show weekly-report",
|
|
102
102
|
},
|
|
103
103
|
{
|
|
@@ -107,36 +107,37 @@ export const BUILT_IN_COMMANDS = [
|
|
|
107
107
|
example: "/tasks log weekly-report",
|
|
108
108
|
},
|
|
109
109
|
{ name: "archive", description: "列出已归档(已关闭)的任务", example: "/tasks archive" },
|
|
110
|
+
{
|
|
111
|
+
name: "msg",
|
|
112
|
+
args: "<id> <内容>",
|
|
113
|
+
description: "对任务说话:步骤执行中直接送进当前步骤,否则排给下一步;也是回答任务提问的方式",
|
|
114
|
+
example: "/tasks msg weekly-report 先跑一遍 npm run check",
|
|
115
|
+
},
|
|
110
116
|
{
|
|
111
117
|
name: "pause",
|
|
112
118
|
args: "<id>",
|
|
113
|
-
description: "
|
|
119
|
+
description: "暂停任务:中止当前这一步,在途的委派和作业继续运行,结果会记下",
|
|
114
120
|
example: "/tasks pause weekly-report",
|
|
115
121
|
},
|
|
116
122
|
{
|
|
117
123
|
name: "resume",
|
|
118
124
|
args: "<id> [+steps N|+usd X]",
|
|
119
|
-
description: "
|
|
125
|
+
description: "恢复已暂停的任务,可同时追加预算",
|
|
120
126
|
example: "/tasks resume weekly-report +steps 20",
|
|
121
127
|
},
|
|
122
128
|
{
|
|
123
|
-
name: "
|
|
124
|
-
args: "<id>
|
|
125
|
-
description: "
|
|
126
|
-
example: "/tasks
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
name: "reply",
|
|
130
|
-
args: "<id> <内容>",
|
|
131
|
-
description: "回答该任务提出的问题,并让它继续",
|
|
132
|
-
example: "/tasks reply weekly-report 合并到 master",
|
|
129
|
+
name: "cancel",
|
|
130
|
+
args: "<id>",
|
|
131
|
+
description: "取消任务:中止当前步骤,取消在途的委派和作业,并归档",
|
|
132
|
+
example: "/tasks cancel weekly-report",
|
|
133
133
|
},
|
|
134
|
+
{ name: "archive", description: "列出已归档(已关闭)的任务", example: "/tasks archive" },
|
|
134
135
|
{ name: "doctor", description: "只读检查手工编辑造成的任务问题", example: "/tasks doctor" },
|
|
135
136
|
],
|
|
136
137
|
},
|
|
137
138
|
{
|
|
138
139
|
name: "status",
|
|
139
|
-
description: "
|
|
140
|
+
description: "显示运行状态、当前模型、上下文占用、运行时长、版本与本工位后台任务概况",
|
|
140
141
|
examples: ["/status"],
|
|
141
142
|
availableWhileBusy: true,
|
|
142
143
|
},
|
|
@@ -200,10 +201,10 @@ export const BUILT_IN_COMMANDS = [
|
|
|
200
201
|
{
|
|
201
202
|
name: "skills",
|
|
202
203
|
argumentHint: "[list|show <name>]",
|
|
203
|
-
description: "
|
|
204
|
+
description: "列出工作区与用户共享技能(含来源及加载提醒),或查看单个技能",
|
|
204
205
|
availableWhileBusy: true,
|
|
205
206
|
subcommands: [
|
|
206
|
-
{ name: "list", description: "
|
|
207
|
+
{ name: "list", description: "列出技能及来源(默认动作,可省略)", example: "/skills" },
|
|
207
208
|
{
|
|
208
209
|
name: "show",
|
|
209
210
|
args: "<name>",
|
|
@@ -278,6 +279,11 @@ export const SESSION_COMMANDS = [
|
|
|
278
279
|
examples: ["/new"],
|
|
279
280
|
availableWhileBusy: true,
|
|
280
281
|
},
|
|
282
|
+
{
|
|
283
|
+
name: "reload",
|
|
284
|
+
description: "重新加载当前会话的技能、工具及其他资源,保留对话历史",
|
|
285
|
+
examples: ["/reload"],
|
|
286
|
+
},
|
|
281
287
|
{
|
|
282
288
|
name: "compact",
|
|
283
289
|
argumentHint: "[压缩要求]",
|
|
@@ -3,6 +3,7 @@ import type { ChannelDescription } from "../channel/channel-id.js";
|
|
|
3
3
|
import { type DeskCommandPort } from "../desk/commands.js";
|
|
4
4
|
import type { DeskConversation } from "../desk/types.js";
|
|
5
5
|
import type { SubAgentRunManager } from "../subagents/runs.js";
|
|
6
|
+
import type { TaskControl } from "../tasks/control.js";
|
|
6
7
|
import type { RuntimeCommandName } from "./catalog.js";
|
|
7
8
|
/**
|
|
8
9
|
* The stateless report commands (`/desk /events /tasks /status /usage /context /subagents /skills`) as
|
|
@@ -33,8 +34,10 @@ export interface ReportCommandContext {
|
|
|
33
34
|
/** The channel's runner, built on demand (`/context` needs a session to report on). */
|
|
34
35
|
getRunner: () => AgentRunner;
|
|
35
36
|
runManager: SubAgentRunManager;
|
|
36
|
-
/**
|
|
37
|
-
|
|
37
|
+
/** The task lane's control port: what `/tasks` and the `/status` task line read and write. */
|
|
38
|
+
taskControl: TaskControl;
|
|
39
|
+
/** Who typed the command, for the `message` record a `/tasks msg` writes. */
|
|
40
|
+
senderName: string;
|
|
38
41
|
}
|
|
39
42
|
/**
|
|
40
43
|
* A channel with no usable desk (spec 060, D4): `/desk` is the one report it can run; every other
|
package/dist/commands/router.js
CHANGED
|
@@ -4,7 +4,7 @@ import { handleEventsCommand } from "../events/commands.js";
|
|
|
4
4
|
import { handleSkillsCommand } from "../skills/commands.js";
|
|
5
5
|
import { handleSubagentsCommand } from "../subagents/commands.js";
|
|
6
6
|
import { loadDetachedSubAgentDiscovery } from "../subagents/detached-discovery.js";
|
|
7
|
-
import { handleTasksCommand } from "../tasks/commands.js";
|
|
7
|
+
import { handleTasksCommand, renderTaskStatusLine } from "../tasks/commands.js";
|
|
8
8
|
import { getUsageLedger } from "../usage/ledger.js";
|
|
9
9
|
import { parseUsageMode, renderUsageReport } from "../usage/render.js";
|
|
10
10
|
export async function runReportCommand(context, name, args) {
|
|
@@ -26,17 +26,22 @@ export async function runReportCommand(context, name, args) {
|
|
|
26
26
|
case "tasks":
|
|
27
27
|
return handleTasksCommand({
|
|
28
28
|
args,
|
|
29
|
+
desk,
|
|
29
30
|
deskDir,
|
|
30
31
|
currentChannelId: channelId,
|
|
32
|
+
senderName: context.senderName,
|
|
31
33
|
describeChannel: context.describeChannel,
|
|
32
|
-
|
|
34
|
+
control: context.taskControl,
|
|
33
35
|
});
|
|
34
|
-
case "status":
|
|
35
|
-
|
|
36
|
+
case "status": {
|
|
37
|
+
const status = renderStatus({
|
|
36
38
|
runner: context.peekRunner(),
|
|
37
39
|
version: context.version,
|
|
38
40
|
uptimeMs: Date.now() - context.startedAt,
|
|
39
41
|
});
|
|
42
|
+
const tasks = renderTaskStatusLine(await context.taskControl.snapshot(desk).catch(() => []));
|
|
43
|
+
return tasks ? `${status}\n${tasks}` : status;
|
|
44
|
+
}
|
|
40
45
|
case "usage":
|
|
41
46
|
return renderUsageReport(getUsageLedger(), { desk, channelId }, parseUsageMode(args), new Date());
|
|
42
47
|
// Read-only prompt accounting; safe mid-turn.
|
|
@@ -19,12 +19,6 @@ export interface PipiclawTaskDigestSettings {
|
|
|
19
19
|
maxTasks: number;
|
|
20
20
|
maxChars: number;
|
|
21
21
|
}
|
|
22
|
-
export interface PipiclawTaskDriverSettings {
|
|
23
|
-
/** Global enqueue cap per scan, with round-robin fairness across channels. */
|
|
24
|
-
maxDispatchesPerTick: number;
|
|
25
|
-
/** Cap on idle sleep between scans; also the upper bound on how late a manual edit is noticed. */
|
|
26
|
-
maxSleepMinutes: number;
|
|
27
|
-
}
|
|
28
22
|
/** Only the on/off switch is a setting; cadence constants live in `memory/maintenance-tuning.ts`. */
|
|
29
23
|
export interface PipiclawMemoryMaintenanceSettings {
|
|
30
24
|
enabled: boolean;
|
|
@@ -109,16 +103,15 @@ export declare const SETTINGS_TOP_LEVEL_KEYS: readonly ["defaultProvider", "defa
|
|
|
109
103
|
export type TuiResponseMode = "full_progress_then_plain_final" | "rolling_progress_then_plain_final" | "final_card_only";
|
|
110
104
|
export interface PipiclawTuiSettings {
|
|
111
105
|
/**
|
|
112
|
-
* Output shape for the terminal TUI
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
106
|
+
* Output shape for the terminal TUI. The names match DingTalk's `responseMode`,
|
|
107
|
+
* but the terminal renders them itself and is not bound by the card size limit:
|
|
108
|
+
* `full_progress_then_plain_final` (default) keeps the live transcript, then prints
|
|
109
|
+
* the answer; `rolling_progress_then_plain_final` keeps recent progress;
|
|
110
|
+
* `final_card_only` hides progress. Independent of `channel.json`.
|
|
117
111
|
*/
|
|
118
112
|
responseMode: TuiResponseMode;
|
|
119
113
|
}
|
|
120
114
|
export declare const TASK_DIGEST_SETTINGS: PipiclawTaskDigestSettings;
|
|
121
|
-
export declare const TASK_DRIVER_SETTINGS: PipiclawTaskDriverSettings;
|
|
122
115
|
/**
|
|
123
116
|
* Settings manager for pipiclaw.
|
|
124
117
|
* Stores global settings in the pipiclaw root directory.
|
package/dist/config/settings.js
CHANGED
|
@@ -48,13 +48,6 @@ export const TASK_DIGEST_SETTINGS = {
|
|
|
48
48
|
maxTasks: 8,
|
|
49
49
|
maxChars: 1000,
|
|
50
50
|
};
|
|
51
|
-
// Only the two knobs the scan itself needs. The retry/backoff tiers are gone with the governor
|
|
52
|
-
// (spec 051, D6): a task continues immediately or stops on a budget it can see, so there is no
|
|
53
|
-
// longer a "how long to wait before guessing again" question to answer.
|
|
54
|
-
export const TASK_DRIVER_SETTINGS = {
|
|
55
|
-
maxDispatchesPerTick: 4,
|
|
56
|
-
maxSleepMinutes: 15,
|
|
57
|
-
};
|
|
58
51
|
const DEFAULT_SESSION_SEARCH = {
|
|
59
52
|
maxFiles: 12,
|
|
60
53
|
maxChunks: 80,
|
package/dist/config/tools.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ConfigDiagnostic } from "../shared/config-diagnostic.js";
|
|
2
|
-
export type WebSearchProvider = "
|
|
2
|
+
export type WebSearchProvider = "tavily" | "jina" | "searxng" | "duckduckgo";
|
|
3
3
|
export interface PipiclawWebSearchConfig {
|
|
4
4
|
provider: WebSearchProvider;
|
|
5
5
|
apiKey: string;
|
|
@@ -27,7 +27,7 @@ export interface PipiclawToolsConfig {
|
|
|
27
27
|
web: PipiclawWebToolsConfig;
|
|
28
28
|
/**
|
|
29
29
|
* Master switch for the autonomous long-running task mechanism: gates the
|
|
30
|
-
* task_* tools, the
|
|
30
|
+
* task_* tools, the task lane (new steps), and the per-turn task digest
|
|
31
31
|
* together. Core capabilities (read/bash/edit/write/grep, memory, skills,
|
|
32
32
|
* events, background jobs) are always on and have no switches.
|
|
33
33
|
*/
|
package/dist/config/tools.js
CHANGED
|
@@ -21,14 +21,14 @@ export const TOOLS_CONFIG_SECTION_KEYS = [
|
|
|
21
21
|
];
|
|
22
22
|
const _toolsConfigKeysComplete = true;
|
|
23
23
|
void _toolsConfigKeysComplete;
|
|
24
|
-
const WEB_SEARCH_PROVIDERS = ["
|
|
24
|
+
const WEB_SEARCH_PROVIDERS = ["tavily", "jina", "searxng", "duckduckgo"];
|
|
25
25
|
export const DEFAULT_TOOLS_CONFIG = {
|
|
26
26
|
tools: {
|
|
27
27
|
web: {
|
|
28
28
|
enable: false,
|
|
29
29
|
proxy: null,
|
|
30
30
|
search: {
|
|
31
|
-
provider: "
|
|
31
|
+
provider: "duckduckgo",
|
|
32
32
|
apiKey: "",
|
|
33
33
|
baseUrl: "",
|
|
34
34
|
maxResults: 5,
|
package/dist/dingtalk/bot.d.ts
CHANGED
|
@@ -43,6 +43,8 @@ export declare class DingTalkBot implements DeliveryPort {
|
|
|
43
43
|
ensureCard(channelId: string, generation?: symbol): Promise<void>;
|
|
44
44
|
/** Replace the active card content with a full snapshot. */
|
|
45
45
|
replaceCard(channelId: string, content: string, finalize?: boolean, failed?: boolean, generation?: symbol): Promise<boolean>;
|
|
46
|
+
/** False after this process has seen the template reject an appended fragment. */
|
|
47
|
+
supportsStreamingAppend(): boolean;
|
|
46
48
|
/** Append a delta to the active card transcript. */
|
|
47
49
|
appendToCard(channelId: string, content: string, finalize?: boolean, failed?: boolean, generation?: symbol): Promise<boolean>;
|
|
48
50
|
/** Finalize and remove the active card for a channel. */
|
package/dist/dingtalk/bot.js
CHANGED
|
@@ -132,6 +132,10 @@ export class DingTalkBot {
|
|
|
132
132
|
async replaceCard(channelId, content, finalize = false, failed = false, generation) {
|
|
133
133
|
return this.cards.replaceCard(channelId, content, finalize, failed, generation);
|
|
134
134
|
}
|
|
135
|
+
/** False after this process has seen the template reject an appended fragment. */
|
|
136
|
+
supportsStreamingAppend() {
|
|
137
|
+
return this.cards.supportsStreamingAppend();
|
|
138
|
+
}
|
|
135
139
|
/** Append a delta to the active card transcript. */
|
|
136
140
|
async appendToCard(channelId, content, finalize = false, failed = false, generation) {
|
|
137
141
|
return this.cards.appendToCard(channelId, content, finalize, failed, generation);
|