@wenathlan/devthink 1.1.15 → 2.0.2

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 (160) hide show
  1. package/CHANGELOG.md +1299 -0
  2. package/README.md +6 -0
  3. package/bridge.d.ts +698 -0
  4. package/bridge.d.ts.map +1 -0
  5. package/bridge.js +1877 -0
  6. package/bun.d.ts +8 -0
  7. package/bun.d.ts.map +1 -0
  8. package/bun.js +52329 -0
  9. package/caps/background.json +712 -0
  10. package/caps/cli.json +360 -0
  11. package/caps/library.json +3611 -0
  12. package/caps/mcp.json +126 -0
  13. package/caps/pagebridge.json +377 -0
  14. package/caps/popup.json +51 -0
  15. package/caps/sidepanel.json +522 -0
  16. package/checksums.txt +142 -0
  17. package/cli.d.ts +187 -0
  18. package/cli.d.ts.map +1 -0
  19. package/cli.js +18197 -0
  20. package/companion.d.ts +19 -0
  21. package/companion.d.ts.map +1 -0
  22. package/companion.js +389 -0
  23. package/crossbrowser.d.ts +277 -0
  24. package/crossbrowser.d.ts.map +1 -0
  25. package/crossbrowser.js +1191 -0
  26. package/dashdone.d.ts +273 -0
  27. package/dashdone.d.ts.map +1 -0
  28. package/dashdone.js +368 -0
  29. package/deno.d.ts +11 -0
  30. package/deno.d.ts.map +1 -0
  31. package/deno.js +52325 -0
  32. package/devthink.umd.js +52346 -0
  33. package/fixtures/bun.ts +7 -0
  34. package/fixtures/cjs.js +6 -0
  35. package/fixtures/deno.ts +6 -0
  36. package/fixtures/example-org-pagestate.json +22 -0
  37. package/fixtures/importers/automa-workflow.json +18 -0
  38. package/fixtures/importers/selenium-side.json +20 -0
  39. package/fixtures/importers/tabular-plan.csv +7 -0
  40. package/fixtures/importers/uivision-macro.json +10 -0
  41. package/fixtures/importers/v1-plan.json +13 -0
  42. package/fixtures/mcp-client.mjs +14 -0
  43. package/fixtures/pages/checkout.html +192 -0
  44. package/fixtures/pages/dashboard.html +110 -0
  45. package/fixtures/pages/feed.html +113 -0
  46. package/fixtures/pages/product-grid.html +150 -0
  47. package/fixtures/plans/form-inventory-plan.json +11 -0
  48. package/fixtures/plans/release-notes-plan.json +11 -0
  49. package/fixtures/recipes/agentscompete.json +11 -0
  50. package/fixtures/recipes/agentsforms.json +11 -0
  51. package/fixtures/recipes/agentsmonitor.json +11 -0
  52. package/fixtures/recipes/agentsreview.json +29 -0
  53. package/fixtures/recipes/agentswarm.json +11 -0
  54. package/fixtures/recipes/fillcalendar.json +12 -0
  55. package/fixtures/recipes/fillcheckout.json +13 -0
  56. package/fixtures/recipes/filldependentdropdowns.json +12 -0
  57. package/fixtures/recipes/fillfromcsv.json +13 -0
  58. package/fixtures/recipes/fillloginform.json +12 -0
  59. package/fixtures/recipes/fillmultistepwizard.json +13 -0
  60. package/fixtures/recipes/fillregistration.json +12 -0
  61. package/fixtures/recipes/fillsearchfilters.json +12 -0
  62. package/fixtures/recipes/filltypeahead.json +11 -0
  63. package/fixtures/recipes/monitoralerts.json +12 -0
  64. package/fixtures/recipes/monitoravailability.json +11 -0
  65. package/fixtures/recipes/monitornetworkquiet.json +12 -0
  66. package/fixtures/recipes/monitorpagechanges.json +11 -0
  67. package/fixtures/recipes/monitorpricechange.json +11 -0
  68. package/fixtures/recipes/monitorschedule.json +12 -0
  69. package/fixtures/recipes/scrapedynamicprices.json +13 -0
  70. package/fixtures/recipes/scrapeimagegallery.json +12 -0
  71. package/fixtures/recipes/scrapeinfinitefeed.json +13 -0
  72. package/fixtures/recipes/scrapenestedlists.json +12 -0
  73. package/fixtures/recipes/scrapeproductgrid.json +12 -0
  74. package/fixtures/recipes/scrapereviews.json +12 -0
  75. package/fixtures/recipes/scrapesearchresults.json +12 -0
  76. package/fixtures/recipes/scrapetablepagination.json +12 -0
  77. package/fixtures/recipes/testaccessibility.json +34 -0
  78. package/fixtures/recipes/testconsoleerrors.json +12 -0
  79. package/fixtures/recipes/testdeeplinks.json +12 -0
  80. package/fixtures/recipes/testformvalidation.json +13 -0
  81. package/fixtures/recipes/testlayoutshift.json +12 -0
  82. package/fixtures/recipes/testlinkcheck.json +12 -0
  83. package/fixtures/recipes/testloadtiming.json +12 -0
  84. package/fixtures/recipes/testvisualdiff.json +12 -0
  85. package/fixtures/workflows/changelog-digest-workflow.json +13 -0
  86. package/fixtures/workflows/form-survey-workflow.json +13 -0
  87. package/gallery.json +706 -0
  88. package/hardening.d.ts +81 -0
  89. package/hardening.d.ts.map +1 -0
  90. package/hardening.js +188 -0
  91. package/headless.d.ts +114 -0
  92. package/headless.d.ts.map +1 -0
  93. package/headless.js +11522 -0
  94. package/http.d.ts +636 -0
  95. package/http.d.ts.map +1 -0
  96. package/http.js +2165 -0
  97. package/index.cjs +54682 -0
  98. package/index.d.ts +40 -0
  99. package/index.d.ts.map +1 -0
  100. package/index.js +52310 -0
  101. package/index.neutral.js +46343 -0
  102. package/manifest.json +199 -0
  103. package/mcp.d.ts +501 -0
  104. package/mcp.d.ts.map +1 -0
  105. package/mcp.js +20515 -0
  106. package/memory.d.ts +2397 -0
  107. package/memory.d.ts.map +1 -0
  108. package/memory.js +5782 -0
  109. package/nativehost.template.json +10 -0
  110. package/node.cjs +54686 -0
  111. package/node.d.ts +8 -0
  112. package/node.d.ts.map +1 -0
  113. package/pack.d.ts +211 -0
  114. package/pack.d.ts.map +1 -0
  115. package/pack.js +805 -0
  116. package/package.json +101 -51
  117. package/policy.d.ts +1854 -0
  118. package/policy.d.ts.map +1 -0
  119. package/policy.js +12580 -0
  120. package/progress.d.ts +390 -0
  121. package/progress.d.ts.map +1 -0
  122. package/progress.js +645 -0
  123. package/protocol.d.ts +2336 -0
  124. package/protocol.d.ts.map +1 -0
  125. package/protocol.js +8334 -0
  126. package/schemas/audit.schema.json +226 -0
  127. package/schemas/capability.schema.json +113 -0
  128. package/schemas/envelope.schema.json +162 -0
  129. package/schemas/memory.schema.json +51 -0
  130. package/schemas/observation.schema.json +113 -0
  131. package/schemas/plan.schema.json +208 -0
  132. package/schemas/progress.schema.json +126 -0
  133. package/schemas/proposal.schema.json +68 -0
  134. package/schemas/session.schema.json +82 -0
  135. package/schemas/tool.schema.json +94 -0
  136. package/server.d.ts +435 -0
  137. package/server.d.ts.map +1 -0
  138. package/server.js +28872 -0
  139. package/umd-example.html +18 -0
  140. package/umd.d.ts +6 -0
  141. package/umd.d.ts.map +1 -0
  142. package/build.ts +0 -41
  143. package/check-secrets.ts +0 -52
  144. package/compatibility.ts +0 -37
  145. package/config.ts +0 -246
  146. package/devthink.ts +0 -397
  147. package/identity.ts +0 -156
  148. package/ids.ts +0 -22
  149. package/memory.ts +0 -95
  150. package/modes.ts +0 -43
  151. package/plugin.ts +0 -68
  152. package/providers.ts +0 -179
  153. package/server.ts +0 -264
  154. package/session.ts +0 -155
  155. package/storage.ts +0 -82
  156. package/stream.ts +0 -130
  157. package/sync.ts +0 -27
  158. package/terminal-ui.tsx +0 -155
  159. package/ui.ts +0 -143
  160. package/workspace.ts +0 -20
package/ui.ts DELETED
@@ -1,143 +0,0 @@
1
- /** Style: DevThink Orbital Signal Room — terminal workspace uses canonical ANSI art, orange intent and orb-blue connection states. */
2
- import type { ChatEvent } from "./stream.ts";
3
-
4
- export const colors = {
5
- background: "\u001b[38;5;234m",
6
- panel: "\u001b[38;5;240m",
7
- text: "\u001b[38;5;255m",
8
- muted: "\u001b[38;5;246m",
9
- cyan: "\u001b[38;5;117m",
10
- blue: "\u001b[38;5;111m",
11
- orange: "\u001b[38;5;208m",
12
- orangeSoft: "\u001b[38;5;215m",
13
- green: "\u001b[38;5;151m",
14
- red: "\u001b[38;5;167m",
15
- yellow: "\u001b[38;5;222m",
16
- reset: "\u001b[0m",
17
- bold: "\u001b[1m",
18
- };
19
-
20
- const frames = ["◐", "◓", "◑", "◒"];
21
-
22
- /** Canonical DevThink ANSI mark transcribed from docs/logo.md. */
23
- const canonicalMark = String.raw`
24
- +
25
- +
26
- -+
27
- ++
28
- ++
29
- +++
30
- -++
31
- ++++-
32
- +++++++++
33
- +-+++++++++++++--
34
- --++++++-++++++++++++
35
- +++++++-+ +++ +--++++++-
36
- -+++++++-+ +++ -+-+++++++
37
- ++++++++++ -+++ --++++++++
38
- ++++++++-+ ++++ --+++++++-
39
- ++++++++++ ++++ --+++++++-
40
- ---++++++- -++++ -++++++--+
41
- ++++++++-- +++++ ++++++++--
42
- +--+++++-- +++++ +++++++---
43
- ++++++++- +++++ +-+++++++
44
- -+++++-- -++++- --++++++
45
- -+++++- +++++- +++++++
46
- -++++++ -+++++- +++++++
47
- -++++++ ++++++- +++++++
48
- -++++++ +++++++- +++++++
49
- -++++++ ++++++++- +++++++
50
- -++++++ -++++++++++-+ +++++++
51
- -++++++ -+++++++++++++- +++++++
52
- -++++++ -+++++++++++++++++ +++++++
53
- -++++++ -++++++++++++++++++++ +++++++
54
- -++++++ -++++++++++++++++++++++ +++++++
55
- -++++++ -+++++++++++++++++++++++++- +++++++
56
- -++++++ +++++++++++++++++-+--++++++++-- +++++++
57
- -++++++ +++++++++++++++ -+++++++++ +++++++
58
- -++++++ +++++++++++-++ --++++++-+ +-++++
59
- -++++++ ++++++++++-+- +--++++-- --++
60
- -++++++ +--++++++++++ ---++++-+ +-
61
- -++++++ ++-++++++++ ++++++++
62
- -++++++ -+++++-+-- +-++-+
63
- -+++++++++++++ -++++++
64
- -++++++++ +-+++-+++-
65
- -+++++++++++ ++++++++- +---+
66
- --++-+ -++++++-++ ---++++++++ +-++
67
- ++++ +-+++++++ -++++++-+ ++
68
- -++ ++++++++-- ++++++++-+- +
69
- +-++++++-+ --++++++++
70
- ++-+++++++ ++++++++-+
71
- +-++++++++ --++++++++
72
- ++++++++++ +--++++++-
73
- --+++++++- ++++++++++
74
- -+++++++-++++--++++++++
75
- +-++++++++++++++-
76
- --++++++++-
77
- +-++-`;
78
-
79
- function color(code: string, value: string): string {
80
- return `${code}${value}${colors.reset}`;
81
- }
82
-
83
- function stripAnsi(value: string): string {
84
- return value.replace(/\u001b\[[0-?]*[ -/]*[@-~]/g, "");
85
- }
86
-
87
- function pad(value: string, width: number): string {
88
- const visible = stripAnsi(value);
89
- return visible.length >= width ? value.slice(0, Math.max(0, width - Math.max(0, visible.length - width))) : value + " ".repeat(width - visible.length);
90
- }
91
-
92
- export function banner(version: string): string {
93
- const mark = canonicalMark.split("\n").map((line) => color(colors.orange, line)).join("\n");
94
- const title = color(colors.orange + colors.bold, "DEVTHINK");
95
- const signal = color(colors.blue, "◆ local workspace");
96
- return [
97
- color(colors.muted, "╭────────────────────────────── signal workspace ──────────────────────────────╮"),
98
- mark,
99
- ` ${title} ${color(colors.muted, `v${version}`)} ${signal}`,
100
- ` ${color(colors.muted, "route the work · keep provider credentials local · ctrl+p commands")}`,
101
- color(colors.muted, "╰────────────────────────────────────────────────────────────────────────────────╯"),
102
- ].join("\n");
103
- }
104
-
105
- export function box(title: string, content: string, width = 76): string {
106
- const innerWidth = Math.max(20, width - 4);
107
- const top = `╭─ ${color(colors.orange, title)} ${color(colors.muted, "─".repeat(Math.max(0, innerWidth - title.length - 3)))}╮`;
108
- const body = content.split("\n").map((line) => `│ ${color(colors.blue, "▎")} ${pad(line, innerWidth - 2)} │`);
109
- return [top, ...body, `╰${"─".repeat(width - 2)}╯`].join("\n");
110
- }
111
-
112
- export function statusBar(provider: string, model: string, mode: string): string {
113
- const providerLabel = provider || "not configured";
114
- const modelLabel = model || "not configured";
115
- return [
116
- color(colors.orange, "◆"), color(colors.text, providerLabel),
117
- color(colors.muted, "/"), color(colors.blue, modelLabel),
118
- color(colors.muted, "·"), color(colors.cyan, mode),
119
- ].join(" ");
120
- }
121
-
122
- export function spinnerFrame(index: number, message: string): string {
123
- return `${color(colors.blue, frames[index % frames.length])} ${color(colors.muted, "stream")} ${message}`;
124
- }
125
-
126
- export function formatEvent(event: ChatEvent): string {
127
- if (event.type === "text") return event.text;
128
- if (event.type === "reasoning") return `${color(colors.blue, "·")} ${color(colors.muted, event.text)}`;
129
- if (event.type === "error") return color(colors.red, event.message);
130
- if (event.type === "finish") return "";
131
- if (event.type === "start") return `${color(colors.blue, "◆")} ${color(colors.text, "connected")} ${color(colors.muted, `${event.provider} / ${event.model}`)}`;
132
- return `${color(colors.orange, "→")} ${color(colors.blue, event.name)} ${color(colors.muted, JSON.stringify(event.input))}`;
133
- }
134
-
135
- export function suggestions(input: string, values: string[], limit = 8): string[] {
136
- const query = input.trim().toLowerCase();
137
- if (!query) return values.slice(0, limit);
138
- return values.filter((value) => value.toLowerCase().includes(query)).slice(0, limit);
139
- }
140
-
141
- export function formatConfig(config: Record<string, unknown>): string {
142
- return Object.entries(config).map(([key, value]) => `${color(colors.muted, pad(key, 20))} ${String(value)}`).join("\n");
143
- }
package/workspace.ts DELETED
@@ -1,20 +0,0 @@
1
- /** DevThink workspace contract: renderer-neutral destination names, glyphs and labels shared by web and Ink. */
2
- export const workspaceDestinations = [
3
- { id: "chat", label: "chat", glyph: "◉" },
4
- { id: "history", label: "history", glyph: "◷" },
5
- { id: "projects", label: "projects", glyph: "▦" },
6
- { id: "providers", label: "providers", glyph: "◌" },
7
- { id: "usage", label: "usage", glyph: "◫" },
8
- { id: "routes", label: "routes", glyph: "⌘" },
9
- { id: "settings", label: "settings", glyph: "⚙" },
10
- ] as const;
11
-
12
- export type WorkspaceDestination = (typeof workspaceDestinations)[number]["id"];
13
-
14
- export function isWorkspaceDestination(value: string): value is WorkspaceDestination {
15
- return workspaceDestinations.some((destination) => destination.id === value);
16
- }
17
-
18
- export function workspaceDestination(value: WorkspaceDestination) {
19
- return workspaceDestinations.find((destination) => destination.id === value) || workspaceDestinations[0];
20
- }