@frontera-sdk/cli 1.52.38 → 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
|
@@ -3,7 +3,8 @@ import { join } from 'node:path'
|
|
|
3
3
|
|
|
4
4
|
import { UsageError } from '../../errors'
|
|
5
5
|
import { localProject } from '../../local/local-project'
|
|
6
|
-
import {
|
|
6
|
+
import { isoDay, SAMPLE_OPTIONS_FILE, writeSampleOptions } from '../../local/local-sample-remake'
|
|
7
|
+
import { addMissingBackings, generateSyntheticData, loadScenario, parseRegion, projectRegion, REGION_CODES, SCENARIO_CONTRACT, SCENARIO_TEMPLATE } from '../../local/local-synthetic-data'
|
|
7
8
|
import { flagBool, flagString, type Command } from '../types'
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -17,11 +18,11 @@ export const localData: Command = {
|
|
|
17
18
|
noun: 'local',
|
|
18
19
|
verb: 'data',
|
|
19
20
|
args: [],
|
|
20
|
-
flags: { synthetic: 'boolean', rows: 'string', seed: 'string' },
|
|
21
|
-
summary: "Generate sample data for the project's Blueprint (datasets/*.csv), with consistent links",
|
|
22
|
-
|
|
21
|
+
flags: { synthetic: 'boolean', rows: 'string', seed: 'string', region: 'string', today: 'string' },
|
|
22
|
+
summary: "Generate sample data for the project's Blueprint (datasets/*.csv; media-backed types get none), with consistent links",
|
|
23
|
+
details: SCENARIO_CONTRACT,
|
|
24
|
+
examples: ['frontera local data --synthetic', 'frontera local data --synthetic --rows 500 --seed 42', 'frontera local data --synthetic --region ID', 'frontera local data --synthetic --region 1.29,103.85,20', 'frontera local data --synthetic --today 2026-10-18'],
|
|
23
25
|
offline: true,
|
|
24
|
-
internal: true,
|
|
25
26
|
},
|
|
26
27
|
async run(ctx) {
|
|
27
28
|
if (!flagBool(ctx, 'synthetic')) throw new UsageError('say what to make', 'run `frontera local data --synthetic`')
|
|
@@ -29,7 +30,11 @@ export const localData: Command = {
|
|
|
29
30
|
const seed = Number(flagString(ctx, 'seed') ?? 7)
|
|
30
31
|
if (!Number.isInteger(rows) || rows < 1 || rows > 100_000) throw new UsageError('--rows takes a whole number from 1 to 100000', 'e.g. `frontera local data --synthetic --rows 500`')
|
|
31
32
|
if (!Number.isInteger(seed)) throw new UsageError('--seed takes a whole number', 'e.g. `frontera local data --synthetic --seed 42`')
|
|
33
|
+
const regionFlag = flagString(ctx, 'region')
|
|
34
|
+
const parsed = regionFlag === undefined ? null : parseRegion(regionFlag)
|
|
35
|
+
if (regionFlag !== undefined && !parsed) throw new UsageError(`\`${regionFlag}\` is not a region`, `pass a country code (${REGION_CODES.join(', ')}), a locale such as id-ID, or <lat>,<lon>[,<radius km>]`)
|
|
32
36
|
const project = localProject(ctx.cwd)
|
|
37
|
+
const region = parsed ?? projectRegion(project.root)
|
|
33
38
|
if (!existsSync(join(project.root, 'blueprint', 'object-types'))) {
|
|
34
39
|
throw new UsageError('this project has no Blueprint object types', 'pull them with `frontera local sync pull --kinds blueprint`, or add blueprint/object-types/<Name>.yaml')
|
|
35
40
|
}
|
|
@@ -42,18 +47,34 @@ export const localData: Command = {
|
|
|
42
47
|
wroteScenario = true
|
|
43
48
|
}
|
|
44
49
|
const backed = addMissingBackings(project.root)
|
|
50
|
+
// The day due dates are spread around; today (UTC) unless pinned, so a seed writes the same rows on any day.
|
|
51
|
+
const todayFlag = flagString(ctx, 'today')
|
|
52
|
+
const today = todayFlag === undefined ? undefined : new Date(`${todayFlag}T00:00:00Z`)
|
|
53
|
+
if (today && (!/^\d{4}-\d{2}-\d{2}$/.test(todayFlag!) || Number.isNaN(today.getTime()))) throw new UsageError('--today takes a date, YYYY-MM-DD', 'e.g. `frontera local data --synthetic --today 2026-10-18`')
|
|
45
54
|
const scenario = await loadScenario(project.root, seed)
|
|
46
|
-
|
|
47
|
-
const
|
|
55
|
+
// The day it ran on, unless pinned: kept with the seed and rows, so a remake after a pull writes the same rows.
|
|
56
|
+
const day = today ?? new Date(`${isoDay(new Date())}T00:00:00Z`)
|
|
57
|
+
const made = generateSyntheticData(project.root, { rows, seed, region, scenario: scenario ?? undefined, today: day })
|
|
58
|
+
writeSampleOptions(project.root, { seed, rows, today: isoDay(day), ...(regionFlag !== undefined ? { region: regionFlag } : {}), madeBy: 'local' })
|
|
59
|
+
// Datasets that aren't sample data (written, edited or loaded by someone) are left as they are.
|
|
60
|
+
const kept = made.filter((m) => m.kept)
|
|
61
|
+
const wrote = made.filter((m) => !m.kept)
|
|
62
|
+
const total = wrote.reduce((n, m) => n + m.rows, 0)
|
|
63
|
+
// A conditional field whose condition names nothing its record has: left empty, said with what to change.
|
|
64
|
+
const unresolved = wrote.flatMap((m) => (m.unresolved ?? []).map((u) => ({ objectType: m.objectType, ...u })))
|
|
48
65
|
return {
|
|
49
|
-
data: { datasets:
|
|
66
|
+
data: { datasets: wrote, ...(kept.length ? { kept: kept.map((m) => ({ objectType: m.objectType, dataset: m.dataset, rows: m.rows, csvPath: m.csvPath })) } : {}), backings: backed, ...(unresolved.length ? { unresolved } : {}), scenario: 'data/generate.ts', wroteScenario, rows: total, seed, region: { code: region.code, lat: region.lat, lon: region.lon, radiusKm: region.radiusKm } },
|
|
50
67
|
text: [
|
|
51
|
-
`Wrote ${total} sample rows for ${
|
|
52
|
-
...
|
|
68
|
+
`Wrote ${total} sample rows for ${wrote.length} object types (seed ${seed}; places within ${region.radiusKm} km of ${region.lat}, ${region.lon}${region.code === 'custom' ? '' : `, ${region.code}`}):`,
|
|
69
|
+
...wrote.map((m) => ` ${m.objectType.padEnd(24)} ${String(m.rows).padStart(6)} ${m.csvPath}`),
|
|
70
|
+
...(kept.length
|
|
71
|
+
? ['', `Kept ${kept.length} dataset${kept.length === 1 ? '' : 's'} that aren't sample data as they are (the sample rows link to their records):`, ...kept.map((m) => ` ${m.objectType.padEnd(24)} ${String(m.rows).padStart(6)} ${m.csvPath}`)]
|
|
72
|
+
: []),
|
|
53
73
|
...(backed.length ? ['', `Gave ${backed.length} object type${backed.length === 1 ? '' : 's'} a dataset to read: ${backed.join(', ')}`] : []),
|
|
74
|
+
...unresolved.map((u) => ` warning: ${u.objectType}.${u.property} is empty on every row: its description makes it depend on "${u.condition}", which names no property or value of ${u.objectType}. Name one in the description (a yes/no property, or a value such as a state), or set it with a field function in data/generate.ts`),
|
|
54
75
|
'',
|
|
55
|
-
wroteScenario ? 'Adjust them in data/generate.ts (rows per type,
|
|
56
|
-
|
|
76
|
+
wroteScenario ? 'Adjust them in data/generate.ts (rows per type, a `(row, index, ctx) => value` function per property; `frontera local data --help`).' : 'Adjusted by data/generate.ts (`frontera local data --help` describes it).',
|
|
77
|
+
`\`frontera local dev\` loads them into the runtime. Their options are kept in ${SAMPLE_OPTIONS_FILE}: a pull that brings Blueprint items makes them again the same way.`,
|
|
57
78
|
].join('\n'),
|
|
58
79
|
}
|
|
59
80
|
},
|