@pasko70/pibo 1.9.13 → 1.10.0

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 (139) 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-profiles.js +2 -2
  8. package/dist/apps/chat/agent-store.js +263 -250
  9. package/dist/apps/chat/chat-request-normalizers.js +10 -0
  10. package/dist/apps/chat/data/project-service.js +168 -168
  11. package/dist/apps/chat/data/read-state-service.js +18 -18
  12. package/dist/apps/chat/data/session-query-service.js +25 -25
  13. package/dist/apps/chat/data/timeline-query-service.js +19 -19
  14. package/dist/apps/chat/loop-api.js +176 -0
  15. package/dist/apps/chat/static-assets.js +854 -854
  16. package/dist/apps/chat/web-app.js +6 -6
  17. package/dist/apps/chat/workflow-manual-trigger-runtime.js +149 -46
  18. package/dist/apps/chat/workflow-persistence.js +255 -255
  19. package/dist/apps/chat-ui/assets/{dist-yCYNNb5d.js → dist-BwKObYnX.js} +1 -1
  20. package/dist/apps/chat-ui/assets/{dist-BCB6zezO.js → dist-CKtT8YGm.js} +1 -1
  21. package/dist/apps/chat-ui/assets/{dist-CnVsqwSG.js → dist-CS7wdk0Z.js} +1 -1
  22. package/dist/apps/chat-ui/assets/{dist-HqTN67dc.js → dist-D-cxLQO1.js} +1 -1
  23. package/dist/apps/chat-ui/assets/{dist-BNMu92bb.js → dist-DUlaXAk7.js} +1 -1
  24. package/dist/apps/chat-ui/assets/{dist-CzE6k3F3.js → dist-DlATLa-U.js} +1 -1
  25. package/dist/apps/chat-ui/assets/{dist-Dq4GxJi3.js → dist-GdEM8UW1.js} +1 -1
  26. package/dist/apps/chat-ui/assets/{dist-BZ2eTC4f.js → dist-LHRs1Nhr.js} +1 -1
  27. package/dist/apps/chat-ui/assets/{dist-D811wJeV.js → dist-Y-AA2omI.js} +1 -1
  28. package/dist/apps/chat-ui/assets/{dist-WyXdYl-w.js → dist-nOLTkZrJ.js} +1 -1
  29. package/dist/apps/chat-ui/assets/{dist-BHa-kcGl.js → dist-wE9nop9V.js} +1 -1
  30. package/dist/apps/chat-ui/assets/{index-DwHJfmiF.js → index-8W_yMHQI.js} +6 -6
  31. package/dist/apps/chat-ui/index.html +17 -17
  32. package/dist/apps/chat-ui/manifest.webmanifest +25 -25
  33. package/dist/apps/chat-ui/sw.js +47 -47
  34. package/dist/apps/chat-vscode-web/index.html +12 -12
  35. package/dist/apps/cli-ui/cliSessionsCommand.js +23 -23
  36. package/dist/apps/context-files-ui/index.html +11 -11
  37. package/dist/cli.js +61 -44
  38. package/dist/compute/cli.js +54 -54
  39. package/dist/core/routed-session.js +30 -1
  40. package/dist/core/runtime.js +6 -1
  41. package/dist/core/session-router.js +4 -2
  42. package/dist/cron/cli.js +15 -15
  43. package/dist/cron/store.js +49 -49
  44. package/dist/data/cli.js +23 -23
  45. package/dist/data/event-log.js +23 -23
  46. package/dist/data/message-store.js +27 -27
  47. package/dist/data/navigation-store.js +9 -9
  48. package/dist/data/observation-store.js +4 -4
  49. package/dist/data/payload-store.js +17 -17
  50. package/dist/data/schema.js +433 -433
  51. package/dist/data/session-store.js +4 -4
  52. package/dist/data/telemetry-queries.js +54 -54
  53. package/dist/data/telemetry.js +197 -197
  54. package/dist/debug/events.js +12 -12
  55. package/dist/debug/failures.js +6 -6
  56. package/dist/debug/index.js +227 -227
  57. package/dist/debug/messages.js +6 -6
  58. package/dist/debug/pty.js +124 -124
  59. package/dist/debug/session.js +29 -29
  60. package/dist/debug/tools.js +5 -5
  61. package/dist/debug/web-snapshot-browser-scripts.js +294 -294
  62. package/dist/debug/web-streaming-browser-library.js +925 -925
  63. package/dist/debug/web-streaming-browser-scripts.js +232 -232
  64. package/dist/debug/web-streaming-provider-telemetry.js +4 -4
  65. package/dist/debug/web.js +93 -93
  66. package/dist/gateway/cli.js +19 -19
  67. package/dist/gateway/server.js +4 -2
  68. package/dist/gateway/web.js +2 -2
  69. package/dist/loops/channel.js +8 -0
  70. package/dist/loops/cli.js +208 -0
  71. package/dist/loops/plugin.js +16 -0
  72. package/dist/loops/prompts.js +83 -0
  73. package/dist/loops/service.js +357 -0
  74. package/dist/loops/stopping.js +170 -0
  75. package/dist/loops/store.js +531 -0
  76. package/dist/loops/templates.js +232 -0
  77. package/dist/loops/tools.js +167 -0
  78. package/dist/loops/types.js +1 -0
  79. package/dist/mcp/config-command.js +53 -53
  80. package/dist/mcp/index.js +21 -21
  81. package/dist/mcp/registry.js +11 -11
  82. package/dist/pi-packages/cli.js +11 -11
  83. package/dist/plugins/builtin.js +8 -0
  84. package/dist/plugins/context-files-store.js +110 -110
  85. package/dist/plugins/context-files.js +4 -4
  86. package/dist/plugins/registry.js +23 -12
  87. package/dist/ralph/cli.js +18 -18
  88. package/dist/ralph/templates.js +140 -140
  89. package/dist/reliability/store.js +226 -226
  90. package/dist/sessions/pibo-data-store.js +16 -16
  91. package/dist/sessions/sqlite-store.js +53 -53
  92. package/dist/setup/cli.js +58 -58
  93. package/dist/tools/agent-browser-wrapper.js +80 -80
  94. package/dist/tools/browser-use-cdp.js +12 -12
  95. package/dist/tools/browser-use-wrapper.js +762 -762
  96. package/dist/tools/guides.js +589 -538
  97. package/dist/tools/index.js +122 -99
  98. package/dist/tools/registry.js +21 -3
  99. package/dist/tools/runtime/node-worker-source.js +205 -205
  100. package/dist/tools/runtime/python-worker-source.js +177 -177
  101. package/dist/vscode/cli.js +9 -9
  102. package/dist/web-annotations/cdp.js +900 -900
  103. package/dist/web-annotations/store.js +96 -96
  104. package/docs/README.md +23 -23
  105. package/docs/ops/install-developer-host.md +112 -112
  106. package/docs/ops/install-user-host.md +96 -96
  107. package/docs/ops/upgrade-user-to-developer-host.md +69 -69
  108. package/docs/ops/vscode-extension-release.md +160 -160
  109. package/package.json +98 -95
  110. package/skills/builtin/graphify/SKILL.md +52 -52
  111. package/skills/builtin/loop/SKILL.md +69 -0
  112. package/skills/builtin/pi-agent-harness/SKILL.md +319 -319
  113. package/skills/builtin/pi-agent-harness/agents/openai.yaml +4 -4
  114. package/skills/builtin/pibo-docker-system/SKILL.md +170 -170
  115. package/skills/builtin/pibo-spec-writing/SKILL.md +330 -330
  116. package/skills/builtin/prd/SKILL.md +143 -143
  117. package/skills/builtin/ralph-loop/SKILL.md +361 -359
  118. package/skills/builtin/ralph-prd-json/SKILL.md +123 -123
  119. package/skills/builtin/skill-creator/LICENSE.txt +201 -201
  120. package/skills/builtin/skill-creator/SKILL.md +513 -513
  121. package/skills/builtin/skill-creator/agents/analyzer.md +274 -274
  122. package/skills/builtin/skill-creator/agents/comparator.md +202 -202
  123. package/skills/builtin/skill-creator/agents/grader.md +223 -223
  124. package/skills/builtin/skill-creator/assets/eval_review.html +146 -146
  125. package/skills/builtin/skill-creator/eval-viewer/generate_review.py +471 -471
  126. package/skills/builtin/skill-creator/eval-viewer/viewer.html +1325 -1325
  127. package/skills/builtin/skill-creator/references/schemas.md +430 -430
  128. package/skills/builtin/skill-creator/scripts/aggregate_benchmark.py +401 -401
  129. package/skills/builtin/skill-creator/scripts/generate_report.py +326 -326
  130. package/skills/builtin/skill-creator/scripts/improve_description.py +247 -247
  131. package/skills/builtin/skill-creator/scripts/package_skill.py +136 -136
  132. package/skills/builtin/skill-creator/scripts/quick_validate.py +102 -102
  133. package/skills/builtin/skill-creator/scripts/run_eval.py +310 -310
  134. package/skills/builtin/skill-creator/scripts/run_loop.py +328 -328
  135. package/skills/builtin/skill-creator/scripts/utils.py +47 -47
  136. package/skills/builtin/web-annotations/SKILL.md +93 -93
  137. package/src/mcp/LICENSE.mcp-cli +21 -21
  138. package/dist/apps/vscode-artifacts/latest.vsix +0 -0
  139. package/dist/apps/vscode-artifacts/pibo-vscode-ext-1.9.13.vsix +0 -0
@@ -179,11 +179,11 @@ export class WebAnnotationStore {
179
179
  createdAt: timestamp,
180
180
  updatedAt: timestamp,
181
181
  };
182
- this.db.prepare(`
183
- INSERT OR IGNORE INTO web_annotation_bindings (
184
- id, pibo_session_id, pibo_room_id, state, url, title, target_id,
185
- created_at, updated_at, last_injected_at, closed_at, error, metadata_json
186
- ) VALUES (${Array.from({ length: BINDING_COLUMNS.length }, () => "?").join(", ")})
182
+ this.db.prepare(`
183
+ INSERT OR IGNORE INTO web_annotation_bindings (
184
+ id, pibo_session_id, pibo_room_id, state, url, title, target_id,
185
+ created_at, updated_at, last_injected_at, closed_at, error, metadata_json
186
+ ) VALUES (${Array.from({ length: BINDING_COLUMNS.length }, () => "?").join(", ")})
187
187
  `).run(binding.id, binding.piboSessionId, binding.piboRoomId ?? null, binding.state, binding.url, binding.title ?? null, binding.targetId ?? null, binding.createdAt, binding.updatedAt ?? null, null, null, null, stringifyJson(binding.metadata));
188
188
  const existing = this.getBinding(binding.piboSessionId, binding.id);
189
189
  if (!existing)
@@ -192,24 +192,24 @@ export class WebAnnotationStore {
192
192
  }
193
193
  listBindings(input) {
194
194
  const limit = normalizeLimit(input.limit, 100, 500);
195
- return this.db.prepare(`
196
- SELECT * FROM web_annotation_bindings
197
- WHERE pibo_session_id = ? AND state != 'removed'
198
- ORDER BY created_at DESC, id DESC
199
- LIMIT ?
195
+ return this.db.prepare(`
196
+ SELECT * FROM web_annotation_bindings
197
+ WHERE pibo_session_id = ? AND state != 'removed'
198
+ ORDER BY created_at DESC, id DESC
199
+ LIMIT ?
200
200
  `).all(input.piboSessionId, limit).map(bindingFromRow);
201
201
  }
202
202
  getBinding(piboSessionId, id) {
203
- const row = this.db.prepare(`
204
- SELECT * FROM web_annotation_bindings
205
- WHERE id = ? AND pibo_session_id = ?
203
+ const row = this.db.prepare(`
204
+ SELECT * FROM web_annotation_bindings
205
+ WHERE id = ? AND pibo_session_id = ?
206
206
  `).get(id, piboSessionId);
207
207
  return row ? bindingFromRow(row) : undefined;
208
208
  }
209
209
  getBindingById(id) {
210
- const row = this.db.prepare(`
211
- SELECT * FROM web_annotation_bindings
212
- WHERE id = ? AND state != 'removed'
210
+ const row = this.db.prepare(`
211
+ SELECT * FROM web_annotation_bindings
212
+ WHERE id = ? AND state != 'removed'
213
213
  `).get(id);
214
214
  return row ? bindingFromRow(row) : undefined;
215
215
  }
@@ -221,18 +221,18 @@ export class WebAnnotationStore {
221
221
  return undefined;
222
222
  const state = normalized.state ?? existing.state;
223
223
  const timestamp = nowIso(now);
224
- this.db.prepare(`
225
- UPDATE web_annotation_bindings
226
- SET state = ?, title = ?, target_id = ?, updated_at = ?, last_injected_at = ?, closed_at = ?, error = ?, metadata_json = ?
227
- WHERE id = ? AND pibo_session_id = ?
224
+ this.db.prepare(`
225
+ UPDATE web_annotation_bindings
226
+ SET state = ?, title = ?, target_id = ?, updated_at = ?, last_injected_at = ?, closed_at = ?, error = ?, metadata_json = ?
227
+ WHERE id = ? AND pibo_session_id = ?
228
228
  `).run(state, normalized.title !== undefined ? normalized.title : existing.title ?? null, normalized.targetId !== undefined ? normalized.targetId : existing.targetId ?? null, timestamp, normalized.lastInjectedAt !== undefined ? normalized.lastInjectedAt : existing.lastInjectedAt ?? null, normalized.closedAt !== undefined ? normalized.closedAt : existing.closedAt ?? null, normalized.error !== undefined ? normalized.error : existing.error ?? null, normalized.metadata !== undefined ? stringifyJson(normalized.metadata) : stringifyJson(existing.metadata), id, piboSessionId);
229
229
  return this.getBinding(piboSessionId, id);
230
230
  }
231
231
  removeBinding(piboSessionId, id, now = new Date()) {
232
- const result = this.db.prepare(`
233
- UPDATE web_annotation_bindings
234
- SET state = 'removed', updated_at = ?
235
- WHERE id = ? AND pibo_session_id = ?
232
+ const result = this.db.prepare(`
233
+ UPDATE web_annotation_bindings
234
+ SET state = 'removed', updated_at = ?
235
+ WHERE id = ? AND pibo_session_id = ?
236
236
  `).run(nowIso(now), id, piboSessionId);
237
237
  return Number(result.changes ?? 0) > 0;
238
238
  }
@@ -258,12 +258,12 @@ export class WebAnnotationStore {
258
258
  createdAt: timestamp,
259
259
  updatedAt: timestamp,
260
260
  };
261
- this.db.prepare(`
262
- INSERT OR IGNORE INTO web_annotations (
263
- id, pibo_session_id, pibo_room_id, binding_id, status, note, url, title,
264
- target_id, target_kind, viewport_json, target_json, screenshot_ref_json, thread_json,
265
- created_at, updated_at, resolved_at, resolved_by, summary, metadata_json
266
- ) VALUES (${Array.from({ length: ANNOTATION_COLUMNS.length }, () => "?").join(", ")})
261
+ this.db.prepare(`
262
+ INSERT OR IGNORE INTO web_annotations (
263
+ id, pibo_session_id, pibo_room_id, binding_id, status, note, url, title,
264
+ target_id, target_kind, viewport_json, target_json, screenshot_ref_json, thread_json,
265
+ created_at, updated_at, resolved_at, resolved_by, summary, metadata_json
266
+ ) VALUES (${Array.from({ length: ANNOTATION_COLUMNS.length }, () => "?").join(", ")})
267
267
  `).run(annotation.id, annotation.piboSessionId, annotation.piboRoomId ?? null, annotation.bindingId ?? null, annotation.status, annotation.note, annotation.url, annotation.title ?? null, annotation.targetId ?? null, annotation.targetKind, stringifyJson(annotation.viewport), stringifyJson(annotation.target), stringifyJson(annotation.screenshotRef), null, annotation.createdAt, annotation.updatedAt ?? null, null, null, null, stringifyJson(annotation.metadata));
268
268
  const existing = this.getAnnotation(annotation.piboSessionId, annotation.id);
269
269
  if (!existing)
@@ -285,24 +285,24 @@ export class WebAnnotationStore {
285
285
  values.push(input.status);
286
286
  }
287
287
  const where = clauses.length ? `WHERE ${clauses.join(" AND ")}` : "";
288
- return this.db.prepare(`
289
- SELECT * FROM web_annotations
290
- ${where}
291
- ORDER BY created_at DESC, id DESC
292
- LIMIT ?
288
+ return this.db.prepare(`
289
+ SELECT * FROM web_annotations
290
+ ${where}
291
+ ORDER BY created_at DESC, id DESC
292
+ LIMIT ?
293
293
  `).all(...values, limit).map(annotationFromRow);
294
294
  }
295
295
  getAnnotation(piboSessionId, id) {
296
- const row = this.db.prepare(`
297
- SELECT * FROM web_annotations
298
- WHERE id = ? AND pibo_session_id = ?
296
+ const row = this.db.prepare(`
297
+ SELECT * FROM web_annotations
298
+ WHERE id = ? AND pibo_session_id = ?
299
299
  `).get(id, piboSessionId);
300
300
  return row ? annotationFromRow(row) : undefined;
301
301
  }
302
302
  getAnnotationById(id) {
303
- const row = this.db.prepare(`
304
- SELECT * FROM web_annotations
305
- WHERE id = ?
303
+ const row = this.db.prepare(`
304
+ SELECT * FROM web_annotations
305
+ WHERE id = ?
306
306
  `).get(id);
307
307
  return row ? annotationFromRow(row) : undefined;
308
308
  }
@@ -315,10 +315,10 @@ export class WebAnnotationStore {
315
315
  const timestamp = nowIso(now);
316
316
  const status = normalized.status ?? existing.status;
317
317
  const resolvedAt = status === "resolved" && !existing.resolvedAt ? timestamp : existing.resolvedAt ?? null;
318
- this.db.prepare(`
319
- UPDATE web_annotations
320
- SET status = ?, updated_at = ?, resolved_at = ?, resolved_by = ?, summary = ?, metadata_json = ?
321
- WHERE id = ? AND pibo_session_id = ?
318
+ this.db.prepare(`
319
+ UPDATE web_annotations
320
+ SET status = ?, updated_at = ?, resolved_at = ?, resolved_by = ?, summary = ?, metadata_json = ?
321
+ WHERE id = ? AND pibo_session_id = ?
322
322
  `).run(status, timestamp, resolvedAt, normalized.resolvedBy !== undefined ? normalized.resolvedBy : existing.resolvedBy ?? null, normalized.summary !== undefined ? normalized.summary : existing.summary ?? null, normalized.metadata !== undefined ? stringifyJson(normalized.metadata) : stringifyJson(existing.metadata), id, piboSessionId);
323
323
  return this.getAnnotation(piboSessionId, id);
324
324
  }
@@ -344,61 +344,61 @@ export class WebAnnotationStore {
344
344
  ...thread,
345
345
  { id: normalized.id ?? `wat_${randomUUID()}`, role: normalized.role, content: normalized.content, createdAt: timestamp },
346
346
  ];
347
- this.db.prepare(`
348
- UPDATE web_annotations
349
- SET thread_json = ?, updated_at = ?
350
- WHERE id = ? AND pibo_session_id = ?
347
+ this.db.prepare(`
348
+ UPDATE web_annotations
349
+ SET thread_json = ?, updated_at = ?
350
+ WHERE id = ? AND pibo_session_id = ?
351
351
  `).run(stringifyJson(nextThread), timestamp, normalized.annotationId, normalized.piboSessionId);
352
352
  return this.getAnnotation(normalized.piboSessionId, normalized.annotationId);
353
353
  }
354
354
  applySchema() {
355
- this.db.exec(`
356
- CREATE TABLE IF NOT EXISTS web_annotation_bindings (
357
- id TEXT PRIMARY KEY,
358
- pibo_session_id TEXT NOT NULL,
359
- pibo_room_id TEXT,
360
- state TEXT NOT NULL,
361
- url TEXT NOT NULL,
362
- title TEXT,
363
- target_id TEXT,
364
- created_at TEXT NOT NULL,
365
- updated_at TEXT,
366
- last_injected_at TEXT,
367
- closed_at TEXT,
368
- error TEXT,
369
- metadata_json TEXT
370
- );
371
- CREATE INDEX IF NOT EXISTS idx_web_annotation_bindings_session
372
- ON web_annotation_bindings(pibo_session_id, created_at DESC);
373
- CREATE INDEX IF NOT EXISTS idx_web_annotation_bindings_target
374
- ON web_annotation_bindings(target_id, state);
375
-
376
- CREATE TABLE IF NOT EXISTS web_annotations (
377
- id TEXT PRIMARY KEY,
378
- pibo_session_id TEXT NOT NULL,
379
- pibo_room_id TEXT,
380
- binding_id TEXT,
381
- status TEXT NOT NULL,
382
- note TEXT NOT NULL,
383
- url TEXT NOT NULL,
384
- title TEXT,
385
- target_id TEXT,
386
- target_kind TEXT NOT NULL,
387
- viewport_json TEXT NOT NULL,
388
- target_json TEXT,
389
- screenshot_ref_json TEXT,
390
- thread_json TEXT,
391
- created_at TEXT NOT NULL,
392
- updated_at TEXT,
393
- resolved_at TEXT,
394
- resolved_by TEXT,
395
- summary TEXT,
396
- metadata_json TEXT
397
- );
398
- CREATE INDEX IF NOT EXISTS idx_web_annotations_session_status_created
399
- ON web_annotations(pibo_session_id, status, created_at DESC);
400
- CREATE INDEX IF NOT EXISTS idx_web_annotations_session_created
401
- ON web_annotations(pibo_session_id, created_at DESC);
355
+ this.db.exec(`
356
+ CREATE TABLE IF NOT EXISTS web_annotation_bindings (
357
+ id TEXT PRIMARY KEY,
358
+ pibo_session_id TEXT NOT NULL,
359
+ pibo_room_id TEXT,
360
+ state TEXT NOT NULL,
361
+ url TEXT NOT NULL,
362
+ title TEXT,
363
+ target_id TEXT,
364
+ created_at TEXT NOT NULL,
365
+ updated_at TEXT,
366
+ last_injected_at TEXT,
367
+ closed_at TEXT,
368
+ error TEXT,
369
+ metadata_json TEXT
370
+ );
371
+ CREATE INDEX IF NOT EXISTS idx_web_annotation_bindings_session
372
+ ON web_annotation_bindings(pibo_session_id, created_at DESC);
373
+ CREATE INDEX IF NOT EXISTS idx_web_annotation_bindings_target
374
+ ON web_annotation_bindings(target_id, state);
375
+
376
+ CREATE TABLE IF NOT EXISTS web_annotations (
377
+ id TEXT PRIMARY KEY,
378
+ pibo_session_id TEXT NOT NULL,
379
+ pibo_room_id TEXT,
380
+ binding_id TEXT,
381
+ status TEXT NOT NULL,
382
+ note TEXT NOT NULL,
383
+ url TEXT NOT NULL,
384
+ title TEXT,
385
+ target_id TEXT,
386
+ target_kind TEXT NOT NULL,
387
+ viewport_json TEXT NOT NULL,
388
+ target_json TEXT,
389
+ screenshot_ref_json TEXT,
390
+ thread_json TEXT,
391
+ created_at TEXT NOT NULL,
392
+ updated_at TEXT,
393
+ resolved_at TEXT,
394
+ resolved_by TEXT,
395
+ summary TEXT,
396
+ metadata_json TEXT
397
+ );
398
+ CREATE INDEX IF NOT EXISTS idx_web_annotations_session_status_created
399
+ ON web_annotations(pibo_session_id, status, created_at DESC);
400
+ CREATE INDEX IF NOT EXISTS idx_web_annotations_session_created
401
+ ON web_annotations(pibo_session_id, created_at DESC);
402
402
  `);
403
403
  }
404
404
  }
package/docs/README.md CHANGED
@@ -1,23 +1,23 @@
1
- # Pibo Documentation
2
-
3
- This directory is the single home for project documentation, specs, plans, and reports.
4
-
5
- ## Structure
6
-
7
- ```text
8
- docs/
9
- project/ Normal/current project docs and other canonical documentation
10
- specs/ Product, technical, and implementation specifications
11
- plans/ Implementation plans and design plans
12
- reports/ Investigation reports, validation reports, and generated report artifacts
13
- legacy/ Previous documentation set kept for reference
14
- ```
15
-
16
- ## Rules
17
-
18
- - Put normal/current project docs and other canonical documentation in `docs/project/`.
19
- - Put specifications in `docs/specs/`.
20
- - Put implementation plans in `docs/plans/`.
21
- - Put investigation, validation, and incident reports in `docs/reports/`.
22
- - Do not create new root-level `plans/`, `reports/`, or `specs/` directories.
23
- - Do not delete legacy docs unless there is a separate cleanup decision.
1
+ # Pibo Documentation
2
+
3
+ This directory is the single home for project documentation, specs, plans, and reports.
4
+
5
+ ## Structure
6
+
7
+ ```text
8
+ docs/
9
+ project/ Normal/current project docs and other canonical documentation
10
+ specs/ Product, technical, and implementation specifications
11
+ plans/ Implementation plans and design plans
12
+ reports/ Investigation reports, validation reports, and generated report artifacts
13
+ legacy/ Previous documentation set kept for reference
14
+ ```
15
+
16
+ ## Rules
17
+
18
+ - Put normal/current project docs and other canonical documentation in `docs/project/`.
19
+ - Put specifications in `docs/specs/`.
20
+ - Put implementation plans in `docs/plans/`.
21
+ - Put investigation, validation, and incident reports in `docs/reports/`.
22
+ - Do not create new root-level `plans/`, `reports/`, or `specs/` directories.
23
+ - Do not delete legacy docs unless there is a separate cleanup decision.
@@ -1,112 +1,112 @@
1
- # Install Pibo as a Developer Host
2
-
3
- Use this path when the host is used to develop Pibo itself.
4
-
5
- ## Philosophy
6
-
7
- Production must stay stable while development moves quickly. The dev gateway can restart, fail, or deploy the `dev` branch without interrupting the main production gateway.
8
-
9
- Docker compute workers are part of the developer setup. Each agent should get its own isolated container and gateway so agent restarts do not disturb other agents or the host gateways.
10
-
11
- ## Target layout
12
-
13
- ```text
14
- /root/code/pibo main / production
15
- /root/code/pibo/.worktrees/dev dev / development
16
-
17
- /root/.pibo production data
18
- /root/.pibo-dev development data
19
-
20
- pibo-web.service prod web 4788, gateway 4789
21
- pibo-web-dev.service dev web 4808, gateway 4809
22
- ```
23
-
24
- ## Remotes
25
-
26
- Each developer host should use its own fork as `origin` and the canonical repo as `upstream`:
27
-
28
- ```text
29
- origin git@github.com:<server-or-user-fork>/pibo.git
30
- upstream git@github.com:Pascapone/pibo.git
31
- ```
32
-
33
- ## Plan the setup
34
-
35
- ```bash
36
- pibo setup developer-host \
37
- --origin git@github.com:<server-or-user-fork>/pibo.git \
38
- --upstream git@github.com:Pascapone/pibo.git \
39
- --prod-domain pibo.example.com \
40
- --dev-domain dev.pibo.example.com \
41
- --print-files
42
- ```
43
-
44
- Review the generated systemd units, dev start wrapper, environment template, and Caddyfile. Stage files before applying when testing a fresh host:
45
-
46
- ```bash
47
- pibo setup developer-host \
48
- --origin git@github.com:<server-or-user-fork>/pibo.git \
49
- --prod-domain pibo.example.com \
50
- --dev-domain dev.pibo.example.com \
51
- --write-to /tmp/pibo-setup
52
- ```
53
-
54
- Apply after review:
55
-
56
- ```bash
57
- pibo setup developer-host \
58
- --origin git@github.com:<server-or-user-fork>/pibo.git \
59
- --prod-domain pibo.example.com \
60
- --dev-domain dev.pibo.example.com \
61
- --apply --yes
62
- systemctl daemon-reload
63
- ```
64
-
65
- ## Important detail: service pinning
66
-
67
- Do not globally install the dev worktree over the production install. `npm install -g .` from a local checkout creates a global symlink to that checkout; running it again from the dev worktree can accidentally move `/usr/bin/pibo` to dev.
68
-
69
- The generated developer services avoid this by pinning production to:
70
-
71
- ```text
72
- /usr/bin/node /root/code/pibo/dist/bin/pibo.js
73
- ```
74
-
75
- and dev to the wrapper in `/usr/local/bin/pibo-web-dev-start.mjs`, which imports the dev worktree directly.
76
-
77
- Run this in each checkout/worktree instead:
78
-
79
- ```bash
80
- npm ci
81
- npm run build
82
- ```
83
-
84
- ## Important detail: dev internal gateway port
85
-
86
- Do not start dev only with:
87
-
88
- ```bash
89
- pibo gateway:web --web-port 4808
90
- ```
91
-
92
- That changes the web port but leaves the internal gateway at the default `4789`, which collides with production. The generated developer setup uses a wrapper that calls `runWebGatewayServer` with:
93
-
94
- ```text
95
- web port: 4808
96
- internal port: 4809
97
- ```
98
-
99
- ## Validate
100
-
101
- ```bash
102
- systemctl is-active pibo-web
103
- systemctl is-active pibo-web-dev
104
- pibo gateway web status
105
- PIBO_GATEWAY_DEV_PORT=4808 pibo gateway dev status
106
- pibo setup doctor --domain pibo.example.com --dev-domain dev.pibo.example.com --expected-ip <server-ip> --require-docker --min-swap-gb 8
107
- pibo compute spawn --help
108
- ```
109
-
110
- DNS must point to the host before Caddy can issue public certificates.
111
-
112
- Docker and swap are developer-host prerequisites only. User-host installs can ignore Docker and swap. The setup command does not create swap automatically; provision it at the OS level, then verify it with `pibo setup doctor --min-swap-gb 8`.
1
+ # Install Pibo as a Developer Host
2
+
3
+ Use this path when the host is used to develop Pibo itself.
4
+
5
+ ## Philosophy
6
+
7
+ Production must stay stable while development moves quickly. The dev gateway can restart, fail, or deploy the `dev` branch without interrupting the main production gateway.
8
+
9
+ Docker compute workers are part of the developer setup. Each agent should get its own isolated container and gateway so agent restarts do not disturb other agents or the host gateways.
10
+
11
+ ## Target layout
12
+
13
+ ```text
14
+ /root/code/pibo main / production
15
+ /root/code/pibo/.worktrees/dev dev / development
16
+
17
+ /root/.pibo production data
18
+ /root/.pibo-dev development data
19
+
20
+ pibo-web.service prod web 4788, gateway 4789
21
+ pibo-web-dev.service dev web 4808, gateway 4809
22
+ ```
23
+
24
+ ## Remotes
25
+
26
+ Each developer host should use its own fork as `origin` and the canonical repo as `upstream`:
27
+
28
+ ```text
29
+ origin git@github.com:<server-or-user-fork>/pibo.git
30
+ upstream git@github.com:Pascapone/pibo.git
31
+ ```
32
+
33
+ ## Plan the setup
34
+
35
+ ```bash
36
+ pibo setup developer-host \
37
+ --origin git@github.com:<server-or-user-fork>/pibo.git \
38
+ --upstream git@github.com:Pascapone/pibo.git \
39
+ --prod-domain pibo.example.com \
40
+ --dev-domain dev.pibo.example.com \
41
+ --print-files
42
+ ```
43
+
44
+ Review the generated systemd units, dev start wrapper, environment template, and Caddyfile. Stage files before applying when testing a fresh host:
45
+
46
+ ```bash
47
+ pibo setup developer-host \
48
+ --origin git@github.com:<server-or-user-fork>/pibo.git \
49
+ --prod-domain pibo.example.com \
50
+ --dev-domain dev.pibo.example.com \
51
+ --write-to /tmp/pibo-setup
52
+ ```
53
+
54
+ Apply after review:
55
+
56
+ ```bash
57
+ pibo setup developer-host \
58
+ --origin git@github.com:<server-or-user-fork>/pibo.git \
59
+ --prod-domain pibo.example.com \
60
+ --dev-domain dev.pibo.example.com \
61
+ --apply --yes
62
+ systemctl daemon-reload
63
+ ```
64
+
65
+ ## Important detail: service pinning
66
+
67
+ Do not globally install the dev worktree over the production install. `npm install -g .` from a local checkout creates a global symlink to that checkout; running it again from the dev worktree can accidentally move `/usr/bin/pibo` to dev.
68
+
69
+ The generated developer services avoid this by pinning production to:
70
+
71
+ ```text
72
+ /usr/bin/node /root/code/pibo/dist/bin/pibo.js
73
+ ```
74
+
75
+ and dev to the wrapper in `/usr/local/bin/pibo-web-dev-start.mjs`, which imports the dev worktree directly.
76
+
77
+ Run this in each checkout/worktree instead:
78
+
79
+ ```bash
80
+ npm ci
81
+ npm run build
82
+ ```
83
+
84
+ ## Important detail: dev internal gateway port
85
+
86
+ Do not start dev only with:
87
+
88
+ ```bash
89
+ pibo gateway:web --web-port 4808
90
+ ```
91
+
92
+ That changes the web port but leaves the internal gateway at the default `4789`, which collides with production. The generated developer setup uses a wrapper that calls `runWebGatewayServer` with:
93
+
94
+ ```text
95
+ web port: 4808
96
+ internal port: 4809
97
+ ```
98
+
99
+ ## Validate
100
+
101
+ ```bash
102
+ systemctl is-active pibo-web
103
+ systemctl is-active pibo-web-dev
104
+ pibo gateway web status
105
+ PIBO_GATEWAY_DEV_PORT=4808 pibo gateway dev status
106
+ pibo setup doctor --domain pibo.example.com --dev-domain dev.pibo.example.com --expected-ip <server-ip> --require-docker --min-swap-gb 8
107
+ pibo compute spawn --help
108
+ ```
109
+
110
+ DNS must point to the host before Caddy can issue public certificates.
111
+
112
+ Docker and swap are developer-host prerequisites only. User-host installs can ignore Docker and swap. The setup command does not create swap automatically; provision it at the OS level, then verify it with `pibo setup doctor --min-swap-gb 8`.