@pasko70/pibo 1.9.2 → 1.9.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.
Files changed (120) hide show
  1. package/README.md +183 -183
  2. package/context/codex-base-prompt.md +148 -148
  3. package/context/compute-worker.md +23 -23
  4. package/context/pibo-compaction-prompt.md +100 -100
  5. package/context/pibo-native-tooling.md +18 -18
  6. package/context/pibo-system-prompt.md +77 -77
  7. package/dist/apps/chat/agent-store.js +248 -248
  8. package/dist/apps/chat/data/project-service.js +168 -168
  9. package/dist/apps/chat/data/read-state-service.js +18 -18
  10. package/dist/apps/chat/data/session-query-service.js +25 -25
  11. package/dist/apps/chat/data/timeline-query-service.js +14 -14
  12. package/dist/apps/chat/static-assets.js +854 -854
  13. package/dist/apps/chat/workflow-persistence.js +255 -255
  14. package/dist/apps/chat-ui/assets/{dist-5GM30SQK.js → dist-5WHjqNrY.js} +1 -1
  15. package/dist/apps/chat-ui/assets/{dist-Cge8JklW.js → dist-BJBNSAIH.js} +1 -1
  16. package/dist/apps/chat-ui/assets/{dist-C-5u2QIS.js → dist-C3liNPZJ.js} +1 -1
  17. package/dist/apps/chat-ui/assets/{dist-BWbWIOcD.js → dist-CW6FHEaw.js} +1 -1
  18. package/dist/apps/chat-ui/assets/{dist-CjYtD7ZT.js → dist-CaNlj6v6.js} +1 -1
  19. package/dist/apps/chat-ui/assets/{dist-BYKMZlI0.js → dist-Cne74s6i.js} +1 -1
  20. package/dist/apps/chat-ui/assets/{dist-9lsp1UpA.js → dist-DvKZv20v.js} +1 -1
  21. package/dist/apps/chat-ui/assets/{dist-DFhhiR8M.js → dist-FYH7vzrh.js} +1 -1
  22. package/dist/apps/chat-ui/assets/{dist-Etxmpyxg.js → dist-f5KioIwL.js} +1 -1
  23. package/dist/apps/chat-ui/assets/{dist-2KdPXbMT.js → dist-hWrpj7SE.js} +1 -1
  24. package/dist/apps/chat-ui/assets/{dist-Idz5kzy8.js → dist-jAuO8_bV.js} +1 -1
  25. package/dist/apps/chat-ui/assets/{index-BqD_bm7z.js → index-Bf29pJph.js} +29 -29
  26. package/dist/apps/chat-ui/index.html +17 -17
  27. package/dist/apps/chat-ui/manifest.webmanifest +25 -25
  28. package/dist/apps/chat-ui/sw.js +47 -47
  29. package/dist/apps/chat-vscode-web/assets/index-BAMxIaI_.js +41 -0
  30. package/dist/apps/chat-vscode-web/index.html +13 -13
  31. package/dist/apps/cli-ui/cliSessionsCommand.js +23 -23
  32. package/dist/apps/context-files-ui/index.html +11 -11
  33. package/dist/cli.js +39 -39
  34. package/dist/compute/cli.js +54 -54
  35. package/dist/core/session-router.js +5 -2
  36. package/dist/cron/cli.js +15 -15
  37. package/dist/cron/store.js +49 -49
  38. package/dist/data/cli.js +23 -23
  39. package/dist/data/event-log.js +23 -23
  40. package/dist/data/message-store.js +20 -20
  41. package/dist/data/navigation-store.js +9 -9
  42. package/dist/data/observation-store.js +4 -4
  43. package/dist/data/payload-store.js +17 -17
  44. package/dist/data/schema.js +431 -431
  45. package/dist/data/session-store.js +4 -4
  46. package/dist/data/telemetry-queries.js +54 -54
  47. package/dist/data/telemetry.js +197 -197
  48. package/dist/debug/events.js +12 -12
  49. package/dist/debug/failures.js +6 -6
  50. package/dist/debug/index.js +227 -227
  51. package/dist/debug/messages.js +6 -6
  52. package/dist/debug/pty.js +124 -124
  53. package/dist/debug/session.js +29 -29
  54. package/dist/debug/tools.js +5 -5
  55. package/dist/debug/web-snapshot-browser-scripts.js +294 -294
  56. package/dist/debug/web-streaming-browser-library.js +925 -925
  57. package/dist/debug/web-streaming-browser-scripts.js +232 -232
  58. package/dist/debug/web-streaming-provider-telemetry.js +4 -4
  59. package/dist/debug/web.js +93 -93
  60. package/dist/gateway/cli.js +19 -19
  61. package/dist/mcp/config-command.js +53 -53
  62. package/dist/mcp/index.js +21 -21
  63. package/dist/mcp/registry.js +11 -11
  64. package/dist/pi-packages/cli.js +11 -11
  65. package/dist/plugins/context-files-store.js +110 -110
  66. package/dist/plugins/context-files.js +4 -4
  67. package/dist/ralph/cli.js +18 -18
  68. package/dist/ralph/templates.js +140 -140
  69. package/dist/reliability/store.js +226 -226
  70. package/dist/session-ui/sessionActivity.js +30 -0
  71. package/dist/sessions/pibo-data-store.js +16 -16
  72. package/dist/sessions/sqlite-store.js +53 -53
  73. package/dist/setup/cli.js +58 -58
  74. package/dist/signals/projector.js +26 -11
  75. package/dist/signals/registry.js +41 -0
  76. package/dist/tools/agent-browser-wrapper.js +80 -80
  77. package/dist/tools/browser-use-cdp.js +12 -12
  78. package/dist/tools/browser-use-wrapper.js +762 -762
  79. package/dist/tools/guides.js +538 -538
  80. package/dist/tools/index.js +99 -99
  81. package/dist/tools/runtime/node-worker-source.js +205 -205
  82. package/dist/tools/runtime/python-worker-source.js +177 -177
  83. package/dist/vscode/cli.js +9 -9
  84. package/dist/web-annotations/cdp.js +900 -900
  85. package/dist/web-annotations/store.js +96 -96
  86. package/docs/README.md +23 -23
  87. package/docs/ops/install-developer-host.md +112 -112
  88. package/docs/ops/install-user-host.md +96 -96
  89. package/docs/ops/upgrade-user-to-developer-host.md +69 -69
  90. package/docs/ops/vscode-extension-release.md +160 -160
  91. package/package.json +95 -95
  92. package/skills/builtin/graphify/SKILL.md +52 -52
  93. package/skills/builtin/pi-agent-harness/SKILL.md +319 -319
  94. package/skills/builtin/pi-agent-harness/agents/openai.yaml +4 -4
  95. package/skills/builtin/pibo-docker-system/SKILL.md +170 -170
  96. package/skills/builtin/pibo-spec-writing/SKILL.md +330 -330
  97. package/skills/builtin/prd/SKILL.md +143 -143
  98. package/skills/builtin/ralph-loop/SKILL.md +359 -359
  99. package/skills/builtin/ralph-prd-json/SKILL.md +123 -123
  100. package/skills/builtin/skill-creator/LICENSE.txt +201 -201
  101. package/skills/builtin/skill-creator/SKILL.md +513 -513
  102. package/skills/builtin/skill-creator/agents/analyzer.md +274 -274
  103. package/skills/builtin/skill-creator/agents/comparator.md +202 -202
  104. package/skills/builtin/skill-creator/agents/grader.md +223 -223
  105. package/skills/builtin/skill-creator/assets/eval_review.html +146 -146
  106. package/skills/builtin/skill-creator/eval-viewer/generate_review.py +471 -471
  107. package/skills/builtin/skill-creator/eval-viewer/viewer.html +1325 -1325
  108. package/skills/builtin/skill-creator/references/schemas.md +430 -430
  109. package/skills/builtin/skill-creator/scripts/aggregate_benchmark.py +401 -401
  110. package/skills/builtin/skill-creator/scripts/generate_report.py +326 -326
  111. package/skills/builtin/skill-creator/scripts/improve_description.py +247 -247
  112. package/skills/builtin/skill-creator/scripts/package_skill.py +136 -136
  113. package/skills/builtin/skill-creator/scripts/quick_validate.py +102 -102
  114. package/skills/builtin/skill-creator/scripts/run_eval.py +310 -310
  115. package/skills/builtin/skill-creator/scripts/run_loop.py +328 -328
  116. package/skills/builtin/skill-creator/scripts/utils.py +47 -47
  117. package/skills/builtin/web-annotations/SKILL.md +93 -93
  118. package/src/mcp/LICENSE.mcp-cli +21 -21
  119. package/dist/apps/chat-vscode-web/assets/index-Cst9OUkC.js +0 -41
  120. package/dist/session-ui/activeTurn.js +0 -126
package/dist/debug/pty.js CHANGED
@@ -8,92 +8,92 @@ const DEFAULT_IDLE_TIMEOUT_MS = 10_000;
8
8
  const DEFAULT_INPUT_DELAY_MS = 40;
9
9
  const DEFAULT_REAL_PROVIDER_MAX_ITERATIONS = 10;
10
10
  const ARTIFACT_SCHEMA_VERSION = 1;
11
- const PYTHON_PTY_DRIVER = String.raw `
12
- import os, sys, pty, select, subprocess, signal, termios, fcntl, struct, time
13
- rows = int(os.environ.get("PIBO_PTY_ROWS", "24"))
14
- cols = int(os.environ.get("PIBO_PTY_COLS", "100"))
15
- cmd = sys.argv[1:]
16
- if cmd and cmd[0] == "--":
17
- cmd = cmd[1:]
18
- if not cmd:
19
- print("missing command", file=sys.stderr)
20
- sys.exit(64)
21
- master, slave = pty.openpty()
22
- try:
23
- fcntl.ioctl(slave, termios.TIOCSWINSZ, struct.pack("HHHH", rows, cols, 0, 0))
24
- except Exception:
25
- pass
26
- proc = subprocess.Popen(cmd, stdin=slave, stdout=slave, stderr=slave, close_fds=True, start_new_session=True)
27
- os.close(slave)
28
- os.set_blocking(master, False)
29
- os.set_blocking(sys.stdin.fileno(), False)
30
- stdin_open = True
31
-
32
- def terminate(signum, frame):
33
- try:
34
- os.killpg(proc.pid, signum)
35
- except Exception:
36
- try:
37
- proc.terminate()
38
- except Exception:
39
- pass
40
- signal.signal(signal.SIGTERM, terminate)
41
- signal.signal(signal.SIGINT, terminate)
42
-
43
- def drain_once():
44
- try:
45
- data = os.read(master, 4096)
46
- except OSError:
47
- return False
48
- if not data:
49
- return False
50
- os.write(sys.stdout.fileno(), data)
51
- sys.stdout.flush()
52
- return True
53
-
54
- exit_code = None
55
- while True:
56
- fds = [master]
57
- if stdin_open:
58
- fds.append(sys.stdin.fileno())
59
- try:
60
- readable, _, _ = select.select(fds, [], [], 0.05)
61
- except OSError:
62
- readable = []
63
- if master in readable:
64
- if not drain_once():
65
- break
66
- if stdin_open and sys.stdin.fileno() in readable:
67
- try:
68
- data = os.read(sys.stdin.fileno(), 4096)
69
- except BlockingIOError:
70
- data = b""
71
- except OSError:
72
- stdin_open = False
73
- data = b""
74
- if data:
75
- try:
76
- os.write(master, data)
77
- except OSError:
78
- pass
79
- else:
80
- stdin_open = False
81
- polled = proc.poll()
82
- if polled is not None:
83
- exit_code = polled
84
- deadline = time.time() + 0.2
85
- while time.time() < deadline and drain_once():
86
- pass
87
- break
88
- if exit_code is None:
89
- exit_code = proc.poll()
90
- if exit_code is None:
91
- try:
92
- proc.terminate()
93
- except Exception:
94
- pass
95
- exit_code = proc.wait(timeout=1)
96
- sys.exit(exit_code if exit_code is not None else 1)
11
+ const PYTHON_PTY_DRIVER = String.raw `
12
+ import os, sys, pty, select, subprocess, signal, termios, fcntl, struct, time
13
+ rows = int(os.environ.get("PIBO_PTY_ROWS", "24"))
14
+ cols = int(os.environ.get("PIBO_PTY_COLS", "100"))
15
+ cmd = sys.argv[1:]
16
+ if cmd and cmd[0] == "--":
17
+ cmd = cmd[1:]
18
+ if not cmd:
19
+ print("missing command", file=sys.stderr)
20
+ sys.exit(64)
21
+ master, slave = pty.openpty()
22
+ try:
23
+ fcntl.ioctl(slave, termios.TIOCSWINSZ, struct.pack("HHHH", rows, cols, 0, 0))
24
+ except Exception:
25
+ pass
26
+ proc = subprocess.Popen(cmd, stdin=slave, stdout=slave, stderr=slave, close_fds=True, start_new_session=True)
27
+ os.close(slave)
28
+ os.set_blocking(master, False)
29
+ os.set_blocking(sys.stdin.fileno(), False)
30
+ stdin_open = True
31
+
32
+ def terminate(signum, frame):
33
+ try:
34
+ os.killpg(proc.pid, signum)
35
+ except Exception:
36
+ try:
37
+ proc.terminate()
38
+ except Exception:
39
+ pass
40
+ signal.signal(signal.SIGTERM, terminate)
41
+ signal.signal(signal.SIGINT, terminate)
42
+
43
+ def drain_once():
44
+ try:
45
+ data = os.read(master, 4096)
46
+ except OSError:
47
+ return False
48
+ if not data:
49
+ return False
50
+ os.write(sys.stdout.fileno(), data)
51
+ sys.stdout.flush()
52
+ return True
53
+
54
+ exit_code = None
55
+ while True:
56
+ fds = [master]
57
+ if stdin_open:
58
+ fds.append(sys.stdin.fileno())
59
+ try:
60
+ readable, _, _ = select.select(fds, [], [], 0.05)
61
+ except OSError:
62
+ readable = []
63
+ if master in readable:
64
+ if not drain_once():
65
+ break
66
+ if stdin_open and sys.stdin.fileno() in readable:
67
+ try:
68
+ data = os.read(sys.stdin.fileno(), 4096)
69
+ except BlockingIOError:
70
+ data = b""
71
+ except OSError:
72
+ stdin_open = False
73
+ data = b""
74
+ if data:
75
+ try:
76
+ os.write(master, data)
77
+ except OSError:
78
+ pass
79
+ else:
80
+ stdin_open = False
81
+ polled = proc.poll()
82
+ if polled is not None:
83
+ exit_code = polled
84
+ deadline = time.time() + 0.2
85
+ while time.time() < deadline and drain_once():
86
+ pass
87
+ break
88
+ if exit_code is None:
89
+ exit_code = proc.poll()
90
+ if exit_code is None:
91
+ try:
92
+ proc.terminate()
93
+ except Exception:
94
+ pass
95
+ exit_code = proc.wait(timeout=1)
96
+ sys.exit(exit_code if exit_code is not None else 1)
97
97
  `;
98
98
  export async function runDebugPty(args) {
99
99
  if (args.length === 0 || args[0] === "--help" || args[0] === "-h") {
@@ -132,47 +132,47 @@ export async function runDebugPty(args) {
132
132
  throw new Error(`Unknown pibo debug pty command "${command}". Run pibo debug pty --help.`);
133
133
  }
134
134
  function printPtyDiscovery() {
135
- console.log(`pibo debug pty - run and inspect interactive CLI/TUI commands under a pseudo-terminal
136
-
137
- Commands:
138
- run Run one command under PTY
139
- scenario Run a declarative PTY scenario JSON file
140
- list-scenarios List built-in scenario names
141
-
142
- Usage:
143
- pibo debug pty run [options] -- <command...>
144
- pibo debug pty scenario [options] <file>
145
- pibo debug pty scenario --builtin cli-session-ui-mocked-e2e
146
-
147
- Common options:
148
- --rows <n> Terminal rows (default: ${DEFAULT_ROWS})
149
- --cols <n> Terminal columns (default: ${DEFAULT_COLS})
150
- --timeout-ms <n> Wall-clock timeout (default: ${DEFAULT_TIMEOUT_MS})
151
- --idle-timeout-ms <n> Idle timeout after no output (default: ${DEFAULT_IDLE_TIMEOUT_MS})
152
- --input-delay-ms <n> Delay between typed characters (default: ${DEFAULT_INPUT_DELAY_MS})
153
- --artifact-dir <path> Artifact directory
154
- --artifact Write artifacts for successful runs too
155
- --expect <text> Require cleaned output text (repeatable)
156
- --reject <text> Forbid cleaned output text (repeatable)
157
- --type <text> Type text as a scenario step
158
- --press <key> Press Enter, Escape, CtrlC, Up, or Down
159
- --wait-for <text> Wait until cleaned output contains text
160
- --sleep-ms <n> Sleep as a scenario step
161
- --docker-worker <name> Run inside a named Docker worker/container
162
- --workdir <path> Workdir for host cwd or Docker -w
163
- --real-provider Explicitly allow live provider scenarios
164
- --max-iterations <n> Real-provider iteration cap (default: ${DEFAULT_REAL_PROVIDER_MAX_ITERATIONS})
165
-
166
- Safety:
167
- Mocked/deterministic mode is default. Real provider mode requires --real-provider and bounded iterations.
135
+ console.log(`pibo debug pty - run and inspect interactive CLI/TUI commands under a pseudo-terminal
136
+
137
+ Commands:
138
+ run Run one command under PTY
139
+ scenario Run a declarative PTY scenario JSON file
140
+ list-scenarios List built-in scenario names
141
+
142
+ Usage:
143
+ pibo debug pty run [options] -- <command...>
144
+ pibo debug pty scenario [options] <file>
145
+ pibo debug pty scenario --builtin cli-session-ui-mocked-e2e
146
+
147
+ Common options:
148
+ --rows <n> Terminal rows (default: ${DEFAULT_ROWS})
149
+ --cols <n> Terminal columns (default: ${DEFAULT_COLS})
150
+ --timeout-ms <n> Wall-clock timeout (default: ${DEFAULT_TIMEOUT_MS})
151
+ --idle-timeout-ms <n> Idle timeout after no output (default: ${DEFAULT_IDLE_TIMEOUT_MS})
152
+ --input-delay-ms <n> Delay between typed characters (default: ${DEFAULT_INPUT_DELAY_MS})
153
+ --artifact-dir <path> Artifact directory
154
+ --artifact Write artifacts for successful runs too
155
+ --expect <text> Require cleaned output text (repeatable)
156
+ --reject <text> Forbid cleaned output text (repeatable)
157
+ --type <text> Type text as a scenario step
158
+ --press <key> Press Enter, Escape, CtrlC, Up, or Down
159
+ --wait-for <text> Wait until cleaned output contains text
160
+ --sleep-ms <n> Sleep as a scenario step
161
+ --docker-worker <name> Run inside a named Docker worker/container
162
+ --workdir <path> Workdir for host cwd or Docker -w
163
+ --real-provider Explicitly allow live provider scenarios
164
+ --max-iterations <n> Real-provider iteration cap (default: ${DEFAULT_REAL_PROVIDER_MAX_ITERATIONS})
165
+
166
+ Safety:
167
+ Mocked/deterministic mode is default. Real provider mode requires --real-provider and bounded iterations.
168
168
  `);
169
169
  }
170
170
  function printBuiltinScenarios() {
171
- console.log(`Built-in PTY scenarios:
172
- cli-session-ui-mocked-e2e Runs pibo tui:sessions without --demo using a deterministic debug fixture when available
173
-
174
- Next:
175
- pibo debug pty scenario --builtin cli-session-ui-mocked-e2e --artifact
171
+ console.log(`Built-in PTY scenarios:
172
+ cli-session-ui-mocked-e2e Runs pibo tui:sessions without --demo using a deterministic debug fixture when available
173
+
174
+ Next:
175
+ pibo debug pty scenario --builtin cli-session-ui-mocked-e2e --artifact
176
176
  `);
177
177
  }
178
178
  function parsePtyOptions(args) {
@@ -121,12 +121,12 @@ export function formatDebugSessionSummary(summary) {
121
121
  }
122
122
  function listChildSessions(db, piboSessionId, limit) {
123
123
  const rows = db
124
- .prepare(`
125
- SELECT id, pi_session_id, channel, kind, profile, room_id, root_session_id, parent_id, origin_id, workspace, title, status, metadata_json, created_at, updated_at, last_activity_at
126
- FROM sessions
127
- WHERE parent_id = ?
128
- ORDER BY created_at
129
- LIMIT ?
124
+ .prepare(`
125
+ SELECT id, pi_session_id, channel, kind, profile, room_id, root_session_id, parent_id, origin_id, workspace, title, status, metadata_json, created_at, updated_at, last_activity_at
126
+ FROM sessions
127
+ WHERE parent_id = ?
128
+ ORDER BY created_at
129
+ LIMIT ?
130
130
  `)
131
131
  .all(piboSessionId, limit);
132
132
  return rows.map((row) => {
@@ -150,35 +150,35 @@ function listChildSessions(db, piboSessionId, limit) {
150
150
  function readChatSession(db, piboSessionId) {
151
151
  if (!tableExists(db, "sessions"))
152
152
  return undefined;
153
- return db.prepare(`
154
- SELECT
155
- s.id AS pibo_session_id,
156
- s.room_id,
157
- s.root_session_id,
158
- s.status,
159
- s.last_activity_at,
160
- stats.message_count,
161
- stats.tool_call_count,
162
- stats.error_count,
163
- stats.last_event_stream_id,
164
- nav.child_count,
165
- nav.sort_key
166
- FROM sessions s
167
- LEFT JOIN session_stats stats ON stats.session_id = s.id
168
- LEFT JOIN session_navigation nav ON nav.session_id = s.id
169
- WHERE s.id = ?
153
+ return db.prepare(`
154
+ SELECT
155
+ s.id AS pibo_session_id,
156
+ s.room_id,
157
+ s.root_session_id,
158
+ s.status,
159
+ s.last_activity_at,
160
+ stats.message_count,
161
+ stats.tool_call_count,
162
+ stats.error_count,
163
+ stats.last_event_stream_id,
164
+ nav.child_count,
165
+ nav.sort_key
166
+ FROM sessions s
167
+ LEFT JOIN session_stats stats ON stats.session_id = s.id
168
+ LEFT JOIN session_navigation nav ON nav.session_id = s.id
169
+ WHERE s.id = ?
170
170
  `).get(piboSessionId);
171
171
  }
172
172
  function readEventSummaries(db, piboSessionId, limit) {
173
173
  if (!tableExists(db, "event_log"))
174
174
  return [];
175
175
  return db
176
- .prepare(`
177
- SELECT type, event_id, created_at, stream_id
178
- FROM event_log
179
- WHERE session_id = ?
180
- ORDER BY stream_id DESC
181
- LIMIT ?
176
+ .prepare(`
177
+ SELECT type, event_id, created_at, stream_id
178
+ FROM event_log
179
+ WHERE session_id = ?
180
+ ORDER BY stream_id DESC
181
+ LIMIT ?
182
182
  `)
183
183
  .all(piboSessionId, limit);
184
184
  }
@@ -9,11 +9,11 @@ export function inspectDebugTool(piboSessionId, store, selector, options = {}) {
9
9
  try {
10
10
  if (!tableExists(db, "event_log"))
11
11
  return emptyTool(piboSessionId, selector);
12
- const rows = db.prepare(`
13
- SELECT stream_id, session_id, session_sequence, event_id, type, created_at, preview_text, attributes_json
14
- FROM event_log
15
- WHERE session_id = ? AND type IN ('tool_call', 'tool_execution_started', 'tool_execution_updated', 'tool_execution_finished')
16
- ORDER BY stream_id ASC
12
+ const rows = db.prepare(`
13
+ SELECT stream_id, session_id, session_sequence, event_id, type, created_at, preview_text, attributes_json
14
+ FROM event_log
15
+ WHERE session_id = ? AND type IN ('tool_call', 'tool_execution_started', 'tool_execution_updated', 'tool_execution_finished')
16
+ ORDER BY stream_id ASC
17
17
  `).all(piboSessionId);
18
18
  const matching = rows.filter((row) => toolCallIdFromRow(row)?.includes(selector) || row.event_id === selector);
19
19
  if (matching.length === 0)