@frontera-sdk/cli 1.52.39 → 1.52.40
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 +9 -0
- package/package.json +6 -4
- package/src/adopt.ts +6 -2
- package/src/api/apps-api.ts +86 -4
- package/src/api/blueprint-authoring-api.ts +35 -11
- package/src/api/dataset-api.ts +29 -0
- package/src/api/governed-action-api.ts +90 -2
- package/src/api/platform-api.ts +87 -2
- package/src/api/workflow-api.ts +33 -2
- package/src/app-contract.ts +156 -0
- package/src/app-lock.ts +125 -0
- package/src/args.ts +14 -3
- package/src/auth-verify.ts +10 -0
- package/src/automation-template.ts +12 -1
- package/src/blueprint/action-rules.ts +516 -0
- package/src/blueprint/action-semantic-fit.ts +205 -0
- package/src/blueprint/compile.ts +51 -2
- package/src/blueprint/diff.ts +34 -2
- package/src/blueprint/metric-query.ts +215 -0
- package/src/blueprint/metric-rules.ts +122 -0
- package/src/blueprint/object-sets.ts +116 -0
- package/src/blueprint/ontology-edit-plan.ts +48 -4
- package/src/blueprint/projection.ts +24 -1
- package/src/blueprint/scaffold.ts +84 -42
- package/src/commands/action/available.ts +1 -1
- package/src/commands/action/criteria-refusal.ts +84 -0
- package/src/commands/action/decide.ts +5 -2
- package/src/commands/action/deploy.ts +13 -4
- package/src/commands/action/list.ts +134 -19
- package/src/commands/action/requests.ts +34 -6
- package/src/commands/action/submit.ts +28 -13
- package/src/commands/agent/index-commands.ts +69 -7
- package/src/commands/agent/resolve.ts +2 -0
- package/src/commands/app/checks.ts +44 -0
- package/src/commands/app/deploy.ts +243 -60
- package/src/commands/app/deployments.ts +97 -0
- package/src/commands/app/dev.ts +103 -11
- package/src/commands/app/init.ts +36 -3
- package/src/commands/app/promote.ts +45 -19
- package/src/commands/app/pull.ts +3 -1
- package/src/commands/app/rollback.ts +46 -0
- package/src/commands/app/sdk.ts +54 -8
- package/src/commands/app/unpin.ts +27 -0
- package/src/commands/app/versions.ts +1 -1
- package/src/commands/automation/bindings.ts +4 -2
- package/src/commands/automation/build-entry.ts +4 -1
- package/src/commands/automation/index-commands.ts +3 -1
- package/src/commands/automation/pull.ts +6 -1
- package/src/commands/automation/run.ts +34 -9
- package/src/commands/blueprint/bind.ts +2 -1
- package/src/commands/blueprint/declarative.ts +331 -31
- package/src/commands/blueprint/get.ts +6 -2
- package/src/commands/blueprint/grants.ts +64 -10
- package/src/commands/blueprint/metric.ts +108 -0
- package/src/commands/blueprint/object-sets.ts +71 -0
- package/src/commands/blueprint/query.ts +155 -31
- package/src/commands/dataset/index-commands.ts +156 -7
- package/src/commands/knowledge/index-commands.ts +122 -20
- package/src/commands/local/check.ts +657 -44
- package/src/commands/local/data.ts +33 -12
- package/src/commands/local/dev.ts +875 -88
- package/src/commands/local/docs-mcp.ts +10 -18
- package/src/commands/local/index-commands.ts +300 -63
- package/src/commands/local/init.ts +18 -5
- package/src/commands/local/key.ts +0 -3
- package/src/commands/local/providers.ts +0 -7
- package/src/commands/local/remove.ts +116 -0
- package/src/commands/local/schema.ts +3 -4
- package/src/commands/local/sdk-refresh.ts +59 -0
- package/src/commands/local/snapshot.ts +100 -0
- package/src/commands/local/sync-request.ts +320 -13
- package/src/commands/local/sync.ts +102 -5
- package/src/commands/mcp/serve.ts +34 -0
- package/src/commands/registry.ts +52 -8
- package/src/commands/types.ts +29 -0
- package/src/commands/workflow/archive.ts +46 -0
- package/src/commands/workflow/get.ts +2 -1
- package/src/commands/workflow/index-commands.ts +5 -0
- package/src/commands/workflow/push.ts +49 -2
- package/src/commands/workflow/run.ts +65 -7
- package/src/commands/workflow/runs.ts +9 -6
- package/src/commands/workflow/webhook-test.ts +166 -0
- package/src/config.ts +43 -6
- package/src/dev-broker.ts +52 -0
- package/src/exit.ts +103 -4
- package/src/flag-help.ts +77 -17
- package/src/forge/touches.ts +15 -12
- package/src/function-outside-imports.ts +89 -0
- package/src/harness.ts +42 -24
- package/src/heal.ts +112 -1
- package/src/local/fix-words.ts +12 -0
- package/src/local/function-bundle-recovery.ts +775 -0
- package/src/local/local-actions.ts +103 -10
- package/src/local/local-agent-action-grants.ts +210 -0
- package/src/local/local-agent-checks.ts +232 -0
- package/src/local/local-agent-grants.ts +29 -7
- package/src/local/local-agent-lean-plugins.ts +68 -0
- package/src/local/local-agent-missing-tools.ts +68 -0
- package/src/local/local-agent-name.ts +27 -0
- package/src/local/local-app-code.ts +191 -0
- package/src/local/local-app-dev-files.ts +186 -0
- package/src/local/local-app-dev-session.ts +88 -0
- package/src/local/local-app-lock-install.ts +114 -0
- package/src/local/local-app-pulled.ts +167 -0
- package/src/local/local-app-restore.ts +111 -0
- package/src/local/local-app-runtime.ts +68 -0
- package/src/local/local-app-sdk-paths.ts +149 -0
- package/src/local/local-app-sdk.ts +509 -0
- package/src/local/local-applied.ts +211 -21
- package/src/local/local-apply-history.ts +84 -0
- package/src/local/local-apply-summary.ts +86 -0
- package/src/local/local-apply-watchdog.ts +95 -0
- package/src/local/local-apps.ts +180 -7
- package/src/local/local-blueprint-errors.ts +198 -0
- package/src/local/local-blueprint-outline.ts +31 -12
- package/src/local/local-blueprint-schemas.ts +582 -0
- package/src/local/local-build-inputs.ts +48 -0
- package/src/local/local-build-summary.ts +495 -28
- package/src/local/local-case-evidence.ts +120 -0
- package/src/local/local-case-not-run.ts +153 -0
- package/src/local/local-chat-apps.ts +93 -16
- package/src/local/local-check-inherited.ts +83 -0
- package/src/local/local-cities.ts +89 -0
- package/src/local/local-component-health.ts +119 -0
- package/src/local/local-control.ts +34 -7
- package/src/local/local-db-snapshot.ts +348 -0
- package/src/local/local-dev-references.ts +346 -35
- package/src/local/local-dev-sync.ts +136 -7
- package/src/local/local-docker.ts +35 -1
- package/src/local/local-docs-search.ts +1 -1
- package/src/local/local-docs.ts +281 -2
- package/src/local/local-empty-workflows.ts +92 -0
- package/src/local/local-env.ts +16 -1
- package/src/local/local-file-checks.ts +104 -0
- package/src/local/local-function-ids.ts +141 -0
- package/src/local/local-function-recovery.ts +141 -0
- package/src/local/local-function-state.ts +87 -0
- package/src/local/local-keys.ts +7 -5
- package/src/local/local-knowledge-ingestion.ts +225 -0
- package/src/local/local-knowledge-uploads.ts +217 -0
- package/src/local/local-media-placeholders.ts +182 -0
- package/src/local/local-media-sets.ts +90 -10
- package/src/local/local-model-parameters.ts +89 -0
- package/src/local/local-object-sets.ts +18 -6
- package/src/local/local-operating.ts +35 -1
- package/src/local/local-org-settings.ts +205 -7
- package/src/local/local-orphans.ts +321 -0
- package/src/local/local-personas.ts +296 -0
- package/src/local/local-portability.ts +141 -16
- package/src/local/local-ports.ts +99 -7
- package/src/local/local-project-notices.ts +234 -0
- package/src/local/local-project-secrets.ts +133 -0
- package/src/local/local-project.ts +12 -0
- package/src/local/local-provider-refusal.ts +66 -0
- package/src/local/local-request-evidence.ts +112 -0
- package/src/local/local-runtime-health.ts +123 -0
- package/src/local/local-runtime-history.ts +50 -0
- package/src/local/local-runtime-target.ts +42 -0
- package/src/local/local-sample-data.ts +141 -0
- package/src/local/local-sample-remake.ts +138 -0
- package/src/local/local-scaffold.ts +336 -53
- package/src/local/local-schema-check.ts +148 -0
- package/src/local/local-schemas.ts +742 -25
- package/src/local/local-secret-carry.ts +107 -0
- package/src/local/local-secrets.ts +38 -8
- package/src/local/local-seed.ts +102 -26
- package/src/local/local-stand-ins.ts +1 -1
- package/src/local/local-state.ts +43 -2
- package/src/local/local-studio-server.ts +170 -7
- package/src/local/local-supervisor.ts +44 -6
- package/src/local/local-sync-names.ts +2 -0
- package/src/local/local-sync-plan.ts +11 -0
- package/src/local/local-sync-push.ts +10 -7
- package/src/local/local-sync-refs.ts +49 -3
- package/src/local/local-sync-remote.ts +343 -32
- package/src/local/local-sync-snapshot.ts +15 -10
- package/src/local/local-synthetic-data.ts +2116 -99
- package/src/local/local-test-baseline.ts +113 -0
- package/src/local/local-test-cases.ts +76 -1
- package/src/local/local-test-runner.ts +582 -91
- package/src/local/local-test-runs.ts +13 -5
- package/src/local/local-vendored-sdk.ts +183 -0
- package/src/local/local-workflow-state.ts +16 -3
- package/src/local/local-workflow-tests.ts +482 -0
- package/src/local/local-workspace-grants.ts +81 -0
- package/src/main.ts +50 -9
- package/src/mcp/a11y-scan.ts +55 -0
- package/src/mcp/browser/ax-snapshot.ts +181 -0
- package/src/mcp/browser/credentials.ts +78 -0
- package/src/mcp/browser/frames.ts +336 -0
- package/src/mcp/browser/headless-session.ts +413 -0
- package/src/mcp/browser/headless-tab.ts +575 -0
- package/src/mcp/browser/keys.ts +70 -0
- package/src/mcp/browser/page-scripts.ts +129 -0
- package/src/mcp/browser/wait.ts +73 -0
- package/src/mcp/forge-link.ts +126 -0
- package/src/mcp/headless.ts +199 -0
- package/src/mcp/mcp-apps.ts +435 -0
- package/src/mcp/mcp-chat.ts +226 -0
- package/src/mcp/mcp-cli.ts +53 -0
- package/src/mcp/mcp-protocol.ts +122 -0
- package/src/mcp/mcp-runtime.ts +113 -0
- package/src/mcp/mcp-server.ts +108 -0
- package/src/mcp/mcp-traces.ts +409 -0
- package/src/mcp/page-observation.ts +193 -0
- package/src/mcp/tools/agent-tools.ts +700 -0
- package/src/mcp/tools/app-tools.ts +241 -0
- package/src/mcp/tools/browser-tools.ts +310 -0
- package/src/mcp/tools/docs-tools.ts +32 -0
- package/src/mcp/tools/project-tools.ts +205 -0
- package/src/mcp/tools/test-tools.ts +339 -0
- package/src/mcp/tools/workflow-tools.ts +611 -0
- package/src/output.ts +1 -1
- package/src/pack.ts +8 -3
- package/src/packaging.ts +1 -1
- package/src/project-bootstrap.ts +107 -4
- package/src/project-context.ts +18 -1
- package/src/project.ts +27 -2
- package/src/provenance.ts +25 -0
- package/src/render-evidence.ts +65 -7
- package/src/template.ts +14 -8
- package/src/templates/next-app-files.ts +35 -6
- package/src/templates/next-skills.ts +61 -27
- package/src/vendor/kit-assets.json +6 -6
- package/src/vendor/sdk-sources.json +24 -21
|
@@ -5,6 +5,8 @@ import {
|
|
|
5
5
|
type AutomationRunSummary,
|
|
6
6
|
type RegistryStatus,
|
|
7
7
|
} from '../../api/automation-api'
|
|
8
|
+
import { providerRefusal, refusalLine, type ProviderRefusal } from '../../local/local-provider-refusal'
|
|
9
|
+
import { localRuntimeAt } from '../../local/local-runtime-target'
|
|
8
10
|
import { readSecretValue } from '../../secrets'
|
|
9
11
|
import { flagBool, flagString, type Command, type CommandContext } from '../types'
|
|
10
12
|
|
|
@@ -301,12 +303,9 @@ export const automationRun: Command = {
|
|
|
301
303
|
}
|
|
302
304
|
}
|
|
303
305
|
const seen = await waitForRun(client, slug, priorId, 'dev')
|
|
304
|
-
return
|
|
305
|
-
|
|
306
|
-
text:
|
|
307
|
-
? `${slug}: ${describeRun(seen.run, seen.steps)}`
|
|
308
|
-
: `${slug}: the dev run did not finish within ${WAIT_TIMEOUT_MS / 1000}s`,
|
|
309
|
-
}
|
|
306
|
+
return seen.run
|
|
307
|
+
? told(ctx, slug, seen.run, seen.steps)
|
|
308
|
+
: { data: queued, text: `${slug}: the dev run did not finish within ${WAIT_TIMEOUT_MS / 1000}s` }
|
|
310
309
|
}
|
|
311
310
|
|
|
312
311
|
// Wait for the runner BEFORE invoking, not after. An event sent early is
|
|
@@ -361,7 +360,7 @@ export const automationRun: Command = {
|
|
|
361
360
|
// Best-effort: a run that finished is the answer, and failing to read
|
|
362
361
|
// its trail must not turn a successful run into a failed command.
|
|
363
362
|
const steps = await client.runSteps(latest.id).catch(() => [])
|
|
364
|
-
return
|
|
363
|
+
return told(ctx, slug, latest, steps)
|
|
365
364
|
}
|
|
366
365
|
}
|
|
367
366
|
}
|
|
@@ -383,6 +382,30 @@ export const automationRun: Command = {
|
|
|
383
382
|
},
|
|
384
383
|
}
|
|
385
384
|
|
|
385
|
+
/**
|
|
386
|
+
* A failed run whose Agent call the model provider refused (`agent nova → 400
|
|
387
|
+
* Agent "nova" failed: 402 · invalid_request · …can only afford…`), said as
|
|
388
|
+
* the cause and the fix, on the local runtime only: the fix names the local
|
|
389
|
+
* runtime's providers and `frontera local model-default`, which mean nothing
|
|
390
|
+
* on a hosted deployment, where the run's own words stand.
|
|
391
|
+
*/
|
|
392
|
+
export function runRefusal(ctx: Pick<CommandContext, 'cwd' | 'apiUrl'>, slug: string, run: Pick<AutomationRunSummary, 'status' | 'errorMessage'>): ProviderRefusal | null {
|
|
393
|
+
if (run.status !== 'failed' || !run.errorMessage) return null
|
|
394
|
+
const local = localRuntimeAt(ctx.cwd, ctx.apiUrl)
|
|
395
|
+
if (!local) return null
|
|
396
|
+
return providerRefusal(run.errorMessage, { providers: local.creds.modelProviders, again: `run the Function again (\`frontera function run ${slug}\`)` })
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/** The run's data and words, with the provider's refusal said as its cause and fix when there is one. */
|
|
400
|
+
function told(ctx: CommandContext, slug: string, run: AutomationRunSummary, steps: AutomationRunStep[]): { data: unknown; text: string } {
|
|
401
|
+
const refusal = runRefusal(ctx, slug, run)
|
|
402
|
+
const { providerSaid: _said, ...couldNotRun } = refusal ?? { providerSaid: '' }
|
|
403
|
+
return {
|
|
404
|
+
data: { ...run, steps, ...(refusal ? { couldNotRun } : {}) },
|
|
405
|
+
text: `${slug}: ${describeRun(run, steps)}${refusal ? `\n ${refusalLine(refusal)}` : ''}`,
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
386
409
|
/** Recent runs, newest first — the pull-visibility half of "did it work". */
|
|
387
410
|
export const automationRuns: Command = {
|
|
388
411
|
meta: {
|
|
@@ -432,9 +455,11 @@ export const automationRuns: Command = {
|
|
|
432
455
|
})
|
|
433
456
|
.join('\n')
|
|
434
457
|
|
|
458
|
+
const refusal = runRefusal(ctx, slug, detail)
|
|
459
|
+
const { providerSaid: _said, ...couldNotRun } = refusal ?? { providerSaid: '' }
|
|
435
460
|
return {
|
|
436
|
-
data: { run: detail, steps },
|
|
437
|
-
text: `${describeRun(detail)}\n\nSteps\n${trail}`,
|
|
461
|
+
data: { run: detail, steps, ...(refusal ? { couldNotRun } : {}) },
|
|
462
|
+
text: `${describeRun(detail)}${refusal ? `\n ${refusalLine(refusal)}` : ''}\n\nSteps\n${trail}`,
|
|
438
463
|
}
|
|
439
464
|
}
|
|
440
465
|
|
|
@@ -145,7 +145,8 @@ export const blueprintBind: Command = {
|
|
|
145
145
|
const missing: string[] = []
|
|
146
146
|
for (const property of properties) {
|
|
147
147
|
const name = property.apiName
|
|
148
|
-
|
|
148
|
+
// A calculated field (a location from latitude and longitude) reads no column.
|
|
149
|
+
if (!name || (property as { calculation?: unknown }).calculation) continue
|
|
149
150
|
const entry = mapping.mapping?.[name]
|
|
150
151
|
if (entry === undefined || entry === null) {
|
|
151
152
|
missing.push(name)
|