@tenderprompt/cli 0.1.24 → 0.1.26

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.
package/README.md CHANGED
@@ -39,10 +39,13 @@ session:
39
39
  - inspect artifact-scoped analytics without SQL or platform credentials
40
40
  - inspect artifact-scoped app database tables, schema, and bounded read-only
41
41
  query output
42
+ - create private app admin dashboard, resource, view, and widget definitions
43
+ from structured app database specs
42
44
  - share app setup between Tender accounts without copying customer data,
43
45
  analytics history, app database rows, secrets, or release history
44
46
  - run server-validated chart specs and export aggregate rows
45
47
  - generate starter analytics suggestions
48
+ - print a non-mutating default analytics provisioning plan for generated apps
46
49
  - create, list, update, and delete saved analytics dashboards and charts, with
47
50
  `--dry-run` available for write previews
48
51
 
@@ -79,6 +82,13 @@ For agents, keep the pattern simple:
79
82
  6. call `preview`, `publish --dry-run`, then `publish --confirm publish` only
80
83
  when the user asked to publish
81
84
 
85
+ For replacement work, run `tender app analytics authoring --json` before adding
86
+ or repairing instrumentation. Its agent guidance tells agents to inspect the
87
+ existing shopper surface before source edits, keep operator analytics out of
88
+ shopper UI, and treat default analytics plus saved starter dashboard charts as
89
+ part of generated-app delivery unless the user opts out or there is a concrete
90
+ blocker.
91
+
82
92
  ## Auth
83
93
 
84
94
  Use the device login flow to mint a local token:
@@ -148,6 +158,11 @@ tender app db tables artifact_123 --env published --json
148
158
  tender app db schema artifact_123 --env published --table votes --json
149
159
  tender app db query artifact_123 --env published --sql "select * from votes limit 20" --json
150
160
  tender app db query artifact_123 --env published --sql "select * from votes order by created_at" --limit 50 --offset 50 --json
161
+ tender app db dashboards artifact_123 --create "App admin" --default-env published --dry-run --json
162
+ tender app db resources suggest artifact_123 --env published --json
163
+ tender app db dashboards render artifact_123 --dashboard app_db_dashboard_123 --env published --json
164
+ tender app db resources create artifact_123 --dashboard app_db_dashboard_123 --spec resource.json --dry-run --json
165
+ tender app db widgets create artifact_123 --dashboard app_db_dashboard_123 --title "Total signups" --spec widget.json --dry-run --json
151
166
  ```
152
167
 
153
168
  ## Shared app setup
@@ -185,6 +200,7 @@ agents:
185
200
 
186
201
  ```bash
187
202
  tender app analytics capabilities artifact_123 --include-catalog --range 30d --json
203
+ tender app analytics provision artifact_123 --from-app --json
188
204
  ```
189
205
 
190
206
  That response tells the agent:
@@ -201,6 +217,8 @@ Common read-only commands:
201
217
  ```bash
202
218
  tender app analytics summary artifact_123 --range 30d --json
203
219
 
220
+ tender app analytics provision artifact_123 --from-app --json
221
+
204
222
  tender app analytics query artifact_123 --spec chart.json --json
205
223
 
206
224
  tender app analytics query artifact_123 --spec - --json < chart.json
@@ -256,6 +274,10 @@ explicit:
256
274
  tender app analytics charts list artifact_123 --dashboard analytics_dashboard_123 --json
257
275
  ```
258
276
 
277
+ `analytics provision --from-app` is a guided plan in this release, not a hidden
278
+ write. It returns starter chart specs, write-preview commands, write commands,
279
+ blockers, and the chart-list completion proof an external agent should report.
280
+
259
281
  Agents should combine `capabilities --include-catalog` with local source-code
260
282
  inspection. For example, inspect where the app calls
261
283
  `__TP_ANALYTICS.invoke(...)`, propose a chart spec, validate it with
@@ -325,6 +347,26 @@ Client and server limits include a 100 KB statement cap and at most 100 bound
325
347
  parameters. The server enforces the final policy, row limits, response limits,
326
348
  artifact scope, and audit logging.
327
349
 
350
+ Private app admin dashboards are definition-only in the CLI. Use the same
351
+ artifact-scoped `db-read` profile to save dashboards, table-backed resources,
352
+ saved views, and widgets; raw app rows stay in the generated app database.
353
+ Logged-in users can open saved dashboards at `/#/workspace/<artifact-id>/admin`.
354
+
355
+ ```bash
356
+ tender app db resources suggest artifact_123 --profile db --env published --json
357
+ tender app db dashboards artifact_123 --profile db --create "Coffee Matcher Admin" --default-env published --json
358
+ tender app db resources create artifact_123 --profile db --dashboard app_db_dashboard_123 --spec resource.json --view recent.json --json
359
+ tender app db widgets create artifact_123 --profile db --dashboard app_db_dashboard_123 --title "Votes by choice" --spec widget.json --json
360
+ tender app db dashboards render artifact_123 --profile db --dashboard app_db_dashboard_123 --env published --json
361
+ ```
362
+
363
+ Suggested app database resources may include `dateRange: { "source":
364
+ "dashboard", "column": "created_at" }` so saved admin dashboards behave like a
365
+ Grafana dashboard: one top-level date range applies to charts and tables by
366
+ default, while resource filters stay available for local drill-downs. Use
367
+ `dateRange: { "source": "off" }` or a fixed override only for panels that should
368
+ not follow the dashboard date range.
369
+
328
370
  ## Safety Model
329
371
 
330
372
  - Local agents run in the user's environment, not in Tender.
@@ -100,7 +100,8 @@ function assertUsefulMemoryText(input) {
100
100
  if (lineCount > 240 || byteLength(total) > ARTIFACT_MEMORY_ENTRY_MAX_BYTES) {
101
101
  throw new Error(`Memory entries are limited to ${ARTIFACT_MEMORY_ENTRY_MAX_BYTES} bytes. Summarize the relevant context instead.\nNext: tender memory handoff --reason "Need Tender support" --summary "Current blocker and what was tried"`);
102
102
  }
103
- if (lineCount > 40 && !/^summary|support_handoff|reflection$/i.test(input.summary)) {
103
+ const allowsLongBody = input.kind === 'summary' || input.kind === 'support_handoff' || input.kind === 'reflection';
104
+ if (lineCount > 40 && !allowsLongBody) {
104
105
  throw new Error('Memory entries should be bounded summaries, not raw transcript dumps.\nNext: tender memory add --kind summary --summary "Compact the useful context" --body "Goal, changes, failures, and next step"');
105
106
  }
106
107
  }
@@ -162,14 +163,14 @@ async function readExistingNote(input) {
162
163
  return result.exitCode === 0 ? result.stdout : '';
163
164
  }
164
165
  export async function appendArtifactMemoryNote(input) {
165
- assertUsefulMemoryText(input);
166
+ const normalizedKind = normalizeArtifactMemoryKind(input.kind);
167
+ assertUsefulMemoryText({ ...input, kind: normalizedKind.kind });
166
168
  const commitSha = input.commitSha ?? (await readArtifactMemoryHead(input));
167
169
  const artifactId = input.artifactId ?? (await inferArtifactIdFromRemote(input));
168
170
  if (!artifactId) {
169
171
  throw new Error('Artifact memory requires an artifact id. Pass --artifact or run inside a checkout with a Tender artifact remote.\nNext: tender app git setup <app-id> --dir .');
170
172
  }
171
173
  const sessionId = await readArtifactMemorySessionId(input);
172
- const normalizedKind = normalizeArtifactMemoryKind(input.kind);
173
174
  const redactedSummary = redactArtifactMemoryText(input.summary.trim());
174
175
  const redactedBody = input.body?.trim() ? redactArtifactMemoryText(input.body.trim()) : null;
175
176
  const warnings = [