@docyrus/docyrus 0.0.33 → 0.0.35

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 (67) hide show
  1. package/README.md +25 -0
  2. package/agent-loader.js +3 -2
  3. package/agent-loader.js.map +2 -2
  4. package/main.js +82252 -46058
  5. package/main.js.map +4 -4
  6. package/package.json +12 -3
  7. package/resources/chrome-tools/browser-content.js +46 -46
  8. package/resources/chrome-tools/browser-cookies.js +16 -16
  9. package/resources/chrome-tools/browser-eval.js +27 -27
  10. package/resources/chrome-tools/browser-hn-scraper.js +1 -1
  11. package/resources/chrome-tools/browser-nav.js +23 -23
  12. package/resources/chrome-tools/browser-pick.js +127 -127
  13. package/resources/chrome-tools/browser-screenshot.js +10 -10
  14. package/resources/chrome-tools/browser-start.js +38 -38
  15. package/resources/pi-agent/extensions/answer.ts +392 -384
  16. package/resources/pi-agent/extensions/context.ts +415 -415
  17. package/resources/pi-agent/extensions/control.ts +1287 -1287
  18. package/resources/pi-agent/extensions/diff.ts +171 -171
  19. package/resources/pi-agent/extensions/files.ts +155 -155
  20. package/resources/pi-agent/extensions/knowledge.ts +664 -0
  21. package/resources/pi-agent/extensions/loop.ts +375 -375
  22. package/resources/pi-agent/extensions/pi-bash-live-view/index.ts +1 -1
  23. package/resources/pi-agent/extensions/pi-bash-live-view/package.json +22 -22
  24. package/resources/pi-agent/extensions/pi-bash-live-view/pty-execute.ts +2 -2
  25. package/resources/pi-agent/extensions/pi-bash-live-view/pty-session.ts +2 -2
  26. package/resources/pi-agent/extensions/pi-bash-live-view/spawn-helper.ts +2 -2
  27. package/resources/pi-agent/extensions/pi-bash-live-view/terminal-emulator.ts +18 -18
  28. package/resources/pi-agent/extensions/pi-bash-live-view/truncate.ts +1 -1
  29. package/resources/pi-agent/extensions/pi-bash-live-view/widget.ts +4 -4
  30. package/resources/pi-agent/extensions/pi-custom-compaction/package.json +4 -4
  31. package/resources/pi-agent/extensions/pi-mcp-adapter/app-bridge.bundle.js +14 -14
  32. package/resources/pi-agent/extensions/pi-mcp-adapter/commands.ts +6 -6
  33. package/resources/pi-agent/extensions/pi-mcp-adapter/config.ts +9 -9
  34. package/resources/pi-agent/extensions/pi-mcp-adapter/consent-manager.ts +4 -4
  35. package/resources/pi-agent/extensions/pi-mcp-adapter/direct-tools.ts +13 -13
  36. package/resources/pi-agent/extensions/pi-mcp-adapter/glimpse-ui.ts +5 -5
  37. package/resources/pi-agent/extensions/pi-mcp-adapter/host-html-template.ts +13 -13
  38. package/resources/pi-agent/extensions/pi-mcp-adapter/index.ts +14 -14
  39. package/resources/pi-agent/extensions/pi-mcp-adapter/init.ts +17 -17
  40. package/resources/pi-agent/extensions/pi-mcp-adapter/lifecycle.ts +2 -2
  41. package/resources/pi-agent/extensions/pi-mcp-adapter/logger.ts +2 -2
  42. package/resources/pi-agent/extensions/pi-mcp-adapter/mcp-panel.ts +17 -17
  43. package/resources/pi-agent/extensions/pi-mcp-adapter/metadata-cache.ts +9 -9
  44. package/resources/pi-agent/extensions/pi-mcp-adapter/npx-resolver.ts +35 -35
  45. package/resources/pi-agent/extensions/pi-mcp-adapter/oauth-handler.ts +1 -1
  46. package/resources/pi-agent/extensions/pi-mcp-adapter/proxy-modes.ts +12 -12
  47. package/resources/pi-agent/extensions/pi-mcp-adapter/server-manager.ts +6 -6
  48. package/resources/pi-agent/extensions/pi-mcp-adapter/tool-metadata.ts +4 -4
  49. package/resources/pi-agent/extensions/pi-mcp-adapter/types.ts +2 -2
  50. package/resources/pi-agent/extensions/pi-mcp-adapter/ui-resource-handler.ts +6 -6
  51. package/resources/pi-agent/extensions/pi-mcp-adapter/ui-server.ts +17 -17
  52. package/resources/pi-agent/extensions/pi-mcp-adapter/ui-session.ts +22 -22
  53. package/resources/pi-agent/extensions/pi-mcp-adapter/utils.ts +2 -2
  54. package/resources/pi-agent/extensions/prompt-editor.ts +900 -900
  55. package/resources/pi-agent/extensions/prompt-url-widget.ts +122 -122
  56. package/resources/pi-agent/extensions/redraws.ts +14 -14
  57. package/resources/pi-agent/extensions/review.ts +1533 -1533
  58. package/resources/pi-agent/extensions/todos.ts +1735 -1735
  59. package/resources/pi-agent/extensions/tps.ts +40 -40
  60. package/resources/pi-agent/extensions/whimsical.ts +3 -3
  61. package/resources/pi-agent/prompts/agent-system.md +2 -0
  62. package/resources/pi-agent/prompts/coder-system.md +2 -0
  63. package/resources/pi-agent/skills/officecli/SKILL.md +113 -0
  64. package/server-loader.js +82 -1
  65. package/server-loader.js.map +3 -3
  66. package/tui.mjs +2 -0
  67. package/tui.mjs.map +1 -1
@@ -45,7 +45,7 @@ export default function bashLiveView(pi: ExtensionAPI) {
45
45
 
46
46
  pi.registerCommand('bash-pty', {
47
47
  description: 'Run a command through the PTY-backed bash path',
48
- handler: async (args, ctx) => {
48
+ handler: async(args, ctx) => {
49
49
  await runSlashCommand(args, ctx);
50
50
  },
51
51
  });
@@ -2,17 +2,6 @@
2
2
  "name": "pi-bash-live-view",
3
3
  "version": "0.1.1",
4
4
  "description": "A pi extension that adds optional PTY-backed live terminal rendering to the bash tool via usePTY=true.",
5
- "type": "module",
6
- "author": "Lucas Meijer",
7
- "license": "MIT",
8
- "repository": {
9
- "type": "git",
10
- "url": "git+https://github.com/lucasmeijer/pi-bash-live-view.git"
11
- },
12
- "bugs": {
13
- "url": "https://github.com/lucasmeijer/pi-bash-live-view/issues"
14
- },
15
- "homepage": "https://github.com/lucasmeijer/pi-bash-live-view#readme",
16
5
  "keywords": [
17
6
  "pi-package",
18
7
  "pi",
@@ -23,6 +12,17 @@
23
12
  "terminal",
24
13
  "tui"
25
14
  ],
15
+ "homepage": "https://github.com/lucasmeijer/pi-bash-live-view#readme",
16
+ "bugs": {
17
+ "url": "https://github.com/lucasmeijer/pi-bash-live-view/issues"
18
+ },
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/lucasmeijer/pi-bash-live-view.git"
22
+ },
23
+ "license": "MIT",
24
+ "author": "Lucas Meijer",
25
+ "type": "module",
26
26
  "files": [
27
27
  "index.ts",
28
28
  "pty-execute.ts",
@@ -36,26 +36,26 @@
36
36
  "README.md",
37
37
  "LICENSE"
38
38
  ],
39
- "pi": {
40
- "extensions": [
41
- "./index.ts"
42
- ]
43
- },
44
- "engines": {
45
- "node": ">=20"
46
- },
47
39
  "scripts": {
48
40
  "test": "node --test tests/*.test.mjs"
49
41
  },
50
42
  "dependencies": {
51
- "@mariozechner/pi-coding-agent": "^0.58.4",
43
+ "@mariozechner/pi-coding-agent": "^0.64.0",
52
44
  "@sinclair/typebox": "^0.34.38",
45
+ "@xterm/headless": "^5.5.0",
53
46
  "node-pty": "^1.0.0",
54
- "strip-ansi": "^7.1.0",
55
- "@xterm/headless": "^5.5.0"
47
+ "strip-ansi": "^7.1.0"
56
48
  },
57
49
  "devDependencies": {
58
50
  "@types/node": "^24.3.0",
59
51
  "typescript": "^5.7.3"
52
+ },
53
+ "engines": {
54
+ "node": ">=20"
55
+ },
56
+ "pi": {
57
+ "extensions": [
58
+ "./index.ts"
59
+ ]
60
60
  }
61
61
  }
@@ -73,9 +73,9 @@ export async function executePtyCommand(
73
73
  });
74
74
 
75
75
  await ptySession.whenIdle();
76
- if (timeoutHandle) clearTimeout(timeoutHandle);
76
+ if (timeoutHandle) {clearTimeout(timeoutHandle);}
77
77
  signal.removeEventListener('abort', onAbort);
78
- if (session.timer) clearTimeout(session.timer);
78
+ if (session.timer) {clearTimeout(session.timer);}
79
79
  session.disposed = true;
80
80
  hideWidget(ctx, session);
81
81
  unsubscribe();
@@ -129,12 +129,12 @@ export class PtyTerminalSession {
129
129
  }
130
130
 
131
131
  kill(signal = 'SIGTERM') {
132
- if (this._exited) return;
132
+ if (this._exited) {return;}
133
133
  killPtyProcess(this.ptyProcess, signal);
134
134
  }
135
135
 
136
136
  dispose() {
137
- if (this.disposed) return;
137
+ if (this.disposed) {return;}
138
138
  this.disposed = true;
139
139
  this.kill();
140
140
  this.terminalEmulator.dispose();
@@ -14,9 +14,9 @@ export function getBundledSpawnHelperPaths() {
14
14
 
15
15
  export function ensureExecutablePaths(paths: string[], log?: (...args: unknown[]) => void) {
16
16
  for (const helper of paths) {
17
- if (!fs.existsSync(helper)) continue;
17
+ if (!fs.existsSync(helper)) {continue;}
18
18
  const mode = fs.statSync(helper).mode & 0o777;
19
- if (mode === 0o755) continue;
19
+ if (mode === 0o755) {continue;}
20
20
  fs.chmodSync(helper, 0o755);
21
21
  log?.('chmod', helper);
22
22
  }
@@ -160,17 +160,17 @@ function paletteToSgr(isForeground: boolean, index: number): string {
160
160
 
161
161
  function styleToAnsi(style: CellStyle): string {
162
162
  const codes = ['0'];
163
- if (style.bold) codes.push('1');
164
- if (style.dim) codes.push('2');
165
- if (style.italic) codes.push('3');
166
- if (style.underline) codes.push('4');
167
- if (style.inverse) codes.push('7');
168
- if (style.invisible) codes.push('8');
169
- if (style.strikethrough) codes.push('9');
170
- if (style.fgMode === 'rgb') codes.push(rgbToSgr(true, style.fg));
171
- else if (style.fgMode === 'palette') codes.push(paletteToSgr(true, style.fg));
172
- if (style.bgMode === 'rgb') codes.push(rgbToSgr(false, style.bg));
173
- else if (style.bgMode === 'palette') codes.push(paletteToSgr(false, style.bg));
163
+ if (style.bold) {codes.push('1');}
164
+ if (style.dim) {codes.push('2');}
165
+ if (style.italic) {codes.push('3');}
166
+ if (style.underline) {codes.push('4');}
167
+ if (style.inverse) {codes.push('7');}
168
+ if (style.invisible) {codes.push('8');}
169
+ if (style.strikethrough) {codes.push('9');}
170
+ if (style.fgMode === 'rgb') {codes.push(rgbToSgr(true, style.fg));}
171
+ else if (style.fgMode === 'palette') {codes.push(paletteToSgr(true, style.fg));}
172
+ if (style.bgMode === 'rgb') {codes.push(rgbToSgr(false, style.bg));}
173
+ else if (style.bgMode === 'palette') {codes.push(paletteToSgr(false, style.bg));}
174
174
  return `\x1b[${codes.join(';')}m`;
175
175
  }
176
176
 
@@ -219,7 +219,7 @@ function extractTextFromBuffer(buffer: XtermBufferLike): string {
219
219
  }
220
220
 
221
221
  function normalizePaletteColor(mode: StyleMode, value: number): { mode: StyleMode; value: number } {
222
- if (mode !== 'palette') return { mode, value };
222
+ if (mode !== 'palette') {return { mode, value };}
223
223
  if (value < 0 || value > 255) {
224
224
  return { mode: 'default', value: 0 };
225
225
  }
@@ -285,7 +285,7 @@ function snapshotTerminal(term: XtermTerminalLike): TerminalSnapshot {
285
285
  row.push({ ch: ' ', style: defaultStyle() });
286
286
  continue;
287
287
  }
288
- if (cell.getWidth() === 0) continue;
288
+ if (cell.getWidth() === 0) {continue;}
289
289
  row.push({
290
290
  ch: cell.getChars() || ' ',
291
291
  style: styleFromCell(cell),
@@ -314,9 +314,9 @@ function createDecPrivateModeTracker(onModeChange: (mode: number, enabled: boole
314
314
  }
315
315
  const enabled = finalByte === 'h';
316
316
  for (const part of params.split(';')) {
317
- if (!part) continue;
317
+ if (!part) {continue;}
318
318
  const mode = Number(part);
319
- if (!Number.isInteger(mode)) continue;
319
+ if (!Number.isInteger(mode)) {continue;}
320
320
  onModeChange(mode, enabled);
321
321
  }
322
322
  reset();
@@ -326,7 +326,7 @@ function createDecPrivateModeTracker(onModeChange: (mode: number, enabled: boole
326
326
  push(text: string) {
327
327
  for (const ch of text) {
328
328
  if (state === 'ground') {
329
- if (ch === '\x1b') state = 'escape';
329
+ if (ch === '\x1b') {state = 'escape';}
330
330
  continue;
331
331
  }
332
332
  if (state === 'escape') {
@@ -383,7 +383,7 @@ export function createTerminalEmulator({ cols, rows, scrollback = 10_000 }: { co
383
383
  });
384
384
 
385
385
  function emitUpdate(payload: TerminalUpdatePayload) {
386
- for (const listener of listeners) listener(payload);
386
+ for (const listener of listeners) {listener(payload);}
387
387
  }
388
388
 
389
389
  async function consumeProcessStdout(chunk: string, { elapsedMs = lastElapsedMs }: { elapsedMs?: number } = {}) {
@@ -393,7 +393,7 @@ export function createTerminalEmulator({ cols, rows, scrollback = 10_000 }: { co
393
393
  term.write(chunk, () => {
394
394
  latestSnapshot = snapshotTerminal(term);
395
395
  const renderableSnapshot = inSyncRender ? lastCompletedSnapshot : latestSnapshot;
396
- if (!inSyncRender) lastCompletedSnapshot = cloneSnapshot(latestSnapshot);
396
+ if (!inSyncRender) {lastCompletedSnapshot = cloneSnapshot(latestSnapshot);}
397
397
  const payload: TerminalUpdatePayload = {
398
398
  elapsedMs: lastElapsedMs,
399
399
  snapshot: cloneSnapshot(renderableSnapshot),
@@ -10,7 +10,7 @@ function getTempFilePath() {
10
10
  }
11
11
 
12
12
  function maybePersistFullOutput(fullOutput: string) {
13
- if (Buffer.byteLength(fullOutput, 'utf-8') <= DEFAULT_MAX_BYTES) return undefined;
13
+ if (Buffer.byteLength(fullOutput, 'utf-8') <= DEFAULT_MAX_BYTES) {return undefined;}
14
14
  const tempFilePath = getTempFilePath();
15
15
  writeFileSync(tempFilePath, fullOutput, 'utf-8');
16
16
  return tempFilePath;
@@ -19,12 +19,12 @@ export type LiveSession = {
19
19
 
20
20
  export function formatElapsed(ms: number): string {
21
21
  const totalSeconds = Math.max(0, ms / 1000);
22
- if (totalSeconds < 60) return `${totalSeconds.toFixed(1)}s`;
22
+ if (totalSeconds < 60) {return `${totalSeconds.toFixed(1)}s`;}
23
23
  const wholeSeconds = Math.floor(totalSeconds);
24
24
  const hours = Math.floor(wholeSeconds / 3600);
25
25
  const minutes = Math.floor((wholeSeconds % 3600) / 60);
26
26
  const seconds = wholeSeconds % 60;
27
- if (hours > 0) return `${hours}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
27
+ if (hours > 0) {return `${hours}:${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;}
28
28
  return `${minutes}:${String(seconds).padStart(2, '0')}`;
29
29
  }
30
30
 
@@ -103,12 +103,12 @@ function makeWidgetFactory(session: LiveSession) {
103
103
  }
104
104
 
105
105
  export function showWidget(ctx: ExtensionContext, session: LiveSession) {
106
- if (!ctx.hasUI || session.visible || session.disposed) return;
106
+ if (!ctx.hasUI || session.visible || session.disposed) {return;}
107
107
  session.visible = true;
108
108
  ctx.ui.setWidget(`${WIDGET_PREFIX}${session.id}`, makeWidgetFactory(session));
109
109
  }
110
110
 
111
111
  export function hideWidget(ctx: ExtensionContext | null, session: LiveSession) {
112
- if (!ctx || !ctx.hasUI) return;
112
+ if (!ctx || !ctx.hasUI) {return;}
113
113
  ctx.ui.setWidget(`${WIDGET_PREFIX}${session.id}`, undefined);
114
114
  }
@@ -43,10 +43,10 @@
43
43
  "test": "tsx --test test/**/*.test.ts"
44
44
  },
45
45
  "devDependencies": {
46
- "@mariozechner/pi-agent-core": "^0.57.1",
47
- "@mariozechner/pi-ai": "^0.57.1",
48
- "@mariozechner/pi-coding-agent": "^0.57.1",
49
- "@mariozechner/pi-tui": "^0.57.1",
46
+ "@mariozechner/pi-agent-core": "^0.64.0",
47
+ "@mariozechner/pi-ai": "^0.64.0",
48
+ "@mariozechner/pi-coding-agent": "^0.64.0",
49
+ "@mariozechner/pi-tui": "^0.64.0",
50
50
  "tsx": "^4.20.5"
51
51
  },
52
52
  "pi": {