@oyasmi/pipiclaw 0.9.3-beta.3 → 0.9.3-beta.4

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 (95) hide show
  1. package/dist/agent/channel-runner.d.ts +4 -18
  2. package/dist/agent/channel-runner.js +25 -120
  3. package/dist/agent/context-budget.js +1 -1
  4. package/dist/agent/job-manager.d.ts +11 -17
  5. package/dist/agent/job-manager.js +76 -65
  6. package/dist/agent/prompt/builder.js +1 -17
  7. package/dist/agent/prompt/manifest.d.ts +0 -1
  8. package/dist/agent/prompt/manifest.js +2 -2
  9. package/dist/agent/prompt/sections.js +0 -9
  10. package/dist/agent/prompt/types.d.ts +2 -18
  11. package/dist/agent/prompt/types.js +1 -1
  12. package/dist/agent/runner-factory.d.ts +4 -0
  13. package/dist/agent/session-adapter.d.ts +19 -0
  14. package/dist/agent/session-adapter.js +77 -0
  15. package/dist/app-services.d.ts +18 -0
  16. package/dist/app-services.js +43 -0
  17. package/dist/{runtime → events}/events.d.ts +1 -1
  18. package/dist/memory/journal.js +1 -1
  19. package/dist/memory/maintenance-gates.d.ts +0 -3
  20. package/dist/memory/maintenance-gates.js +2 -2
  21. package/dist/memory/maintenance-migration.d.ts +5 -0
  22. package/dist/memory/maintenance-migration.js +91 -0
  23. package/dist/memory/maintenance-state.js +5 -44
  24. package/dist/memory/migrate.js +1 -1
  25. package/dist/memory/reflect-job.d.ts +1 -9
  26. package/dist/memory/reflect-job.js +1 -3
  27. package/dist/memory/reflect.js +1 -1
  28. package/dist/memory/session-corpus.js +1 -1
  29. package/dist/memory/store.js +1 -1
  30. package/dist/models/auth-cli.js +1 -1
  31. package/dist/runtime/bootstrap.d.ts +5 -15
  32. package/dist/runtime/bootstrap.js +32 -56
  33. package/dist/runtime/subagent-commands.d.ts +2 -1
  34. package/dist/runtime/subagent-commands.js +10 -12
  35. package/dist/runtime/task-wake.d.ts +4 -5
  36. package/dist/runtime/task-wake.js +2 -12
  37. package/dist/security/types.d.ts +7 -0
  38. package/dist/security/types.js +16 -1
  39. package/dist/settings.d.ts +8 -0
  40. package/dist/settings.js +24 -1
  41. package/dist/shared/exact-keys.d.ts +13 -0
  42. package/dist/shared/exact-keys.js +1 -0
  43. package/dist/shared/format.d.ts +20 -0
  44. package/dist/shared/format.js +64 -0
  45. package/dist/shared/{fs-utils.d.ts → os.d.ts} +6 -0
  46. package/dist/shared/{fs-utils.js → os.js} +8 -0
  47. package/dist/subagents/discovery.d.ts +16 -3
  48. package/dist/subagents/discovery.js +9 -7
  49. package/dist/subagents/external/run.d.ts +2 -1
  50. package/dist/subagents/external/run.js +1 -2
  51. package/dist/subagents/external/settlement.js +10 -5
  52. package/dist/subagents/format.d.ts +1 -1
  53. package/dist/subagents/format.js +1 -1
  54. package/dist/subagents/runs.d.ts +13 -12
  55. package/dist/subagents/runs.js +108 -89
  56. package/dist/subagents/tool.d.ts +7 -7
  57. package/dist/subagents/tool.js +11 -11
  58. package/dist/tasks/brief.js +1 -0
  59. package/dist/tools/command-optimizer.js +1 -1
  60. package/dist/tools/config.d.ts +7 -0
  61. package/dist/tools/config.js +16 -1
  62. package/dist/tools/event-manage.d.ts +1 -1
  63. package/dist/tools/event-manage.js +3 -3
  64. package/dist/tools/grep.js +1 -1
  65. package/dist/tools/index.d.ts +4 -0
  66. package/dist/tools/index.js +4 -2
  67. package/dist/tools/job.js +1 -1
  68. package/dist/tools/read.js +1 -1
  69. package/dist/tools/registry.d.ts +3 -3
  70. package/dist/tools/registry.js +18 -56
  71. package/dist/tools/skill.js +1 -1
  72. package/dist/tools/subagent-manage.d.ts +2 -0
  73. package/dist/tools/subagent-manage.js +7 -7
  74. package/dist/tools/subagent-tool-names.d.ts +2 -2
  75. package/dist/tools/subagent-tool-names.js +2 -2
  76. package/dist/tools/task-manage/shared.js +4 -9
  77. package/dist/tools/task-manage/types.d.ts +4 -0
  78. package/dist/tui/app.js +22 -7
  79. package/dist/web/config.js +1 -1
  80. package/package.json +2 -1
  81. package/dist/shared/duration.d.ts +0 -2
  82. package/dist/shared/duration.js +0 -7
  83. package/dist/shared/file-stamp.d.ts +0 -10
  84. package/dist/shared/file-stamp.js +0 -19
  85. package/dist/shared/numeric.d.ts +0 -7
  86. package/dist/shared/numeric.js +0 -19
  87. package/dist/shared/shell-escape.d.ts +0 -5
  88. package/dist/shared/shell-escape.js +0 -7
  89. package/dist/shared/token-estimate.d.ts +0 -1
  90. package/dist/shared/token-estimate.js +0 -19
  91. /package/dist/{runtime → events}/event-commands.d.ts +0 -0
  92. /package/dist/{runtime → events}/event-commands.js +0 -0
  93. /package/dist/{runtime → events}/event-validation.d.ts +0 -0
  94. /package/dist/{runtime → events}/event-validation.js +0 -0
  95. /package/dist/{runtime → events}/events.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oyasmi/pipiclaw",
3
- "version": "0.9.3-beta.3",
3
+ "version": "0.9.3-beta.4",
4
4
  "description": "An AI assistant runtime for coding and team workflows, with DingTalk AI Cards, sub-agents, memory, and scheduled events.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -41,6 +41,7 @@
41
41
  "eval:regrade": "npm run eval:build && node dist-evals/evals/harness/regrade.js",
42
42
  "eval:report": "npm run eval:build && node dist-evals/evals/harness/report.js",
43
43
  "eval:promote": "npm run eval:build && node dist-evals/evals/harness/promote.js",
44
+ "eval:prune": "node scripts/prune-eval-results.mjs",
44
45
  "test:coverage": "vitest --run --coverage",
45
46
  "check": "npm run lint && npm run typecheck && npm run deadcode && npm run test",
46
47
  "prepublishOnly": "npm run clean && npm run build && npm run check",
@@ -1,2 +0,0 @@
1
- /** Render a millisecond duration as compact human text (`"42s"`, `"3m7s"`). */
2
- export declare function formatDuration(ms: number): string;
@@ -1,7 +0,0 @@
1
- /** Render a millisecond duration as compact human text (`"42s"`, `"3m7s"`). */
2
- export function formatDuration(ms) {
3
- const seconds = Math.round(ms / 1000);
4
- if (seconds < 60)
5
- return `${seconds}s`;
6
- return `${Math.floor(seconds / 60)}m${seconds % 60}s`;
7
- }
@@ -1,10 +0,0 @@
1
- /**
2
- * A cheap change token for a config file: `mtime:ctime:size`, or `""` when the file
3
- * cannot be stat'ed (missing or unreadable — itself a stable state worth caching).
4
- *
5
- * Used by the hot re-read paths (`settings.json` on every driver/maintenance tick,
6
- * `tools.json` on every driver tick) to skip a JSON parse when nothing changed. Same
7
- * triple as the task-ledger parse cache: mtime alone misses an atomic-rename overwrite
8
- * that preserves the timestamp, ctime catches the rename, size catches the rest.
9
- */
10
- export declare function fileStamp(path: string): string;
@@ -1,19 +0,0 @@
1
- import { statSync } from "node:fs";
2
- /**
3
- * A cheap change token for a config file: `mtime:ctime:size`, or `""` when the file
4
- * cannot be stat'ed (missing or unreadable — itself a stable state worth caching).
5
- *
6
- * Used by the hot re-read paths (`settings.json` on every driver/maintenance tick,
7
- * `tools.json` on every driver tick) to skip a JSON parse when nothing changed. Same
8
- * triple as the task-ledger parse cache: mtime alone misses an atomic-rename overwrite
9
- * that preserves the timestamp, ctime catches the rename, size catches the rest.
10
- */
11
- export function fileStamp(path) {
12
- try {
13
- const stats = statSync(path);
14
- return `${stats.mtimeMs}:${stats.ctimeMs}:${stats.size}`;
15
- }
16
- catch {
17
- return "";
18
- }
19
- }
@@ -1,7 +0,0 @@
1
- /**
2
- * Coerce an untrusted numeric config/request value into an integer within `[minimum, maximum]`,
3
- * falling back to `fallback` for anything not a finite number or out of range. Shared by the
4
- * app-level config loaders (`tools.json`) and web request parameter resolution — both need the
5
- * same "trust nothing, fail closed to a safe default" numeric parsing.
6
- */
7
- export declare function clampInteger(value: unknown, fallback: number, minimum: number, maximum?: number): number;
@@ -1,19 +0,0 @@
1
- /**
2
- * Coerce an untrusted numeric config/request value into an integer within `[minimum, maximum]`,
3
- * falling back to `fallback` for anything not a finite number or out of range. Shared by the
4
- * app-level config loaders (`tools.json`) and web request parameter resolution — both need the
5
- * same "trust nothing, fail closed to a safe default" numeric parsing.
6
- */
7
- export function clampInteger(value, fallback, minimum, maximum) {
8
- if (typeof value !== "number" || !Number.isFinite(value)) {
9
- return fallback;
10
- }
11
- const normalized = Math.floor(value);
12
- if (normalized < minimum) {
13
- return fallback;
14
- }
15
- if (maximum !== undefined && normalized > maximum) {
16
- return fallback;
17
- }
18
- return normalized;
19
- }
@@ -1,5 +0,0 @@
1
- /**
2
- * Shell-escape a string for safe use in sh -c commands.
3
- * Wraps in single quotes and escapes internal single quotes.
4
- */
5
- export declare function shellEscape(s: string): string;
@@ -1,7 +0,0 @@
1
- /**
2
- * Shell-escape a string for safe use in sh -c commands.
3
- * Wraps in single quotes and escapes internal single quotes.
4
- */
5
- export function shellEscape(s) {
6
- return `'${s.replace(/'/g, "'\\''")}'`;
7
- }
@@ -1 +0,0 @@
1
- export declare function estimateTokens(text: string): number;
@@ -1,19 +0,0 @@
1
- /**
2
- * Rough token estimate, shared by everything that has to reason about context size without
3
- * calling a tokenizer. CJK runs about one token per character, Latin text about four characters
4
- * per token; the provider's real tokenizer is the authority, and the usage ledger records what
5
- * it billed.
6
- *
7
- * The script split matters wherever the estimate gates behavior rather than just reporting: a
8
- * flat characters-per-token ratio tuned for Latin text underestimates Chinese input roughly
9
- * threefold, so a budget check would clear a message that in fact does not fit.
10
- */
11
- const CJK_REGEX = /\p{Script=Han}|\p{Script=Hiragana}|\p{Script=Katakana}|\p{Script=Hangul}/u;
12
- export function estimateTokens(text) {
13
- let cjk = 0;
14
- for (const char of text) {
15
- if (CJK_REGEX.test(char))
16
- cjk++;
17
- }
18
- return Math.ceil(cjk + (text.length - cjk) / 4);
19
- }
File without changes
File without changes
File without changes
File without changes
File without changes