@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
@@ -5,16 +5,31 @@
5
5
  "main": "dist/server.js",
6
6
  "scripts": {
7
7
  "start": "node dist/server.js",
8
- "build": "tsc"
8
+ "build": "tsc",
9
+ "watch": "tsc --watch",
10
+ "lint": "eslint \"src/**/*.ts\"",
11
+ "lint-fix": "eslint \"src/**/*.ts\" --fix",
12
+ "lint:agent": "python3 -m ruff check agent && python3 -m mypy",
13
+ "test": "tsc && node --test test/*.test.js"
9
14
  },
10
15
  "dependencies": {
11
- "@anthropic-ai/claude-agent-sdk": ">=0.2.0",
12
- "@hono/node-server": "^1.13.0",
13
- "@hono/node-ws": "^1.3.0",
14
- "hono": "^4.6.0"
16
+ "@hono/node-server": "^2.1.6",
17
+ "@hono/node-ws": "^1.3.1",
18
+ "hono": "^4.13.16",
19
+ "yaml": "^2.8.3"
20
+ },
21
+ "overrides": {
22
+ "ws": "^8.21.0",
23
+ "@hono/node-ws": {
24
+ "@hono/node-server": "$@hono/node-server"
25
+ }
15
26
  },
16
27
  "devDependencies": {
17
28
  "@types/node": "^20.3.1",
29
+ "@typescript-eslint/eslint-plugin": "^8.67.0",
30
+ "@typescript-eslint/parser": "^8.67.0",
31
+ "eslint": "^8.57.1",
32
+ "eslint-config-google": "^0.14.0",
18
33
  "typescript": "^5.1.3"
19
34
  }
20
35
  }
@@ -0,0 +1,5 @@
1
+ {
2
+ "name": "grokky-runtime",
3
+ "version": "1.0.0",
4
+ "description": "Datagrok output formats — fenced blocks for rendering interactive UI back to the browser chat panel."
5
+ }
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: datagrok-calc-column
3
+ description: Add a calculated, formula-based column to a dataframe via the datagrok_exec tool. Use whenever the user asks to compute, derive, add, or create a new column from existing columns — LipE, ratios, log/round, heavy atom count, any expression in the Datagrok formula DSL. Replaces hand-written addNewFloat/addNewInt + for-loop with a single formula-attached column that recomputes when source columns change.
4
+ ---
5
+
6
+ # datagrok-calc-column
7
+
8
+ Use `t.columns.addNewCalculated(name, formula, type?)` in `datagrok_exec` code
9
+ to add a formula-driven column. The formula stays attached to the column,
10
+ so edits to source columns trigger automatic recompute.
11
+
12
+ On a table open in a view, add the column with the `table_add_column` tool (`{name, formula}`), which records
13
+ the undo step; a script that calls `addNewCalculated` itself ends with `undoable.columnAdded(col)` on the column
14
+ it returned (see `datagrok-undo`).
15
+
16
+ Do **not** use `t.columns.addNewFloat('LipE')` plus a manual `for` loop — that
17
+ produces a static column with no formula and no recompute.
18
+
19
+ ## Signature
20
+
21
+ ```ts
22
+ await t.columns.addNewCalculated(
23
+ name, // string
24
+ formula, // string — DSL, see below
25
+ type?, // 'auto' (default) | 'double' | 'int' | 'string' | 'bool' | 'datetime'
26
+ treatAsString?, // boolean — wraps formula in quotes
27
+ ): Promise<DG.Column>
28
+ ```
29
+
30
+ `t` is the current `DG.DataFrame` (injected by `datagrok_exec`). If you have a
31
+ DataFrame from elsewhere, replace `t` with that variable.
32
+
33
+ ## Formula DSL — quick reference
34
+
35
+ | Form | Meaning |
36
+ |----------------------|----------------------------------------------------|
37
+ | `${ColumnName}` | per-row scalar reference, exact case |
38
+ | `$[ColumnName]` | whole-column reference (use inside aggregates) |
39
+ | `row` | current row index |
40
+ | `+ - * / ^` | operators |
41
+ | `Round`, `RoundFloat`, `Log`, `Log10`, `Sqrt`, `Abs` | math functions |
42
+ | `Avg($[col])`, `Sum($[col])`, `Min($[col])`, `Max($[col])`, `StDev($[col])` | aggregates over a whole column |
43
+ | `Max([${A}, ${B}])`, `Min([${A}, ${B}])` | per-row max / min across columns — the argument is an **array** |
44
+ | `Chem:getInchis(${molecule})` | only functions tagged `vectorFunc: 'true'` work here — see [Which functions work in a formula](#which-functions-work-in-a-formula) |
45
+ | `"text"` | string literal (double quotes) |
46
+
47
+ Both operator and function forms parse: `${pIC50} - ${cLogP}` ≡ `Sub(${pIC50}, ${cLogP})`.
48
+
49
+ Full function catalog: `help/transform/add-new-column.md`.
50
+
51
+ ## Examples
52
+
53
+ ```js
54
+ // Lipophilic efficiency
55
+ await t.columns.addNewCalculated('LipE', '${pIC50} - ${cLogP}');
56
+ ```
57
+
58
+ ```js
59
+ // Log of activity
60
+ await t.columns.addNewCalculated('logIC50', 'Log10(${IC50})');
61
+ ```
62
+
63
+ ```js
64
+ // Per-row maximum of two columns — note the array argument.
65
+ await t.columns.addNewCalculated('CS max', 'Max([${Chemical Space X}, ${Chemical Space Y}])');
66
+ ```
67
+
68
+ ## Which functions work in a formula
69
+
70
+ A package function (`Chem:foo`, `Admetica:bar`, ...) can be used inside an
71
+ `addNewCalculated` formula only if it is tagged `vectorFunc: 'true'` in its
72
+ metadata. Everything else must be called imperatively via
73
+ `grok.functions.call(...)` in a separate `datagrok_exec` call.
74
+
75
+ ## Chem properties → use the chem catalog, not a formula
76
+
77
+ For molecular properties (MW, LogP, LogS, HBA, HBD, PSA, rotatable bonds,
78
+ stereo centers, molecule charge): use `Chem:addChemPropertiesColumns` (boolean
79
+ flags) or `Chem:getProperties(molecules, selected?)` (string list) — see
80
+ `datagrok-chem-toolkit`. Example:
81
+
82
+ ```js
83
+ await grok.functions.call('Chem:addChemPropertiesColumns', {
84
+ table: t, molecules: t.col('smiles'), MW: true,
85
+ });
86
+ ```
87
+
88
+ ## What this skill does NOT do
89
+
90
+ - It does not filter, sort, or select rows — those are separate skills.
91
+ - It does not add viewers — use `grok.shell.addViewer(...)` or a future viewer skill.
92
+ - It does not run server-side scripts — use `grok.functions.call(...)` or the script's registered name.
@@ -0,0 +1,250 @@
1
+ ---
2
+ name: datagrok-chem-data
3
+ description: Bioactivity and small-molecule data-side catalog. Covers ChEMBL search/lookup, MolTrack compound and batch registration, HitTriage / HitDesign / PeptiHit workflows, and Curves dose-response analysis (IC50/EC50 fitting). Open this skill when the user asks about querying ChEMBL, registering or looking up compounds in MolTrack, running a hit-triage campaign, or fitting/inspecting dose-response curves.
4
+ ---
5
+
6
+ # datagrok-chem-data
7
+
8
+ Function catalog for the **data and workflow** half of Datagrok cheminformatics:
9
+ Chembl, MolTrack, HitTriage, Curves.
10
+
11
+ All functions are callable through the `datagrok_exec` tool via
12
+ `grok.functions.call('<Package>:<funcName>', {param1, param2, ...})`. For the
13
+ data-side packages, results are usually `DG.DataFrame` objects produced by SQL
14
+ queries.
15
+
16
+ For the structure-and-modeling side (Chem, Admetica, Reinvent4, Docking,
17
+ Boltz1), see the sibling skill **`datagrok-chem-toolkit`**.
18
+
19
+ ### Param-type conventions used below
20
+
21
+ Types match Datagrok function declarations: `dataframe`, `column`, `string`,
22
+ `int`, `float`, `bool`, `list<T>`, `object`. A column with a required semType
23
+ is written `column<semType>` (e.g. `column<Molecule>`). Enum values are listed
24
+ inline as `'a' | 'b' | 'c'`. `?` marks optional, `= x` shows the default.
25
+
26
+ ### Namespace casing
27
+
28
+ The package is referenced as **`Chembl:`** in `grok.functions.call(...)` and
29
+ `grok.data.query(...)`. It's branded as "ChEMBL" in UI text, but the function
30
+ namespace is namespace-exact lowercase-after-first-letter: `Chembl:foo`,
31
+ never `ChEMBL:foo` or `chembl:foo`.
32
+
33
+ ### Always emit an exec block when the intent is clear
34
+
35
+ If the user asks for a concrete data-side action ("register this compound",
36
+ "fit IC50 from this data", "what is the SMILES of aspirin", "list ChEMBL
37
+ compounds for organism X") — call `datagrok_exec` with code calling the relevant
38
+ function below. Don't answer chemistry/data questions from memory when a
39
+ catalog function exists. If a required input (SMILES, payload, mapping JSON)
40
+ is missing, emit the block with a clearly-marked placeholder or sensible
41
+ default and add a one-line note — don't bail out into a conversational reply.
42
+
43
+ ### Tag legend (used in function tables below)
44
+
45
+ Same tags as `datagrok-chem-toolkit`'s "Calling conventions" section, plus a
46
+ few data-side specific ones. Common values that appear in the **Tags** column:
47
+
48
+ | Tag | Meaning |
49
+ |----------------------|------------------------------------------------------------------------------------------------------------------------------------------|
50
+ | `vectorFunc` | Returns a `DG.DataFrame`. Usable inside a `t.columns.addNewCalculated(name, formula)` call and the Add-New-Column dialog. Without it, call via `grok.functions.call`. |
51
+ | `transform` | Tagged as a data-sync transform — same behavior as the un-tagged sibling but tracked in project history. |
52
+ | `topMenu` | Has a Top-menu path. |
53
+ | `app` / `appTreeBrowser` | App entry point / its tree-browser sidebar hook. |
54
+ | `panel` | Context-panel widget — `DG.Widget` shown in the right side panel. |
55
+ | `demo` | Demo function — opens a tutorial layout. |
56
+ | `fileViewer` / `fileHandler` | Registered for a specific file extension. |
57
+ | `cellRenderer` | Custom cell renderer. |
58
+ | `converter` | Type converter (`meta.role: 'converter'` with an `inputRegexp`). |
59
+ | `curveConverter` | Curves package — registers a curve-format converter (`3dx`, `compact-dr`, `pzfx`). |
60
+ | `hitTriageDataSource` / `pepTriageDataSource` | HitTriage / PepTriage data source registered for the campaign-ingest picker. |
61
+
62
+ ---
63
+
64
+ ## Cross-package routing — "User wants X → call Y"
65
+
66
+ | User intent | Function | Package |
67
+ |---|---|---|
68
+ | ChEMBL substructure search | `Chembl:chemblSubstructureSearchPanel` (panel) or query `Chembl:patternSubstructureSearch` | Chembl |
69
+ | ChEMBL similarity search | `Chembl:chemblSimilaritySearchPanel` (panel) or query `Chembl:patternSimilaritySearch` | Chembl |
70
+ | ChEMBL ID → SMILES | `Chembl:chemblIdToSmilesTs` | Chembl |
71
+ | Get ChEMBL molregno for SMILES | `Chembl:chemblMolregno` | Chembl |
72
+ | Pull ChEMBL compounds by organism | `Chembl:getChemblCompoundsByOrganism` | Chembl |
73
+ | Open MolTrack (register, browse or search compounds, batches, assays) | `MolTrack:molTrackApp` | MolTrack |
74
+ | Start a Hit Triage campaign | `HitTriage:hitTriageApp` | HitTriage |
75
+ | Start a Hit Design campaign | `HitTriage:hitDesignApp` | HitTriage |
76
+ | Start a PeptiHit campaign | `HitTriage:peptiHitApp` | HitTriage |
77
+ | Get demo molecule dataset (100 / 5000 / N) | `HitTriage:demoFileIngest`, `HitTriage:demoFileIngest1`, `HitTriage:demoFileIngest2` | HitTriage |
78
+ | Convert raw plate readouts into fit-curve cells | `Curves:dataToCurves` or `Curves:dataToCurvesTopMenu` | Curves |
79
+ | Compute IC50 / Hill / AUC / Top / Bottom from dose-response data | `Curves:dataToCurves` (fit) → `Curves:addStatisticsColumn` (extract) | Curves |
80
+ | Pull a stat from existing fit cells | `Curves:addStatisticsColumn` | Curves |
81
+ | Aggregate fit stats across series | `Curves:addAggrStatisticsColumn` | Curves |
82
+ | Open a `.pzfx` GraphPad Prism file | `Curves:previewPzfx` | Curves |
83
+ | Compute Minimum Significant Ratio | script `Curves:CalculateMSR` (see Curves Scripts) | Curves |
84
+
85
+ ---
86
+
87
+ ## Chembl package — local ChEMBL search and lookup (`Chembl:...`)
88
+
89
+ Thin TS layer over SQL queries against a local ChEMBL PostgreSQL connection.
90
+ The heavy lifting is in `Chembl/queries/` — these TS functions just expose
91
+ useful entry points.
92
+
93
+ ### Programmatic functions
94
+
95
+ | Function | Tags | What it does |
96
+ |---|---|---|
97
+ | `chemblIdToSmilesTs(id: string = 'CHEMBL1185')` | `converter` | CHEMBL ID (e.g. `'CHEMBL1185'`) → canonical SMILES. Registered as a `converter` for the `(CHEMBL[0-9]+)` regex — string fields auto-resolve. **Only goes ID → SMILES**; for InChI key / other-ID → ChEMBL ID, use `Chem:mapIdentifiersTransform` from the toolkit skill. |
98
+ | `chemblMolregno(table: dataframe, molecules: column<Molecule>)` | — | Appends a `CHEMBL molregno` column to the table by looking up each SMILES in the ChEMBL DB. |
99
+ | `getChemblCompoundsByOrganism(maxNumberOfMolecules: int = 1000, organism: string = 'Shigella')` | `hitTriageDataSource` | Pulls compounds active against targets of the given organism. Returns DataFrame. |
100
+ | `getChemblCompounds(maxNumberOfMolecules: int = 1000)` | `hitTriageDataSource` | Pulls a generic ChEMBL compound sample. |
101
+ | `namesToSmiles(names: list<string>)` (SQL query) | — | The underlying SQL query that powers `Chem:namesToSmiles`. Returns a DataFrame with a `canonical_smiles` column. Invoke via `grok.functions.call('Chembl:namesToSmiles', {names: ['aspirin','ibuprofen',...]})` or via `grok.data.query`. |
102
+
103
+ ### Panels (context-panel widgets)
104
+
105
+ All entries below have the `panel` tag.
106
+
107
+ | Panel | What |
108
+ |---|---|
109
+ | `chemblSubstructureSearchPanel(mol)` | "Databases \| ChEMBL \| Substructure Search (Internal)". |
110
+ | `chemblSimilaritySearchPanel(mol)` | "Databases \| ChEMBL \| Similarity Search (Internal)". |
111
+ | `chemblSearchWidgetLocalDb(mol: string, substructure: bool = false)` | The underlying widget — call directly to embed in custom UI. |
112
+
113
+ ### Demos
114
+
115
+ `demoDatabasesChembl()` — opens the "Database Queries" demo. Top menu: Cheminformatics → Database Queries.
116
+
117
+ ### Skipped
118
+
119
+ - `init` — registers the CHEMBL ID handler at startup.
120
+
121
+ ---
122
+
123
+ ## MolTrack package — small-molecule registration system (`MolTrack:...`)
124
+
125
+ Registers compounds, batches and assay data in the `moltrack` domain schema.
126
+ Registration, bulk import and search happen in the app; there are no
127
+ registration or search functions to call.
128
+
129
+ | Function | Tags | What it does |
130
+ |---|---|---|
131
+ | `molTrackApp(path?: string)` | `app` | Opens MolTrack. `path`: `'Compounds' \| 'Batches' \| 'Assays' \| 'AssayRuns' \| 'AssayResults' \| 'Additions'`. `Compounds?corporate_compound_id=DG-000060` opens one compound, `Batches?corporate_batch_id=DGB-000365` one batch. |
132
+
133
+ To read the data: `grok.dapi.domains.table('moltrack.compound')` (also
134
+ `compound_batch`, `addition`, `batch_addition`, `assay`, `assay_run`, `assay_result`).
135
+
136
+ ---
137
+
138
+ ## HitTriage package — small-mol hit triage workflows (`HitTriage:...`)
139
+
140
+ Multi-step campaign apps for triaging hits, designing new molecules, and the
141
+ peptide-flavored variants.
142
+
143
+ ### Apps (each returns a `DG.ViewBase`)
144
+
145
+ All entries below have the `app` tag.
146
+
147
+ | Function | What it does |
148
+ |---|---|
149
+ | `hitTriageApp()` | **Hit Triage** — end-to-end small-mol triage pipeline. browsePath `Chem`. |
150
+ | `hitDesignApp()` | **Hit Design** — design + score new analogs. browsePath `Chem`. |
151
+ | `peptiHitApp()` | **PeptiHit** — peptide variant. Internally inits Bio. browsePath `Peptides`. |
152
+ | `pepTriageApp()` | **PepTriage** — peptide triage. Internally inits Bio. browsePath `Peptides`. |
153
+
154
+ ### Tree-browser hooks (auto-registered)
155
+
156
+ `hitTriageAppTreeBrowser`, `hitDesignAppTreeBrowser`, `peptiHitAppTreeBrowser`,
157
+ `pepTriageAppTreeBrowser` — populate the campaigns tree in the sidebar.
158
+
159
+ ### Demo data sources
160
+
161
+ | Function | Tags | What it does |
162
+ |---|---|---|
163
+ | `demoFileIngest()` | `hitTriageDataSource` | 100-molecule demo dataset. |
164
+ | `demoFileIngest1()` | `hitTriageDataSource` | 5000-molecule demo dataset. |
165
+ | `demoFileIngest2(numberOfMolecules: int)` | `hitTriageDataSource` | Variable-size demo dataset. |
166
+ | `demoPeptideSequences(peptideCount: int)` | `pepTriageDataSource` | Demo HELM peptide sequences for PeptiHit. |
167
+ | `demoFileSubmit(df: dataframe, molecules: string)` | — | Demo submit handler (logs row count). |
168
+
169
+ ### Misc
170
+
171
+ | Function | Tags | What it does |
172
+ |---|---|---|
173
+ | `registerMoleculesToViD()` | — | Registers the molecules of Hit Design campaigns in V-iD storage (opens a dialog to pick a campaign; irreversible). |
174
+ | `hitDesignVidPanel(vid: semantic_value<HIT_DESIGN_VID>)` | `panel` | "Hit Design V-iD" context panel — shows campaigns for a V-iD. |
175
+ | `gasteigerCellRenderer()` | `cellRenderer` | PNG cell renderer for Gasteiger charge images. |
176
+ | `htPackageSettingEditor(propList: object)` | — | Hit Triage package settings editor (UI). |
177
+
178
+ ### Skipped (UI plumbing)
179
+
180
+ Tree-browser callbacks above are not invoked directly by user code.
181
+
182
+ ### Queries shipped in `queries/`
183
+
184
+ - `locks.sql` — concurrency / lock tracking queries.
185
+ - `vid.sql` — campaign V-iD lookups: `getCampaignsByVid`, `getMoleculeByVid`
186
+ (used by the `hitDesignVidPanel` panel).
187
+
188
+ ---
189
+
190
+ ## Curves package — dose-response curves (`Curves:...`)
191
+
192
+ Stores curve data in a single cell (one `DG.Column` of fit chart JSON) and
193
+ renders it as a per-cell curve. Includes converters from XML 3DX, compact-DR,
194
+ and GraphPad Prism `.pzfx` formats.
195
+
196
+ **Fit-statistic property enum** (used by `addStatisticsColumn` and `addAggrStatisticsColumn`'s `propName`): keys from the curve `FitStatistics` type — `'rSquared' | 'auc' | 'interceptX' | 'interceptY' | 'slope' | 'top' | 'bottom'`. (IC50 corresponds to `interceptX` for the standard 50% intercept; aliases like `'IC50'` / `'Hill'` / `'AUC'` are recognised at the UI/sigmoid layer but the canonical key is `interceptX` — a key outside this enum yields an all-null column with no error.)
197
+
198
+ ### Building and inspecting curves
199
+
200
+ | Function | Tags | What it does |
201
+ |---|---|---|
202
+ | `dataToCurves(df: dataframe, concentrationCol: column<numerical>, readoutCol: column<numerical>, batchIDCol: column, assayCol: column, runIDCol: column, compoundIDCol: column, targetEntityCol: column, excludeOutliersCol?: column, parentTable?: dataframe, fitParamColumns?: list<string>, reportedIC50Column?: string, reportedQualifiedIC50Column?: string, experimentIDColumn?: string, qualifierColumn?: string, additionalColumns?: list<string>, wellLevelJoinCol?: string, parentLevelJoinCol?: string, wellLevelAdditionalColumns?: list<string>)` | — | **Main programmatic entry.** Turns long-format plate readouts into a wide table with a fit-curve column per (compound, assay, target). |
203
+ | `dataToCurvesTopMenu()` | `topMenu` | UI wrapper around `dataToCurves`. Top menu: Data → Curves → Data to Curves. |
204
+ | `addStatisticsColumn(table: dataframe, colName: string, propName: 'rSquared' \| 'auc' \| 'interceptX' \| 'interceptY' \| 'slope' \| 'top' \| 'bottom', seriesNumber: int)` | `vectorFunc`, `transform` | Adds a column with one fit statistic for a given series index (0-based). `propName` is a key of the `FitStatistics` type — IC50 is the standard 50% intercept (`interceptX`). |
205
+ | `addAggrStatisticsColumn(table: dataframe, colName: string, propName: 'rSquared' \| 'auc' \| 'interceptX' \| 'interceptY' \| 'slope' \| 'top' \| 'bottom', aggrType: 'avg' \| 'min' \| 'max' \| 'med' \| 'sum' \| 'stdev')` | `vectorFunc`, `transform` | Same but aggregated across all series in each cell. |
206
+
207
+ **For "compute IC50 values from this dose-response dataset" intent:** two steps. (1) Fit: `Curves:dataToCurves(t, concCol, readoutCol, batchCol, assayCol, runCol, compoundCol, targetCol)` — guess the columns from the current table (concentration/dose, readout/response, compound/batch IDs). (2) Extract: `Curves:addStatisticsColumn(fitTable, 'fit', 'interceptX', 0)` to pull IC50 from series 0. Always make both calls back-to-back; never reply conversationally for an IC50 request.
208
+
209
+ ### Demos
210
+
211
+ `curveFitDemo()` — generic curve-fit demo. `assayCurveFitDemo()` — multi-compound assay-curve dashboard.
212
+
213
+ ### Curve format converters
214
+
215
+ All entries below have the `curveConverter` tag.
216
+
217
+ | Function | Format |
218
+ |---|---|
219
+ | `convertXmlCurveToJsonFunc` | `3dx` XML curves |
220
+ | `convertCompactDrToJsonFunc` | `compact-dr` JSON |
221
+ | `convertPzfxToJsonFunc` | GraphPad Prism `.pzfx` |
222
+
223
+ ### File handlers
224
+
225
+ | Function | Tags | What it does |
226
+ |---|---|---|
227
+ | `previewPzfx(file: file)` | `fileViewer` | Opens `.pzfx` as a curve grid. |
228
+ | `pzfxFileHandler(bytes: list<int>)` | `fileHandler` | Parses `.pzfx` → list of DataFrames. |
229
+
230
+ ### Skipped (lifecycle)
231
+
232
+ - `_initCurves` — registers handlers + external converters.
233
+
234
+ ### Scripts shipped in `scripts/`
235
+
236
+ - `CalculateMSR` (Python) — Minimum Significant Ratio for assay reproducibility.
237
+ Callable as `grok.functions.call('Curves:CalculateMSR', { ... })` once you
238
+ know its inputs (open the script to see the `#input:` header).
239
+
240
+ ---
241
+
242
+ ## Note on `Compute` package
243
+
244
+ The `Compute` package has no small-molecule-specific functions or scripts. Its
245
+ package.ts exposes the `RichFunctionView`, `Pipeline`, validators, and uploaders
246
+ for the compute-utils framework; its `scripts/` are physics / dynamics demos
247
+ (Lorenz attractor, Lotka-Volterra, Newton cooling, antibody Fab-arm exchange,
248
+ maximal-filter-volume in R, bioreactor utilities). If a small-molecule task
249
+ seems to need Compute, you almost certainly want a different package — usually
250
+ one of the ones cataloged here or in `datagrok-chem-toolkit`.