@datagrok/grokky 1.0.4 → 1.1.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 (203) hide show
  1. package/.claude/skills/deploy-grokky/SKILL.md +193 -0
  2. package/.grokignore +2 -0
  3. package/.turbo/turbo-build.log +24 -0
  4. package/.vscode/settings.json +16 -0
  5. package/CHANGELOG.md +151 -8
  6. package/CLAUDE.md +284 -0
  7. package/CREDITS.md +173 -0
  8. package/LICENSE.md +16 -0
  9. package/README.md +24 -0
  10. package/bdd/bdd.config.json +1 -0
  11. package/bdd/bindings/elements.ts +9 -0
  12. package/bdd/bindings/steps.ts +787 -0
  13. package/bdd/features/ai-panel/platform-work.feature +63 -0
  14. package/bdd/features/ai-panel/session.feature +69 -0
  15. package/bdd/features/ai-panel/table-work.feature +99 -0
  16. package/bdd/generated/ai-panel/platform-work.test.ts +103 -0
  17. package/bdd/generated/ai-panel/session.test.ts +100 -0
  18. package/bdd/generated/ai-panel/table-work.test.ts +150 -0
  19. package/bdd/package.json +1 -0
  20. package/bdd/tsconfig.json +13 -0
  21. package/css/ai.css +637 -49
  22. package/dist/package-test.js +4 -1707
  23. package/dist/package-test.js.map +1 -1
  24. package/dist/package.js +742 -92317
  25. package/dist/package.js.map +1 -1
  26. package/dockerfiles/claude-runtime/.dockerignore +1 -0
  27. package/{.eslintrc.json → dockerfiles/claude-runtime/.eslintrc.json} +7 -16
  28. package/dockerfiles/claude-runtime/Dockerfile +73 -13
  29. package/dockerfiles/claude-runtime/agent/grokky_agent/__init__.py +0 -0
  30. package/dockerfiles/claude-runtime/agent/grokky_agent/__main__.py +80 -0
  31. package/dockerfiles/claude-runtime/agent/grokky_agent/browser_tools.py +180 -0
  32. package/dockerfiles/claude-runtime/agent/grokky_agent/config.py +26 -0
  33. package/dockerfiles/claude-runtime/agent/grokky_agent/formats.py +155 -0
  34. package/dockerfiles/claude-runtime/agent/grokky_agent/guard.py +87 -0
  35. package/dockerfiles/claude-runtime/agent/grokky_agent/hermes.py +212 -0
  36. package/dockerfiles/claude-runtime/agent/grokky_agent/hermes.yaml +45 -0
  37. package/dockerfiles/claude-runtime/agent/grokky_agent/hermes_plugin/__init__.py +8 -0
  38. package/dockerfiles/claude-runtime/agent/grokky_agent/hermes_plugin/plugin.yaml +3 -0
  39. package/dockerfiles/claude-runtime/agent/grokky_agent/protocol.py +174 -0
  40. package/dockerfiles/claude-runtime/agent/grokky_agent/providers/__init__.py +21 -0
  41. package/dockerfiles/claude-runtime/agent/grokky_agent/providers/anthropic.py +21 -0
  42. package/dockerfiles/claude-runtime/agent/grokky_agent/providers/azure.py +46 -0
  43. package/dockerfiles/claude-runtime/agent/grokky_agent/providers/base.py +127 -0
  44. package/dockerfiles/claude-runtime/agent/grokky_agent/providers/bedrock.py +46 -0
  45. package/dockerfiles/claude-runtime/agent/grokky_agent/providers/custom.py +40 -0
  46. package/dockerfiles/claude-runtime/agent/grokky_agent/providers/databricks.py +54 -0
  47. package/dockerfiles/claude-runtime/agent/grokky_agent/providers/openai_platform.py +41 -0
  48. package/dockerfiles/claude-runtime/agent/grokky_agent/providers/openrouter.py +46 -0
  49. package/dockerfiles/claude-runtime/agent/grokky_agent/session.py +471 -0
  50. package/dockerfiles/claude-runtime/agent/grokky_agent/skills.py +44 -0
  51. package/dockerfiles/claude-runtime/agent/grokky_agent/structured.py +40 -0
  52. package/dockerfiles/claude-runtime/container.json +2 -2
  53. package/dockerfiles/claude-runtime/entrypoint.sh +20 -0
  54. package/dockerfiles/claude-runtime/package-lock.json +1721 -306
  55. package/dockerfiles/claude-runtime/package.json +20 -5
  56. package/dockerfiles/claude-runtime/plugin/.claude-plugin/plugin.json +5 -0
  57. package/dockerfiles/claude-runtime/plugin/skills/datagrok-calc-column/SKILL.md +92 -0
  58. package/dockerfiles/claude-runtime/plugin/skills/datagrok-chem-data/SKILL.md +250 -0
  59. package/dockerfiles/claude-runtime/plugin/skills/datagrok-chem-toolkit/SKILL.md +395 -0
  60. package/dockerfiles/claude-runtime/plugin/skills/datagrok-df-and-columns/SKILL.md +454 -0
  61. package/dockerfiles/claude-runtime/plugin/skills/datagrok-entities/SKILL.md +38 -0
  62. package/dockerfiles/claude-runtime/plugin/skills/datagrok-exec/SKILL.md +209 -0
  63. package/dockerfiles/claude-runtime/plugin/skills/datagrok-filtering/SKILL.md +185 -0
  64. package/dockerfiles/claude-runtime/plugin/skills/datagrok-grid-customization/SKILL.md +270 -0
  65. package/dockerfiles/claude-runtime/plugin/skills/datagrok-projects/SKILL.md +100 -0
  66. package/dockerfiles/claude-runtime/plugin/skills/datagrok-selection/SKILL.md +344 -0
  67. package/dockerfiles/claude-runtime/plugin/skills/datagrok-undo/SKILL.md +78 -0
  68. package/dockerfiles/claude-runtime/plugin/skills/datagrok-viewers/SKILL.md +303 -0
  69. package/dockerfiles/claude-runtime/pyproject.toml +18 -0
  70. package/dockerfiles/claude-runtime/src/agent/pool.ts +411 -0
  71. package/dockerfiles/claude-runtime/src/agent/turn.ts +153 -0
  72. package/dockerfiles/claude-runtime/src/constants.ts +20 -0
  73. package/dockerfiles/claude-runtime/src/credentials.ts +45 -0
  74. package/dockerfiles/claude-runtime/src/grounding.ts +104 -0
  75. package/dockerfiles/claude-runtime/src/help-index.ts +118 -0
  76. package/dockerfiles/claude-runtime/src/privileges.ts +8 -0
  77. package/dockerfiles/claude-runtime/src/prompts.ts +211 -0
  78. package/dockerfiles/claude-runtime/src/server.ts +134 -234
  79. package/dockerfiles/claude-runtime/src/session.ts +328 -0
  80. package/dockerfiles/claude-runtime/src/shared-api-client.ts +112 -0
  81. package/dockerfiles/claude-runtime/src/stream-filter.ts +80 -0
  82. package/dockerfiles/claude-runtime/src/sync/home-files.ts +80 -0
  83. package/dockerfiles/claude-runtime/src/sync/orchestrator.ts +214 -0
  84. package/dockerfiles/claude-runtime/src/sync/packages.ts +145 -0
  85. package/dockerfiles/claude-runtime/src/sync/shared-connections.ts +87 -0
  86. package/dockerfiles/claude-runtime/src/sync/workspace.ts +68 -0
  87. package/dockerfiles/claude-runtime/src/tasks.ts +124 -0
  88. package/dockerfiles/claude-runtime/src/tool-summary.ts +66 -0
  89. package/dockerfiles/claude-runtime/src/types.ts +142 -23
  90. package/dockerfiles/claude-runtime/src/user/installed-packages.ts +17 -0
  91. package/dockerfiles/claude-runtime/src/user/staged-workspace.ts +80 -0
  92. package/dockerfiles/claude-runtime/src/user/user-dir.ts +108 -0
  93. package/dockerfiles/claude-runtime/src/verify.ts +136 -0
  94. package/dockerfiles/claude-runtime/src/watchdog.ts +115 -0
  95. package/dockerfiles/claude-runtime/test/credentials.test.js +43 -0
  96. package/dockerfiles/claude-runtime/test/grounding.test.js +191 -0
  97. package/dockerfiles/claude-runtime/test/help-index.test.js +115 -0
  98. package/dockerfiles/claude-runtime/test/plugin-skills.test.js +57 -0
  99. package/dockerfiles/claude-runtime/test/prompts.test.js +62 -0
  100. package/dockerfiles/claude-runtime/test/reaper.test.js +60 -0
  101. package/dockerfiles/claude-runtime/test/stream-filter.test.js +132 -0
  102. package/dockerfiles/claude-runtime/test/tasks.test.js +74 -0
  103. package/dockerfiles/claude-runtime/test/user-dir.test.js +71 -0
  104. package/dockerfiles/claude-runtime/test/verify.test.js +187 -0
  105. package/dockerfiles/claude-runtime/test/watchdog.test.js +43 -0
  106. package/dockerfiles/mcp-server/.eslintrc.json +39 -0
  107. package/dockerfiles/mcp-server/Dockerfile +10 -2
  108. package/dockerfiles/mcp-server/package-lock.json +1743 -98
  109. package/dockerfiles/mcp-server/package.json +27 -5
  110. package/dockerfiles/mcp-server/src/api-client.ts +123 -66
  111. package/dockerfiles/mcp-server/src/format.ts +51 -0
  112. package/dockerfiles/mcp-server/src/index.ts +44 -113
  113. package/dockerfiles/mcp-server/src/ops.ts +325 -0
  114. package/dockerfiles/mcp-server/src/shared-api-client.ts +81 -0
  115. package/dockerfiles/mcp-server/test/format.test.js +62 -0
  116. package/dockerfiles/mcp-server/test/ops.test.js +84 -0
  117. package/dockerfiles/mcp-server/test/shared-api-client.test.js +35 -0
  118. package/dockerfiles/queue/Dockerfile +2 -0
  119. package/dockerfiles/queue/container.json +7 -0
  120. package/docs/AUDIT-2026-08-03.md +1064 -0
  121. package/docs/BENCHMARK.md +292 -0
  122. package/docs/CLAUDE_CODE_FLOW.md +746 -0
  123. package/docs/EXAMPLES.md +82 -0
  124. package/docs/FEATURES.md +71 -0
  125. package/docs/IMPLEMENTATION.md +128 -0
  126. package/docs/LATENCY.md +170 -0
  127. package/docs/VISION.md +36 -0
  128. package/files/benchmark/suite.yaml +404 -0
  129. package/files/scripts/process-cro-results.md +14 -0
  130. package/files/suggestions.yaml +344 -0
  131. package/package.json +39 -97
  132. package/src/ai/ai-window.ts +157 -0
  133. package/src/ai/benchmark/benchmark.ts +737 -0
  134. package/src/ai/db-view-functions.ts +56 -0
  135. package/src/ai/engine.ts +98 -0
  136. package/src/ai/gemma-engine.ts +81 -0
  137. package/src/ai/panel.ts +1385 -0
  138. package/src/ai/prompt-suggestions.ts +209 -0
  139. package/src/ai/search/combined-search.ts +244 -0
  140. package/src/{llm-utils → ai/search}/query-matching.ts +46 -167
  141. package/src/{llm-utils → ai}/storage.ts +0 -1
  142. package/src/ai/table-tools.ts +145 -0
  143. package/src/ai/ui.ts +720 -0
  144. package/src/ai/usage-limiter.ts +105 -0
  145. package/src/ai/view-tools.ts +352 -0
  146. package/src/claude/ai-feature.ts +16 -0
  147. package/src/claude/exec-blocks.ts +176 -0
  148. package/src/claude/queue-task.ts +84 -0
  149. package/src/claude/runtime-client.ts +310 -0
  150. package/src/claude/turn-log.ts +114 -0
  151. package/src/claude/undoable.ts +105 -0
  152. package/src/{llm-utils → db}/db-index-tools.ts +24 -32
  153. package/src/db/sql-tools.ts +336 -0
  154. package/src/depr/LLM-client.ts +251 -0
  155. package/src/depr/ai-panel.ts +174 -0
  156. package/src/depr/chatgpt-assistant.ts +257 -0
  157. package/src/depr/creds.ts +30 -0
  158. package/src/depr/deepwikiclient.ts +118 -0
  159. package/src/depr/indexes/dg-repository-index.ts +266 -0
  160. package/src/depr/interfaces.ts +170 -0
  161. package/src/depr/is-help-request.ts +39 -0
  162. package/src/depr/prompt-engine.ts +52 -0
  163. package/src/depr/rendering-tools.ts +103 -0
  164. package/src/depr/script-tools.ts +785 -0
  165. package/src/depr/tableview-tools.ts +746 -0
  166. package/src/depr/viewers-ai.ts +67 -0
  167. package/src/package-api.ts +87 -28
  168. package/src/package-test.ts +1 -0
  169. package/src/package.g.ts +98 -48
  170. package/src/package.ts +211 -157
  171. package/src/polyfills.ts +12 -0
  172. package/src/utils.ts +128 -0
  173. package/tsconfig.json +8 -70
  174. package/webpack.config.js +3 -49
  175. package/.eslintignore +0 -2
  176. package/src/ai-panel.ts +0 -174
  177. package/src/claude-code/claude-panel.ts +0 -34
  178. package/src/claude-code/claude-runtime-client.ts +0 -148
  179. package/src/llm-utils/LLM-client.ts +0 -251
  180. package/src/llm-utils/combined-search.ts +0 -162
  181. package/src/llm-utils/creds.ts +0 -30
  182. package/src/llm-utils/deepwikiclient.ts +0 -118
  183. package/src/llm-utils/indexes/dg-repository-index.ts +0 -266
  184. package/src/llm-utils/panel.ts +0 -866
  185. package/src/llm-utils/script-tools.ts +0 -784
  186. package/src/llm-utils/sql-tools.ts +0 -840
  187. package/src/llm-utils/tableview-tools.ts +0 -704
  188. package/src/llm-utils/ui.ts +0 -315
  189. package/src/prompt-engine/chatgpt-assistant.ts +0 -257
  190. package/src/prompt-engine/interfaces.ts +0 -170
  191. package/src/prompt-engine/prompt-engine.ts +0 -52
  192. package/src/prompt-engine/rendering-tools.ts +0 -103
  193. package/src/prompts/is-help-request.ts +0 -26
  194. package/src/viewers-ai.ts +0 -67
  195. /package/src/{llm-utils → db}/indexes/biologics-index.ts +0 -0
  196. /package/src/{llm-utils → db}/indexes/chembl-index.ts +0 -0
  197. /package/src/{llm-utils → db}/query-meta-utils.ts +0 -0
  198. /package/src/{llm-utils/depr → depr}/AI-API-providers/openai-chat-completions-provider.ts +0 -0
  199. /package/src/{llm-utils/depr → depr}/AI-API-providers/openai-responses-provider.ts +0 -0
  200. /package/src/{llm-utils/depr → depr}/AI-API-providers/types.ts +0 -0
  201. /package/src/{llm-utils/depr → depr}/depr.ts +0 -0
  202. /package/src/{llm-utils/depr → depr}/embeddings.ts +0 -0
  203. /package/src/{llm-utils/depr → depr}/sql-utils.ts +0 -0
package/CLAUDE.md ADDED
@@ -0,0 +1,284 @@
1
+ # Grokky
2
+
3
+ Grokky is the [AI for Datagrok](../../../help/explore/ai/ai.md), enabling the following:
4
+ 1. A generic AI JS API for core and other plugins to use LLMs
5
+ 2. [Datagrok MCP server](dockerfiles/mcp-server/) so that Datagrok can be used by others
6
+ 3. [AI runtime](dockerfiles/claude-runtime) for
7
+ - writing scripts
8
+ - doing agentic work on behalf of the user, augmented with custom skills
9
+ and company-specific knowledge on processes, infrastruture, etc.
10
+ - See [docs/CLAUDE_CODE_FLOW.md](docs/CLAUDE_CODE_FLOW.md) for a full description of the
11
+ deployment, message protocol, and response-to-UI pipeline.
12
+ 4. A general-purpose [AI console](...) to work with the platform
13
+ 5. Supercharging your daily work:
14
+ - Natural-language database queries
15
+ - Automatic visualizations
16
+ - Search across everything
17
+ - Talk to your documents
18
+
19
+ Ideal for enterprises. You deploy Datagrok in your private cloud, and provide
20
+ your company's Anthropic API key. Your data and tool usage
21
+ is safe, secure, governed, monitored and measured.
22
+
23
+ See also [Grokky GitHub issues](https://github.com/datagrok-ai/public/issues/3710).
24
+
25
+ ## Browser compatibility
26
+
27
+ The UI targets current Chrome. Dartium (≈ Chromium 50) and Dart 1 are no longer supported targets, so
28
+ modern CSS (flexbox `gap`, unprefixed `filter`/`user-select`/`mask-image`) and modern runtime APIs
29
+ are fine.
30
+
31
+ `src/polyfills.ts` covers only what current browsers lack (the unprefixed `SpeechRecognition`); the
32
+ platform itself polyfills `crypto.randomUUID` outside a secure context. Keep using `copyToClipboard()` from `src/utils.ts` rather than `navigator.clipboard.writeText`:
33
+ the latter is undefined in insecure (plain-HTTP) contexts.
34
+
35
+ ## Source Structure
36
+
37
+ ```
38
+ src/
39
+ ├── package.ts # Entry point — registers functions, init, search providers
40
+ ├── polyfills.ts # SpeechRecognition shim — imported first from package.ts / package-test.ts
41
+ ├── utils.ts # Shared utilities: viewer/dataframe descriptions, events, copyToClipboard
42
+ ├── ai/ # AI panels, search, and UI wiring
43
+ │ ├── panel.ts # AIPanel (singleton shell chat), DBAIPanel, ScriptingAIPanel, StreamingPanel
44
+ │ ├── ai-window.ts # AIWindowManager — mounts panels into grok.shell.windows.ai, Ctrl+I toggle
45
+ │ ├── prompt-suggestions.ts # Curated prompt suggestions (files/suggestions.yaml), wand-icon menu
46
+ │ ├── ui.ts # Setup functions that wire panels into the platform UI
47
+ │ ├── storage.ts # ConversationStorage — IndexedDB persistence for chat history
48
+ │ ├── usage-limiter.ts # Per-user daily request limits (group-configurable)
49
+ │ └── search/
50
+ │ ├── combined-search.ts # Routes user queries to ranked aiSearchProvider functions
51
+ │ └── query-matching.ts # LLM-based matching of natural-language to DB queries
52
+ ├── claude/ # Browser-facing Claude runtime integration
53
+ │ ├── runtime-client.ts # WebSocket client to claude-runtime container
54
+ │ ├── queue-task.ts # Queued-task admission: aiChatTurnTask holds the celery slot; the turn streams over the WS
55
+ │ └── exec-blocks.ts # Executes datagrok-exec / datagrok-entities fenced blocks
56
+ ├── db/ # Database tooling
57
+ │ ├── sql-tools.ts # SQLGenerationContext — tool-call-based SQL generation
58
+ │ ├── db-index-tools.ts # DBSchemaInfo caching, metadata generation
59
+ │ ├── query-meta-utils.ts # BuiltinDBInfoMeta — extends DG.DbInfo with built-in relations
60
+ │ └── indexes/ # Hardcoded schema indexes for known databases
61
+ │ ├── biologics-index.ts
62
+ │ └── chembl-index.ts
63
+ └── depr/ # Deprecated code kept for reference (not imported by active code)
64
+ ```
65
+
66
+ ## Architecture
67
+
68
+ ### AI Search Providers (`src/package.ts`)
69
+
70
+ Three `aiSearchProvider` functions are registered via decorators, each with a `useWhen` clause that
71
+ `CombinedAISearchAssistant` uses to route user queries:
72
+
73
+ - **Help** — documentation Q&A
74
+ - **Execute** — plans and executes JS code using structured output
75
+ - **Query** — matches natural-language to registered database queries
76
+
77
+ All three route through `ClaudeRuntimeClient` (Help uses plain `query()`, Execute and Query use `query()` with
78
+ a structured output schema).
79
+
80
+ ### Combined Search (`src/ai/search/combined-search.ts`)
81
+
82
+ `CombinedAISearchAssistant` collects all `aiSearchProvider` functions, uses `ClaudeRuntimeClient.query()` to rank them
83
+ by relevance to the user query, then presents results in a lazy tab control.
84
+
85
+ ### AI Panel (`src/ai/panel.ts`) — one singleton everywhere
86
+
87
+ The assistant is ONE `AIPanel` instance (created by `initAIWindow()`) with one Claude session,
88
+ used for every view — there are no per-view or specialized panels anymore. It survives view
89
+ switches — `AIWindowManager` (`src/ai/ai-window.ts`) never remounts on `onCurrentViewChanged`;
90
+ instead, every prompt gets a fresh workspace snapshot from `buildWorkspaceContext()` (current view
91
+ details, all open views, all workspace tables), and `datagrok-exec`/`datagrok_verify` blocks run
92
+ against the live `grok.shell.v`. The ribbon AI icons on table/script/query views just toggle this
93
+ singleton.
94
+
95
+ The panel streams through `ClaudeRuntimeClient` (`StreamingPanel` interface) with chat history,
96
+ streaming display, and conversation persistence via `ConversationStorage`.
97
+
98
+ ### View functions (`src/ai/view-tools.ts`, `src/ai/db-view-functions.ts`)
99
+
100
+ The assistant reaches a view's operations through the platform's `getFunctions()` — every Widget
101
+ (and thus every view) returns the registered `DG.Func`s applicable to it. A view's set comes from:
102
+
103
+ 1. **Dart `View.getFunctions()`** (core) — the base returns registered functions declaring
104
+ `meta.viewType: <viewType>`; subclasses add view-specific `CustomFunc`s on top
105
+ (`DataQueryView`: `getQueryInfo` / `setQueryAndRun`; `ScriptView`: `getScriptCode` /
106
+ `setScriptCode`; `TableView` merges its commands). `JsViewHost` forwards to the JS view.
107
+ 2. **JS `ViewBase.getFunctions()`** (js-api) — a JS-defined view overrides it to return its
108
+ registered package functions; e.g. Flow's `FuncFlowView` returns the `flowViewFunction`-tagged
109
+ Flow functions (`listFlowNodes`, `findFlowNodeTypes`, `addFlowNode`, `connectFlowNodes`,
110
+ `setFlowNodeInputs`, `selectFlowNode`, `runFlow`, guides). Those functions take the generic
111
+ `view` argument and reach the instance via `view.jsView` (interop `grok_View_Get_JsView`).
112
+ 3. **`meta.viewType` package functions** — any package can register a function with
113
+ `meta: {viewType: '<viewType>'}` taking the view; Grokky registers the DataQueryView SQL set
114
+ (`listDbCatalogs/Schemas/Tables`, `getDbTableDetails`, `listDbJoins`, `getSqlTestResult` — in
115
+ `db-view-functions.ts`, discovering the connection through the view's native `getQueryInfo`).
116
+
117
+ Because a view can have hundreds of functions (TableView commands), Grokky never declares them all
118
+ to Claude. Instead `viewFunctionTools()` declares four STATIC meta-tools every full-mode turn
119
+ (stable defs — prompt-cache friendly): `list_view_functions(query, widget?)` (search, ≤10 results),
120
+ `list_view_widgets()` (the view's widget tree: per-widget ref/type/aiDescription/function count),
121
+ `get_view_function_result(name, parameters, widget?)` (read-only invoke), and `call_view_function`
122
+ (state-changing invoke — the verifier demands `datagrok_verify` after it). Runners resolve the live
123
+ `grok.shell.v` at call time, inject the `view` argument, run `func.apply()`, and serialize the
124
+ result. The optional `widget` argument (a ref like `"0.2"` from `list_view_widgets`, an index path
125
+ through `Widget.children`) retargets listing/invocation at a sub-widget's own `getFunctions()`.
126
+ Defs go to the runtime as `clientTools`; the runtime exposes them via an in-process
127
+ `datagrok-view` MCP server whose calls round-trip to the browser as `input_request`.
128
+
129
+ `aiDescription` and `getFunctions()` are WIDGET-level concepts (Dart `Widget` in d4, js-api
130
+ `Widget`/`DartWidget`/`Viewer`/`ViewBase`) — views inherit them; the interop surface is
131
+ `grok_Widget_Get/Set_AIDescription` (the old `grok_View_*` pair is removed). `buildWorkspaceContext()`
132
+ prepends the current view's briefing ("About this view") plus the briefings of sub-widgets that
133
+ carry one ("Widgets here"). Entity gallery views (Dart `DataSourceCardView` subclasses:
134
+ users, groups, roles, projects, connections, queries, dockers, packages, files, ...) all inherit
135
+ `listItems` / `searchItems` / `selectItem` / `listItemCommands` / `runItemCommand` /
136
+ `refreshItems` from the base class, plus per-view extras.
137
+
138
+ Standard core widgets ship their own functions and default briefings: **dialogs** (Dart `Modal`;
139
+ always briefed with their title) expose `getDialogInfo` (incl. the dialog body text) / `setInput` /
140
+ `clickButton` plus the legacy per-button funcs, and complex dialogs add their own functions via
141
+ `Modal.aiFunctions` — the **Save Project dialog** ships `getProjectSaveInfo` / `setProjectName` /
142
+ `setProjectDescription` / `setSaveMode` / `setPresentationMode` with its entity-list child widget
143
+ (`ProjectEntityMoveWidget`) exposing `listEntities` / `setEntityAction` / `setDataSync`, and the
144
+ **Share dialog** ships `getShareInfo` / `addShareGrantee` / `setShareAccess` / `setShareMessage`
145
+ (the `datagrok-projects` skill drives both), **tab controls** `listTabs` / `selectTab`, **accordions** `listPanes` /
146
+ `expandPane`, **column selectors** (`ColumnComboBox`) `setColumn`, **range sliders** `getRange` /
147
+ `setRange`, **viewer legends** `listCategories` / `selectCategory`, **property grids** (`PropGrid`)
148
+ `getProperties` / `setProperty`, **per-column filters** (`GridFilterBase`) `resetFilter`,
149
+ **membership editors** `listMembers` / `addMember` / `removeMember`, and xamgle surfaces —
150
+ **Browse panel** `listNodes` / `expandNode` / `selectNode` (projecting its non-Widget tree),
151
+ **chemical sketcher** `getMolecule` / `setMolecule` / `clearMolecule`, **console**, **favorites**,
152
+ **functions widget** `searchFunctions`. Controls that are NOT `Widget` subclasses (inputs, tree
153
+ nodes, tag editors, popups) are invisible to the widget tree and must be projected through their
154
+ host's `getFunctions()` — see d4 `CLAUDE.md` "AI Integration" for the full conventions. **Dart viewers** ship quick commands via the `TextInterpreter` mixin (d4
155
+ `text_interpreter.dart`): no-param `reg()` commands matched by name/synonyms (`zoomIn`, `zoomOut`,
156
+ `resetView`) and parameterized funcs with anchored `searchPattern` regexes (`xBy`/`yBy`/`colorBy`/
157
+ `sizeBy`/`splitBy`/`stackBy`/`valueBy`/`categoryBy`(columnName), `aggregationType`, `chartType`,
158
+ `bins`) across scatter plot, line chart, bar chart, histogram, pie chart, box plot, density plot,
159
+ PC plot, tree map, and 3D scatter plot. The same funcs serve the sync interpreter
160
+ (`Prompt.process` matches `searchPattern` before the generic property interpreter) and the
161
+ assistant (system prompt prefers a targeted widget's quick functions — soft rule, see
162
+ `prompts.ts` "View functions"). Open dialogs live outside the view's DOM subtree, so `collectWidgets()` adds them as
163
+ extra roots with `dlg<N>` refs — this is how the assistant fills and confirms a dialog that an
164
+ entity command opened.
165
+
166
+ #### AI window visibility (sync with core)
167
+
168
+ `grok.shell.windows.showAI` (core, xamgle `ai_panel.dart`) is the single source of truth. Manual close
169
+ (X on the docked panel) resets core's `_aiDockNode` (handled in `docking.dart` `onClosing`) and the
170
+ value is persisted in core `Settings.showAI`, restored on startup. PowerPack's status-bar robot icon
171
+ and Grokky's `AIWindowManager` both read/write `showAI` and react to `onPanelVisibilityChanged`.
172
+
173
+ #### Shell AI Panel features
174
+
175
+ **`rawRender` mode** (terminal icon button): switches Claude response rendering from markdown to `<pre>`.
176
+ Only affects rendering — the Datagrok system prompt is still active unless `noPrompt` is also set.
177
+
178
+ **`!cmd`**: executes the shell command via bash without `DATAGROK_PROMPT`. The `!` prefix is stripped and
179
+ the message is sent with `systemPromptMode: 'bash'` (a minimal "output only stdout" system prompt defined in
180
+ `claude-runtime/src/prompts.ts`). Nothing streams: the answer is the model's final message, so a remark it makes
181
+ before running the command is not shown. Works in any mode, independent of `rawRender`.
182
+ `!!cmd` escapes to a literal `!cmd` prompt through the normal AI pipeline.
183
+
184
+ **`/noprompt`**: client-side slash command intercepted in `setupShellAIPanelUI()` before reaching Claude.
185
+ Calls `panel.enableNoPrompt()`: resets the session, clears output, enables `rawRender`, sets `_noPrompt = true`.
186
+ All subsequent messages in that session use `systemPromptMode: 'none'` (no system prompt at all).
187
+
188
+ **System prompt is per-message, not per-session.** Each turn carries its prompt to the session's agent
189
+ process, whose `llm_request` middleware puts it on every model request (`patch_request` in
190
+ `claude-runtime/agent/grokky_agent/providers/anthropic.py`), so `systemPromptMode` can vary per turn without
191
+ restarting the session.
192
+
193
+ ### AI UI Wiring (`src/ai/ui.ts`)
194
+
195
+ Setup functions called from `init()` that attach AI panels to platform UI elements:
196
+
197
+ - `setupSearchUI()` — wires `CombinedAISearchAssistant` into the global search bar
198
+ - `setupTableViewAIPanelUI()` — adds the AI ribbon icon to table views (toggles the singleton panel)
199
+ - `setupScriptsAIPanelUI()` — adds the AI icon to script views (toggles the singleton panel)
200
+ - `setupAIQueryEditorUI()` — called by the core query editor; just reports whether AI is configured
201
+ (the query view's tools are collected at prompt time)
202
+ - `setupShellAIPanelUI()` — shows the singleton panel in the AI window
203
+ - `setupAgentScriptsUI()` — adds a Run button to file views under `MyFiles/agents/scripts/`
204
+
205
+ `runPromptWithLifecycle()` is the central routing function: intercepts `!`/`!!` prefixes,
206
+ skips `grok.ai.processPrompt()` when `rawRender` is on, and calls `runClaudeStreaming()`.
207
+
208
+ Also exports `askWiki()` and `smartExecution()`, which back the Help and Execute search providers respectively.
209
+
210
+ ### Usage Limiter (`src/ai/usage-limiter.ts`)
211
+
212
+ `UsageLimiter` — singleton that enforces per-user daily AI request limits. Limits are group-configurable
213
+ (e.g., "AI Folks" group gets 1000/day, default is 20/day). Counts are persisted in `grok.userSettings`.
214
+
215
+ ### Conversation Storage (`src/ai/storage.ts`)
216
+
217
+ `ConversationStorage` — IndexedDB-backed persistence for chat conversations. Stores up to 20 conversations
218
+ per context (connection ID, view, etc.), each with full message history and UI state.
219
+
220
+ ### Claude Runtime Client (`src/claude/runtime-client.ts`)
221
+
222
+ Singleton WebSocket client. Discovers `claude-runtime` and `mcp-server` containers via `grok.dapi.docker`,
223
+ then exposes RxJS subjects for streaming events. API: `send()`, `abort()`, `respondToInput()`,
224
+ promise-based `query()` for one-shot structured-output calls, and `models()`, the runtime's model ids with its
225
+ default and fast model.
226
+
227
+ ### Executable Blocks (`src/claude/exec-blocks.ts`)
228
+
229
+ Processes two types of fenced blocks in Claude responses:
230
+ - `` ```datagrok-exec `` — runs JS with `grok`/`ui`/`DG`/`view`/`t` globals
231
+ - `` ```datagrok-entities `` — renders interactive entity cards (files, scripts, queries, connections, projects, spaces)
232
+
233
+ The block formats (globals, JSON shapes, return-value rendering) are documented as skills under
234
+ `dockerfiles/claude-runtime/plugin/skills/`. The full-mode system prompt inlines the two core ones
235
+ and lists the rest, which the model loads with the `skill_view` tool, keeping the prompt small.
236
+
237
+ Also provides `buildViewContext()` — serializes the current view (table columns, script code) for Claude prompts.
238
+
239
+ ### SQL Tools (`src/db/sql-tools.ts`)
240
+
241
+ `SQLGenerationContext` — client-side natural-language-to-SQL generation against a connection's schema,
242
+ supporting multiple catalogs. Backs the `DBAIPanel` query-editor assistant.
243
+
244
+ ### DB Index Tools (`src/db/db-index-tools.ts`)
245
+
246
+ `DBSchemaInfo` — caches database schema metadata (table/column info, foreign key references) per connection+schema.
247
+ Also provides `genDBConnectionMeta()` for generating and persisting LLM-friendly schema descriptions.
248
+
249
+ ### Docker Containers (`dockerfiles/`)
250
+
251
+ - `claude-runtime/` — Node server (Hono + WebSocket) driving [Hermes Agent](https://github.com/NousResearch/hermes-agent) (MIT): one `python -m grokky_agent` process per chat (`agent/grokky_agent/`) embeds Hermes' `AIAgent` and exchanges JSON lines with the server. The agent's tools are Hermes' native tools, the browser and view tools (`datagrok_exec`, `datagrok_verify`, `datagrok_show_entities`, `AskUserQuestion`, the view's `clientTools`) and the Datagrok MCP server's tools. Streams `chunk`, `tool_activity`, `revision_start`, `final`, `error`, `session_reset`, `aborted`, `queued`, `input_request` and `sync_status` to the browser. Ships the skills (`plugin/skills/`) and the skills & knowledge sync (`src/sync/`, `src/user/`, see [docs/IMPLEMENTATION.md](docs/IMPLEMENTATION.md)). Design, files and operations: [docs/CLAUDE_CODE_FLOW.md](docs/CLAUDE_CODE_FLOW.md).
252
+ - `mcp-server/` — MCP server (`@modelcontextprotocol/sdk`, HTTP transport) exposing Datagrok operations as tools: functions (list/get/call/create), files (list/download/upload), projects, spaces, and user info. Auth via per-request `x-user-api-key` / `x-datagrok-api-url` headers.
253
+
254
+ ### Deprecated Code (`src/depr/`)
255
+
256
+ Contains the previous LLM abstraction layer (`LLMClient`, `ChatGptAssistant`, `PromptEngine`, etc.) and
257
+ earlier implementations of tableview tools, script tools, and AI panels. Kept for reference but not imported
258
+ by active code. All active AI features now route through `ClaudeRuntimeClient`.
259
+
260
+ ## Key Singletons
261
+
262
+ - `ClaudeRuntimeClient.getInstance()` — WebSocket connection to Claude runtime
263
+ - `CombinedAISearchAssistant.instance` — AI search routing
264
+ - `UsageLimiter.getInstance()` — daily request limit enforcement
265
+
266
+ ## Model credentials
267
+
268
+ The model provider, key and model are the Grokky package's credentials, per group: `provider`, `apiKey`, `model`
269
+ (the one model every turn runs on) and, where a provider needs them, `baseUrl`, `region`, `apiFormat` and
270
+ `service`. The runtime reads the user's set with the container token of their WebSocket (`src/credentials.ts`);
271
+ it has no other source, so a user without credentials gets an error. Wire formats are classes in `agent/grokky_agent/formats.py`, providers in `agent/grokky_agent/providers/`.
272
+ Claude subscription logins are not supported. Details: [Credentials](docs/CLAUDE_CODE_FLOW.md#credentials).
273
+
274
+ ## Rebuilding the container images
275
+
276
+ `claude-runtime` and `mcp-server` code — `dockerfiles/*/src/`, the runtime's Python driver `agent/`,
277
+ its `plugin/` skills and `prompts.ts`, the Dockerfiles — is built **into** the image. `grok publish` / `npm run build`
278
+ rebuild only the browser bundle, not the images: rebuild the image (`docker build` in the container
279
+ dir) and redeploy after any change under `dockerfiles/`, or the container keeps serving old code.
280
+
281
+ ## Configuration
282
+
283
+ All LLM requests go through `ClaudeRuntimeClient`, which connects via WebSocket to the `claude-runtime`
284
+ Docker container. The container handles Claude API authentication internally.
package/CREDITS.md ADDED
@@ -0,0 +1,173 @@
1
+ # Grokky — Third-Party Libraries
2
+
3
+ The `@datagrok/grokky` package is distributed under the MIT license that
4
+ covers the rest of the `public/` repository (see [`../../LICENSE.md`](../../LICENSE.md)).
5
+ It incorporates the open-source components listed below; this file reproduces
6
+ the attribution and notices required by their respective licenses.
7
+
8
+ All runtime dependencies bundled into the published artifact are under
9
+ permissive licenses (MIT, Apache-2.0). No copyleft (GPL/LGPL/MPL) component is
10
+ bundled into the published Grokky plugin artifact.
11
+
12
+ ---
13
+
14
+ ## 1. Bundled in the published artifact (`dist/`)
15
+
16
+ ### Vercel AI SDK — `ai`, `@ai-sdk/provider`, `@ai-sdk/anthropic`, `@ai-sdk/openai`, `@ai-sdk/amazon-bedrock`
17
+
18
+ Provider-agnostic LLM client used by the in-browser AI features (chat panels,
19
+ search, prompt routing).
20
+
21
+ - Upstream: https://ai-sdk.dev/ — https://github.com/vercel/ai
22
+ - License: **Apache-2.0**
23
+
24
+ > Copyright 2023 Vercel, Inc.
25
+ >
26
+ > Licensed under the Apache License, Version 2.0 (the "License"); you may not
27
+ > use this file except in compliance with the License. You may obtain a copy of
28
+ > the License at http://www.apache.org/licenses/LICENSE-2.0
29
+ >
30
+ > Unless required by applicable law or agreed to in writing, software
31
+ > distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
32
+ > WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
33
+ > License for the specific language governing permissions and limitations
34
+ > under the License.
35
+
36
+ The full Apache-2.0 license text is available at the URL above and in
37
+ `node_modules/ai/LICENSE`. The upstream tarball does not ship a NOTICE file.
38
+
39
+ ### openai (6.x)
40
+
41
+ Official OpenAI JavaScript SDK.
42
+
43
+ - Upstream: https://github.com/openai/openai-node
44
+ - License: **Apache-2.0**
45
+
46
+ > Licensed under the Apache License, Version 2.0 (the "License"); you may not
47
+ > use this file except in compliance with the License. You may obtain a copy of
48
+ > the License at http://www.apache.org/licenses/LICENSE-2.0
49
+ >
50
+ > Unless required by applicable law or agreed to in writing, software
51
+ > distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
52
+ > WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53
+
54
+ Copyright is held by *OpenAI, Inc.*
55
+
56
+ ### @modelcontextprotocol/sdk (1.x)
57
+
58
+ Anthropic's official Model Context Protocol SDK — used by the in-browser
59
+ client to interact with the MCP server (see Section 4 below).
60
+
61
+ - Upstream: https://modelcontextprotocol.io/ —
62
+ https://github.com/modelcontextprotocol/typescript-sdk
63
+ - License: **MIT**
64
+
65
+ ```
66
+ MIT License
67
+
68
+ Copyright (c) 2024 Anthropic, PBC
69
+
70
+ Permission is hereby granted, free of charge, to any person obtaining a copy
71
+ of this software and associated documentation files (the "Software"), to deal
72
+ in the Software without restriction, including without limitation the rights
73
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
74
+ copies of the Software, and to permit persons to whom the Software is
75
+ furnished to do so, subject to the following conditions:
76
+
77
+ The above copyright notice and this permission notice shall be included in all
78
+ copies or substantial portions of the Software.
79
+
80
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
81
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
82
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
83
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
84
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
85
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
86
+ SOFTWARE.
87
+ ```
88
+
89
+ ### @types/dom-chromium-ai
90
+
91
+ TypeScript-only type declarations for the experimental Chromium on-device AI
92
+ APIs. Build-time only — no runtime code is bundled. License: **MIT**.
93
+
94
+ ---
95
+
96
+ ## 2. Linked at runtime via the Datagrok platform (webpack externals)
97
+
98
+ These libraries are not bundled into Grokky's `dist/` — they are provided once
99
+ by the platform host and shared across all packages.
100
+
101
+ | Component | Version | License | Upstream |
102
+ |-----------|---------|---------|-----------------------------------------|
103
+ | cash-dom | 8.x | MIT | https://github.com/fabiospampinato/cash |
104
+ | Day.js | 1.x | MIT | https://github.com/iamkun/dayjs |
105
+
106
+ ---
107
+
108
+ ## 3. Fetched at runtime from third-party LLM providers (not bundled)
109
+
110
+ The `claude-runtime` container sends chat / tool-use requests to the
111
+ Anthropic Messages API with the deployment's own Anthropic API key, and its
112
+ web tools send queries and URLs to the free tiers of Exa, Parallel, Firecrawl
113
+ and Keenable, the web-search backends Hermes Agent uses when none is configured.
114
+ These services are governed by their own respective terms of service and are
115
+ not redistributed by Datagrok.
116
+
117
+ ---
118
+
119
+ ## 4. Docker container images (`dockerfiles/`)
120
+
121
+ Grokky ships two Docker images that run alongside the Datagrok platform.
122
+ These are built and distributed separately from the JavaScript bundle.
123
+ All listed components are under permissive licenses, except three of Hermes' Python dependencies under
124
+ the weak-copyleft MPL-2.0 (certifi, pathspec, and tqdm in part), shipped unmodified.
125
+
126
+ ### `dockerfiles/claude-runtime` — Grokky AI runtime (Hono + WebSocket, Hermes Agent)
127
+
128
+ Runs one Hermes Agent session per chat in a Python driver (`agent/`) and
129
+ streams structured events to the browser. Skills/knowledge-sync system included.
130
+
131
+ | Component | License | Upstream |
132
+ |--------------------------------------|------------|---------------------------------------------------|
133
+ | Node.js 22 (`node:22.23.4-trixie-slim` base) | MIT (Node) | https://nodejs.org/ |
134
+ | Hermes Agent (pinned commit) | MIT, © 2025 Nous Research | https://github.com/NousResearch/hermes-agent |
135
+ | Hermes' locked Python dependencies (81 packages in `/opt/hermes/.venv`) | MIT, BSD, Apache-2.0, ISC, PSF-2.0; MPL-2.0: certifi, pathspec, tqdm (MPL-2.0 and MIT) | listed in Hermes' `uv.lock` |
136
+ | anthropic, mcp, jsonschema, ruamel.yaml (Python, from Hermes' locked dependencies; used by the agent) | MIT | https://github.com/anthropics/anthropic-sdk-python, https://github.com/modelcontextprotocol/python-sdk, https://github.com/python-jsonschema/jsonschema, https://sourceforge.net/projects/ruamel-yaml/ |
137
+ | CPython 3.14 (python-build-standalone, pinned in Hermes' `pm/lock.json`) | PSF-2.0 | https://www.python.org/ |
138
+ | ripgrep (Debian package) | MIT / Unlicense | https://github.com/BurntSushi/ripgrep |
139
+ | tini (Debian package) | MIT | https://github.com/krallin/tini |
140
+ | @hono/node-server, @hono/node-ws | MIT | https://hono.dev/ |
141
+ | hono | MIT | https://github.com/honojs/hono |
142
+ | yaml | ISC | https://github.com/eemeli/yaml |
143
+
144
+ The image also clones `https://github.com/datagrok-ai/public.git` at build
145
+ time into `/workspace`; the cloned source is the same MIT-licensed `public/`
146
+ repository that this `CREDITS.md` lives in. The documentation repository
147
+ `https://github.com/datagrok-ai/help.git` (MIT) is cloned into `/workspace/help`.
148
+
149
+ ### `dockerfiles/mcp-server` — Datagrok MCP server (HTTP transport)
150
+
151
+ Exposes Datagrok operations (functions, files, projects, spaces, users) as
152
+ Model Context Protocol tools.
153
+
154
+ | Component | License | Upstream |
155
+ |--------------------------------------|------------|---------------------------------------------------|
156
+ | Node.js 22 (`node:22.23.4-alpine` base) | MIT (Node) | https://nodejs.org/ |
157
+ | @modelcontextprotocol/sdk | MIT | https://github.com/modelcontextprotocol/typescript-sdk |
158
+ | @hono/node-server | MIT | https://hono.dev/ |
159
+ | hono | MIT | https://github.com/honojs/hono |
160
+
161
+ ---
162
+
163
+ ## 5. Development-only dependencies
164
+
165
+ Tools used during the build/test cycle (not in the runtime tree, not bundled):
166
+ the `datagrok-tools` CLI transitively pulls in `puppeteer-screen-recorder`,
167
+ which references `@ffmpeg-installer/ffmpeg` (LGPL-2.1) and
168
+ `@ffmpeg-installer/win32-x64` (GPLv3). These binaries are **not** redistributed
169
+ as part of the published Grokky plugin and impose no obligation on users of
170
+ the plugin.
171
+
172
+ `@types/dom-speech-recognition` and `@types/dom-chromium-ai` are TypeScript
173
+ types-only (MIT) and not in the runtime bundle.
package/LICENSE.md ADDED
@@ -0,0 +1,16 @@
1
+ Copyright 2020 Datagrok, INC
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
4
+ associated documentation files (the "Software"), to deal in the Software without restriction,
5
+ including without limitation the rights to use, copy, modify, merge, publish, distribute,
6
+ sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
7
+ furnished to do so, subject to the following conditions:
8
+
9
+ The above copyright notice and this permission notice shall be included in all copies or substantial
10
+ portions of the Software.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
13
+ NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
14
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
15
+ OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,27 @@
1
1
  # Grokky
2
2
 
3
3
  `Grokky` is a [package](https://datagrok.ai/help/develop/develop#packages) for the [Datagrok](https://datagrok.ai) platform
4
+
5
+ ## Model credentials
6
+
7
+ Grokky's model is set in the package's credentials: **Browse > Platform > Plugins**, right-click **Grokky**,
8
+ **Credentials...**. **All users** is the default; a group on the left gives its members their own key and model.
9
+ Keep **Allow client side** off, so the values never reach the browser.
10
+
11
+ Every provider needs `apiKey` and `model` (the model every turn runs on, as the provider names it, e.g.
12
+ `claude-sonnet-5-5`). `provider` defaults to `Anthropic`.
13
+
14
+ | `provider` | Also needs |
15
+ |--------------|---------------------------------------------------------------------------------------------|
16
+ | `Anthropic` | — |
17
+ | `OpenAI` | `baseUrl` only for a data-residency project (`https://<region>.api.openai.com`) |
18
+ | `OpenRouter` | — |
19
+ | `Azure` | `baseUrl`: the Azure resource |
20
+ | `Bedrock` | `region`: the AWS region the key was created in |
21
+ | `Databricks` | `baseUrl`: the workspace; optional `service`: a model service (`<catalog>.<schema>.<name>`) to call `model` through |
22
+ | `Custom` | `baseUrl`: the https endpoint; `apiFormat`: `anthropic-messages`, `openai-responses` or `openai-chat-completions` |
23
+
24
+ - A user without credentials gets an error in the AI panel.
25
+ - Changes reach a user on their next connection (a page reload).
26
+ - Do not set provider credentials on the `grokky-claude-runtime` container: the platform lays them over the package's.
27
+ - `POST /credentials/for/Grokky?group=<group>` saves with **Allow client side** on: turn it off in the dialog.
@@ -0,0 +1 @@
1
+ {"tiers":["viewers"],"audits":{"layout":"report","errors":"report","balloons":"report","operability":"report"}}
@@ -0,0 +1,9 @@
1
+ /* The Grokky AI panel: the platform docks it when `grok.shell.windows.showAI` is on, and Grokky fills
2
+ it with the chat (prompt box, Stop button, responses, AskUserQuestion forms, system messages). */
3
+ import {element} from '@datagrok-libraries/bdd';
4
+
5
+ export const AI_PANEL = '.d4-ai-generation-panel';
6
+ export const AI_PROMPT_BOX = `${AI_PANEL} textarea.d4-ai-input-textarea`;
7
+
8
+ element('AI stop button', {selector: `${AI_PANEL} .d4-ai-panel-run-controls .fa-stop`,
9
+ description: 'the Stop icon the panel shows while a turn runs'});