@oyasmi/pipiclaw 0.9.0-beta.8 → 0.9.0-beta.9
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/dist/agent/channel-runner.d.ts +1 -0
- package/dist/agent/channel-runner.js +21 -2
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/agent/job-manager.d.ts +3 -3
- package/dist/agent/job-manager.js +0 -1
- package/dist/agent/runner-factory.d.ts +16 -4
- package/dist/agent/runner-factory.js +9 -23
- package/dist/agent/types.d.ts +9 -1
- package/dist/agent/types.js +3 -16
- package/dist/runtime/bootstrap.d.ts +10 -2
- package/dist/runtime/bootstrap.js +74 -50
- package/dist/runtime/channel-event.d.ts +41 -0
- package/dist/runtime/channel-event.js +1 -0
- package/dist/runtime/delivery.d.ts +3 -2
- package/dist/runtime/dingtalk.d.ts +9 -31
- package/dist/runtime/durable-dispatch.d.ts +3 -2
- package/dist/runtime/events.d.ts +3 -2
- package/dist/runtime/events.js +2 -3
- package/dist/runtime/task-commands.js +2 -2
- package/dist/runtime/task-driver.d.ts +7 -7
- package/dist/runtime/task-driver.js +1 -4
- package/dist/runtime/task-migration.js +1 -1
- package/dist/runtime/task-wake.d.ts +4 -4
- package/dist/settings.d.ts +0 -106
- package/dist/settings.js +0 -224
- package/dist/shared/types.d.ts +1 -0
- package/dist/shared/types.js +10 -1
- package/dist/subagents/external/run.js +2 -8
- package/dist/subagents/runs.d.ts +3 -3
- package/dist/subagents/runs.js +2 -12
- package/dist/subagents/tool.d.ts +11 -4
- package/dist/subagents/tool.js +1 -13
- package/dist/tasks/ledger.js +1 -1
- package/dist/{shared → tasks}/task-schedule.js +1 -1
- package/dist/tools/bash.js +1 -1
- package/dist/tools/event-manage.js +1 -4
- package/dist/tools/grep.js +2 -3
- package/dist/tools/job.js +5 -5
- package/dist/tools/memory-manage.js +3 -6
- package/dist/tools/session-search.js +0 -1
- package/dist/tools/skill-manage.js +3 -3
- package/dist/tools/subagent-manage.js +3 -3
- package/dist/tools/task-manage/shared.js +2 -2
- package/dist/tools/task-manage.js +1 -4
- package/dist/tools/web-fetch.js +0 -1
- package/dist/tui/app.js +4 -4
- package/package.json +1 -1
- /package/dist/{shared → tasks}/task-events.d.ts +0 -0
- /package/dist/{shared → tasks}/task-events.js +0 -0
- /package/dist/{shared → tasks}/task-schedule.d.ts +0 -0
package/dist/tasks/ledger.js
CHANGED
|
@@ -2,8 +2,8 @@ import { readdir, readFile, stat } from "node:fs/promises";
|
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { formatLocalTime, parseLocalTime } from "../shared/local-time.js";
|
|
4
4
|
import { RecoverableToolError } from "../shared/recoverable-error.js";
|
|
5
|
-
import { nextTaskWake } from "../shared/task-schedule.js";
|
|
6
5
|
import { createDefaultTaskControl, parseTaskControl, taskPriorityRank } from "./control.js";
|
|
6
|
+
import { nextTaskWake } from "./task-schedule.js";
|
|
7
7
|
import { normalizeStoredStatus, wasLegacyEscalated } from "./transitions.js";
|
|
8
8
|
const FRONTMATTER_FIELDS = [
|
|
9
9
|
"status",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Cron } from "croner";
|
|
2
|
-
import { errorMessage } from "
|
|
2
|
+
import { errorMessage } from "../shared/text-utils.js";
|
|
3
3
|
/**
|
|
4
4
|
* The cron cadence of a recurring task lives in its `schedule` frontmatter key.
|
|
5
5
|
* Cron is always interpreted in the host timezone — tasks (and events) follow the
|
package/dist/tools/bash.js
CHANGED
|
@@ -152,7 +152,7 @@ export function createBashTool(executor, options = {}) {
|
|
|
152
152
|
: "It runs off-turn and will NOT wake you when it finishes; check it with the job tool (op:poll/list)."),
|
|
153
153
|
},
|
|
154
154
|
],
|
|
155
|
-
details: {
|
|
155
|
+
details: { async: { state: "running", jobId: job.id } },
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
158
|
const result = await executor.exec(effectiveCommand, { timeout: effectiveTimeout, signal });
|
|
@@ -170,10 +170,7 @@ export function createEventManageTool(options) {
|
|
|
170
170
|
});
|
|
171
171
|
return {
|
|
172
172
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
173
|
-
details: {
|
|
174
|
-
kind: "event_manage",
|
|
175
|
-
...result,
|
|
176
|
-
},
|
|
173
|
+
details: { ...result },
|
|
177
174
|
};
|
|
178
175
|
},
|
|
179
176
|
};
|
package/dist/tools/grep.js
CHANGED
|
@@ -203,7 +203,7 @@ export function createGrepTool(executor, options = {}) {
|
|
|
203
203
|
text: `No matches found in ${scope}. Try a broader pattern, drop the glob, or widen the path.`,
|
|
204
204
|
},
|
|
205
205
|
],
|
|
206
|
-
details: {
|
|
206
|
+
details: { matchCount: 0, fileCount: 0 },
|
|
207
207
|
};
|
|
208
208
|
}
|
|
209
209
|
files.sort((a, b) => a[0].localeCompare(b[0]));
|
|
@@ -219,7 +219,7 @@ export function createGrepTool(executor, options = {}) {
|
|
|
219
219
|
text: `No more matching files (skip=${startOffset} is past the last of ${files.length}).`,
|
|
220
220
|
},
|
|
221
221
|
],
|
|
222
|
-
details: {
|
|
222
|
+
details: { matchCount: 0, fileCount: files.length },
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
225
|
const blocks = [];
|
|
@@ -249,7 +249,6 @@ export function createGrepTool(executor, options = {}) {
|
|
|
249
249
|
return {
|
|
250
250
|
content: [{ type: "text", text: outputText }],
|
|
251
251
|
details: {
|
|
252
|
-
kind: "grep",
|
|
253
252
|
matchCount: shownMatchCount,
|
|
254
253
|
fileCount: files.length,
|
|
255
254
|
shownFileCount: page.length,
|
package/dist/tools/job.js
CHANGED
|
@@ -49,7 +49,7 @@ export function createJobTool(options) {
|
|
|
49
49
|
const text = outcomes.map((outcome) => `- [${outcome.id}] ${outcome.status}`).join("\n");
|
|
50
50
|
return {
|
|
51
51
|
content: [{ type: "text", text: `Cancel results:\n${text}` }],
|
|
52
|
-
details: {
|
|
52
|
+
details: { op: "cancel", outcomes },
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
55
|
if (op === "list") {
|
|
@@ -57,12 +57,12 @@ export function createJobTool(options) {
|
|
|
57
57
|
if (jobs.length === 0) {
|
|
58
58
|
return {
|
|
59
59
|
content: [{ type: "text", text: "No background jobs." }],
|
|
60
|
-
details: {
|
|
60
|
+
details: { op: "list", jobs },
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
return {
|
|
64
64
|
content: [{ type: "text", text: jobs.map(formatJobLine).join("\n") }],
|
|
65
|
-
details: {
|
|
65
|
+
details: { op: "list", jobs },
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
// poll
|
|
@@ -70,7 +70,7 @@ export function createJobTool(options) {
|
|
|
70
70
|
if (jobs.length === 0) {
|
|
71
71
|
return {
|
|
72
72
|
content: [{ type: "text", text: "No matching running jobs to wait for." }],
|
|
73
|
-
details: {
|
|
73
|
+
details: { op: "poll", jobs },
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
const finished = jobs.filter((job) => job.status !== "running");
|
|
@@ -85,7 +85,7 @@ export function createJobTool(options) {
|
|
|
85
85
|
}
|
|
86
86
|
return {
|
|
87
87
|
content: [{ type: "text", text: parts.join("\n\n") }],
|
|
88
|
-
details: {
|
|
88
|
+
details: { op: "poll", jobs },
|
|
89
89
|
};
|
|
90
90
|
},
|
|
91
91
|
};
|
|
@@ -83,7 +83,7 @@ export function createMemoryManageTool(options) {
|
|
|
83
83
|
rejectMissingArgument("save", "content", args);
|
|
84
84
|
}
|
|
85
85
|
if (containsSecret(trimmed)) {
|
|
86
|
-
return textResult("This content looks like a credential or secret, so it was not saved. Store the secret in an approved secret manager and remember only its location.", {
|
|
86
|
+
return textResult("This content looks like a credential or secret, so it was not saved. Store the secret in an approved secret manager and remember only its location.", { op: "save", saved: false, blockedReason: "secret" });
|
|
87
87
|
}
|
|
88
88
|
// Serialize through the shared channel memory queue so this never races with background
|
|
89
89
|
// consolidation/maintenance on the same channel's files.
|
|
@@ -105,7 +105,6 @@ export function createMemoryManageTool(options) {
|
|
|
105
105
|
? `Saved to channel memory${kind ? ` (${kind})` : ""}.`
|
|
106
106
|
: "That memory is already present; no duplicate was added.";
|
|
107
107
|
return textResult(message, {
|
|
108
|
-
kind: "memory_manage",
|
|
109
108
|
op: "save",
|
|
110
109
|
saved: result.added > 0 || result.skippedDuplicate > 0,
|
|
111
110
|
});
|
|
@@ -134,13 +133,12 @@ export function createMemoryManageTool(options) {
|
|
|
134
133
|
candidateStore: options.memoryCandidateStore,
|
|
135
134
|
});
|
|
136
135
|
if (items.length === 0) {
|
|
137
|
-
return textResult(`No stored memory matched "${trimmed}". Try a broader query, or the fact may not be saved yet.`, {
|
|
136
|
+
return textResult(`No stored memory matched "${trimmed}". Try a broader query, or the fact may not be saved yet.`, { op: "search", resultCount: 0 });
|
|
138
137
|
}
|
|
139
138
|
const rendered = items
|
|
140
139
|
.map((item, index) => `${index + 1}. [${item.source}/${item.title}] ${item.content}`)
|
|
141
140
|
.join("\n");
|
|
142
141
|
return textResult(`Found ${items.length} stored memory entr${items.length === 1 ? "y" : "ies"}:\n\n${rendered}`, {
|
|
143
|
-
kind: "memory_manage",
|
|
144
142
|
op: "search",
|
|
145
143
|
resultCount: items.length,
|
|
146
144
|
});
|
|
@@ -157,7 +155,6 @@ export function createMemoryManageTool(options) {
|
|
|
157
155
|
const matches = entries.filter((entry) => entry.content === trimmed || entry.content.toLowerCase().includes(needle));
|
|
158
156
|
if (matches.length === 0) {
|
|
159
157
|
return textResult(`No stored memory entry matched "${trimmed}"; nothing was removed.`, {
|
|
160
|
-
kind: "memory_manage",
|
|
161
158
|
op: "forget",
|
|
162
159
|
forgotten: false,
|
|
163
160
|
});
|
|
@@ -180,7 +177,7 @@ export function createMemoryManageTool(options) {
|
|
|
180
177
|
}).catch((error) => {
|
|
181
178
|
log.logWarning(`Failed to append memory review log for channel ${options.channelId}`, errorMessage(error));
|
|
182
179
|
});
|
|
183
|
-
return textResult("Removed the entry from active channel memory. Its exact content and source transcript window are tombstoned against automatic replay; if the fact is stated again later, it may be learned as new. Original session history and retention backups are unchanged.", {
|
|
180
|
+
return textResult("Removed the entry from active channel memory. Its exact content and source transcript window are tombstoned against automatic replay; if the fact is stated again later, it may be learned as new. Original session history and retention backups are unchanged.", { op: "forget", forgotten: true, entryId: removed.id });
|
|
184
181
|
}
|
|
185
182
|
return {
|
|
186
183
|
name: "memory_manage",
|
|
@@ -190,7 +190,7 @@ async function viewWorkspaceSkill(options, name, filePath) {
|
|
|
190
190
|
}
|
|
191
191
|
return {
|
|
192
192
|
content: [{ type: "text", text: `Skill: ${name}\nPath: ${targetPath}\n\n${body}` }],
|
|
193
|
-
details: {
|
|
193
|
+
details: { action: "view", name, path: targetPath, truncated: truncation.truncated },
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
196
|
export function createSkillManageTool(options) {
|
|
@@ -205,7 +205,7 @@ export function createSkillManageTool(options) {
|
|
|
205
205
|
const skills = await listWorkspaceSkills(options);
|
|
206
206
|
return {
|
|
207
207
|
content: [{ type: "text", text: JSON.stringify({ skills }) }],
|
|
208
|
-
details: {
|
|
208
|
+
details: { action: "list", count: skills.length },
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
211
|
if (!args.name) {
|
|
@@ -224,7 +224,7 @@ export function createSkillManageTool(options) {
|
|
|
224
224
|
});
|
|
225
225
|
return {
|
|
226
226
|
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
227
|
-
details: {
|
|
227
|
+
details: { ...result },
|
|
228
228
|
};
|
|
229
229
|
},
|
|
230
230
|
};
|
|
@@ -67,7 +67,7 @@ export function createSubAgentManageTool(options) {
|
|
|
67
67
|
}
|
|
68
68
|
return {
|
|
69
69
|
content: [{ type: "text", text: lines.join("\n") }],
|
|
70
|
-
details: {
|
|
70
|
+
details: { op, runs },
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
if (!runId) {
|
|
@@ -85,7 +85,7 @@ export function createSubAgentManageTool(options) {
|
|
|
85
85
|
const status = await manager().cancel(resolvedRunId);
|
|
86
86
|
return {
|
|
87
87
|
content: [{ type: "text", text: `Cancel requested for run ${resolvedRunId}: ${status}` }],
|
|
88
|
-
details: {
|
|
88
|
+
details: { op, runId: resolvedRunId, status },
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
// follow_up
|
|
@@ -238,7 +238,7 @@ export function createSubAgentManageTool(options) {
|
|
|
238
238
|
text: `Follow-up dispatched as runId=${newRunId} (resuming ${resolvedRunId}). This channel will be woken when it finishes.`,
|
|
239
239
|
},
|
|
240
240
|
],
|
|
241
|
-
details: {
|
|
241
|
+
details: { op, runId: newRunId, resumedFrom: resolvedRunId },
|
|
242
242
|
};
|
|
243
243
|
},
|
|
244
244
|
};
|
|
@@ -4,11 +4,11 @@ import { join } from "node:path";
|
|
|
4
4
|
import * as log from "../../log.js";
|
|
5
5
|
import { parseScheduledEventContent } from "../../runtime/events.js";
|
|
6
6
|
import { formatLocalTime, parseWakeInput } from "../../shared/local-time.js";
|
|
7
|
-
import { taskEventPrefix } from "../../shared/task-events.js";
|
|
8
|
-
import { nextTaskWake, validateTaskSchedule } from "../../shared/task-schedule.js";
|
|
9
7
|
import { errorMessage } from "../../shared/text-utils.js";
|
|
10
8
|
import { applyTaskControlPatch, createDefaultTaskControl } from "../../tasks/control.js";
|
|
11
9
|
import { normalizeTaskFields, parseTaskFrontmatter, renderStandardTaskBody, renderTaskDocument, taskBody, upsertCurrentCycleCompletionEvidence, } from "../../tasks/ledger.js";
|
|
10
|
+
import { taskEventPrefix } from "../../tasks/task-events.js";
|
|
11
|
+
import { nextTaskWake, validateTaskSchedule } from "../../tasks/task-schedule.js";
|
|
12
12
|
import { isSettableTaskStatus } from "../../tasks/transitions.js";
|
|
13
13
|
import { RecoverableToolError } from "../tool-details.js";
|
|
14
14
|
import { SETTABLE_STATUSES } from "./schema.js";
|
package/dist/tools/web-fetch.js
CHANGED
package/dist/tui/app.js
CHANGED
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { userInfo } from "node:os";
|
|
10
10
|
import { renderBuiltInHelp } from "../agent/commands.js";
|
|
11
|
-
import {
|
|
12
|
-
import { resetRunner } from "../agent/runner-factory.js";
|
|
11
|
+
import { createRunner } from "../agent/index.js";
|
|
13
12
|
import * as log from "../log.js";
|
|
14
13
|
import { ensureChannelMemoryFilesSync } from "../memory/files.js";
|
|
15
14
|
import { BootstrapExitError, bootstrapAppHome, DEFAULT_BOOTSTRAP_PATHS, printBootstrapSummary, readCliVersion, } from "../runtime/app-home.js";
|
|
@@ -78,10 +77,11 @@ export async function runTuiApp(options) {
|
|
|
78
77
|
const channelDir = ensureChannelDir(paths.workspaceDir, channelId);
|
|
79
78
|
ensureChannelMemoryFilesSync(channelDir);
|
|
80
79
|
const store = new ChannelStore({ workingDir: paths.workspaceDir });
|
|
81
|
-
const runner =
|
|
80
|
+
const runner = createRunner(channelId, channelDir, {
|
|
82
81
|
appHomeDir: paths.appHomeDir,
|
|
83
82
|
authConfigPath: paths.authConfigPath,
|
|
84
83
|
modelsConfigPath: paths.modelsConfigPath,
|
|
84
|
+
settingsManager,
|
|
85
85
|
mediaSender: createTerminalMediaSender(io),
|
|
86
86
|
});
|
|
87
87
|
const tuiSettings = settingsManager.getTuiSettings();
|
|
@@ -125,7 +125,7 @@ export async function runTuiApp(options) {
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
finally {
|
|
128
|
-
|
|
128
|
+
await runner.dispose();
|
|
129
129
|
await waitForStorageFlush(Promise.allSettled([store.close(), getUsageLedger().flush?.() ?? Promise.resolve(), flushSecurityLogs()]));
|
|
130
130
|
await waitForStorageFlush(log.flushLogging());
|
|
131
131
|
}
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|