@oyasmi/pipiclaw 0.7.5 → 0.7.7

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.
Files changed (54) hide show
  1. package/README.md +11 -1
  2. package/dist/agent/channel-runner.js +7 -3
  3. package/dist/agent/commands.js +2 -1
  4. package/dist/agent/job-manager.d.ts +79 -0
  5. package/dist/agent/job-manager.js +241 -0
  6. package/dist/agent/prompt-builder.js +13 -4
  7. package/dist/agent/session-events.js +5 -0
  8. package/dist/memory/recall.js +6 -0
  9. package/dist/memory/review-log.d.ts +1 -1
  10. package/dist/models/api-keys.d.ts +5 -1
  11. package/dist/models/api-keys.js +10 -4
  12. package/dist/runtime/bootstrap.js +2 -0
  13. package/dist/runtime/dingtalk.js +13 -1
  14. package/dist/runtime/task-commands.d.ts +3 -0
  15. package/dist/runtime/task-commands.js +148 -2
  16. package/dist/shared/atomic-file.js +23 -3
  17. package/dist/shared/task-events.d.ts +32 -0
  18. package/dist/shared/task-events.js +29 -0
  19. package/dist/shared/task-ledger.d.ts +26 -0
  20. package/dist/shared/task-ledger.js +38 -0
  21. package/dist/subagents/tool.js +26 -4
  22. package/dist/tools/bash.d.ts +12 -0
  23. package/dist/tools/bash.js +67 -1
  24. package/dist/tools/config.d.ts +9 -0
  25. package/dist/tools/config.js +23 -0
  26. package/dist/tools/edit.js +0 -0
  27. package/dist/tools/grep.d.ts +19 -0
  28. package/dist/tools/grep.js +262 -0
  29. package/dist/tools/index.js +5 -0
  30. package/dist/tools/job.d.ts +13 -0
  31. package/dist/tools/job.js +92 -0
  32. package/dist/tools/memory-manage.d.ts +24 -0
  33. package/dist/tools/memory-manage.js +150 -0
  34. package/dist/tools/read.js +103 -16
  35. package/dist/tools/registry.d.ts +7 -1
  36. package/dist/tools/registry.js +31 -23
  37. package/dist/tools/session-search.js +4 -1
  38. package/dist/tools/skill-manage.d.ts +12 -5
  39. package/dist/tools/skill-manage.js +113 -15
  40. package/dist/tools/task-manage.d.ts +16 -2
  41. package/dist/tools/task-manage.js +119 -22
  42. package/dist/tools/web-cache.d.ts +11 -0
  43. package/dist/tools/web-cache.js +62 -0
  44. package/dist/tools/web-fetch.d.ts +3 -0
  45. package/dist/tools/web-fetch.js +73 -5
  46. package/dist/tui/app.js +1 -1
  47. package/dist/tui/commands.js +1 -1
  48. package/package.json +1 -1
  49. package/dist/tools/memory-save.d.ts +0 -16
  50. package/dist/tools/memory-save.js +0 -42
  51. package/dist/tools/skill-list.d.ts +0 -18
  52. package/dist/tools/skill-list.js +0 -86
  53. package/dist/tools/skill-view.d.ts +0 -13
  54. package/dist/tools/skill-view.js +0 -44
@@ -1,44 +0,0 @@
1
- import { readFile } from "node:fs/promises";
2
- import { join } from "node:path";
3
- import { Type } from "typebox";
4
- import { resolveSkillPath, resolveSkillSupportingFile } from "./skill-security.js";
5
- import { DEFAULT_MAX_BYTES, formatSize, truncateHead } from "./truncate.js";
6
- const skillViewSchema = Type.Object({
7
- label: Type.String({ description: "Brief description of why you're viewing this skill (shown to user)" }),
8
- name: Type.String({ description: "Workspace skill name" }),
9
- filePath: Type.Optional(Type.String({
10
- description: "Optional file path inside the skill directory. Defaults to SKILL.md. Supporting files must be under references/, templates/, scripts/, or assets/.",
11
- })),
12
- });
13
- function toWorkspacePath(options, hostPath) {
14
- if (hostPath.startsWith(options.workspaceDir)) {
15
- return `${options.workspacePath}${hostPath.slice(options.workspaceDir.length)}`;
16
- }
17
- return hostPath;
18
- }
19
- export function createSkillViewTool(options) {
20
- return {
21
- name: "skill_view",
22
- label: "skill_view",
23
- description: "View a workspace-level skill SKILL.md file or an allowed supporting file.",
24
- parameters: skillViewSchema,
25
- execute: async (_toolCallId, { name, filePath }) => {
26
- const skillDir = resolveSkillPath(options.workspaceDir, name);
27
- const targetPath = filePath ? resolveSkillSupportingFile(skillDir, filePath) : join(skillDir, "SKILL.md");
28
- const workspacePath = toWorkspacePath(options, targetPath);
29
- const content = await readFile(targetPath, "utf-8");
30
- // Return the raw file content (not JSON-escaped) with a small header, and cap it
31
- // with the shared truncation limits so a large supporting file cannot flood context.
32
- const truncation = truncateHead(content);
33
- let body = truncation.content;
34
- if (truncation.truncated) {
35
- body += `\n\n[Truncated at ${formatSize(DEFAULT_MAX_BYTES)}. Use the read tool on ${workspacePath} to page through the rest.]`;
36
- }
37
- const text = `Skill: ${name}\nPath: ${workspacePath}\n\n${body}`;
38
- return {
39
- content: [{ type: "text", text }],
40
- details: { kind: "skill_view", name, path: workspacePath, truncated: truncation.truncated },
41
- };
42
- },
43
- };
44
- }