@elevasis/sdk 1.44.2 → 1.45.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.
- package/dist/cli.cjs +1001 -652
- package/dist/index.d.ts +1045 -509
- package/dist/index.js +748 -690
- package/dist/node/index.d.ts +105 -97
- package/dist/test-utils/index.d.ts +42 -28
- package/dist/test-utils/index.js +549 -732
- package/dist/worker/index.d.ts +12112 -0
- package/dist/worker/index.js +211 -186
- package/package.json +6 -9
- package/reference/_navigation.md +151 -21
- package/reference/_reference-manifest.json +186 -4
- package/reference/claude-config.md +8 -0
- package/reference/core/index.mdx +3 -3
- package/reference/examples/organization-model.ts +117 -111
- package/reference/index.mdx +4 -4
- package/reference/rules/active-change-index.md +40 -54
- package/reference/rules/agent-runtime.md +81 -0
- package/reference/rules/agent-start-here.md +71 -163
- package/reference/rules/deployment.md +33 -10
- package/reference/rules/error-handling.md +26 -0
- package/reference/rules/execution.md +13 -0
- package/reference/rules/frontend.md +10 -3
- package/reference/rules/observability.md +9 -1
- package/reference/rules/operations.md +26 -17
- package/reference/rules/organization-model.md +74 -88
- package/reference/rules/organization-os.md +71 -88
- package/reference/rules/package-taxonomy.md +11 -2
- package/reference/rules/platform.md +13 -7
- package/reference/rules/shared-types.md +15 -0
- package/reference/rules/task-tracking.md +30 -5
- package/reference/rules/ui.md +145 -3
- package/reference/rules/vibe-intents.md +271 -0
- package/reference/rules/vibe.md +17 -243
- package/reference/scaffold/core/organization-graph.mdx +111 -97
- package/reference/scaffold/core/organization-model.mdx +234 -214
- package/reference/scaffold/operations/propagation-pipeline.md +1 -1
- package/reference/scaffold/operations/scaffold-maintenance.md +19 -18
- package/reference/scaffold/operations/workflow-recipes.md +71 -19
- package/reference/scaffold/recipes/add-a-feature.md +156 -146
- package/reference/scaffold/recipes/add-a-resource.md +123 -117
- package/reference/scaffold/recipes/customize-crm-actions.md +25 -10
- package/reference/scaffold/recipes/customize-knowledge-browser.md +52 -117
- package/reference/scaffold/recipes/customize-organization-model.md +161 -149
- package/reference/scaffold/recipes/extend-a-base-entity.md +156 -140
- package/reference/scaffold/recipes/extend-crm.md +16 -11
- package/reference/scaffold/recipes/extend-lead-gen.md +25 -7
- package/reference/scaffold/recipes/gate-by-feature-or-admin.md +160 -118
- package/reference/scaffold/recipes/index.md +2 -2
- package/reference/scaffold/recipes/query-the-knowledge-graph.md +23 -23
- package/reference/scaffold/reference/contracts.md +12 -1
- package/reference/scaffold/reference/glossary.md +3 -3
- package/reference/scaffold/reference/system-interface-capabilities.md +5 -4
- package/reference/scaffold/ui/composition-extensibility.mdx +271 -232
- package/reference/scaffold/ui/feature-flags-and-gating.md +14 -6
- package/reference/scaffold/ui/feature-shell.mdx +279 -62
- package/reference/scaffold/ui/recipes.md +229 -197
- package/reference/sdk/cli-management.mdx +77 -29
- package/reference/sdk/concepts.mdx +2 -0
- package/reference/sdk/define-builders.mdx +76 -0
- package/reference/sdk/deployment/command-center.mdx +6 -2
- package/reference/sdk/deployment/execution-reference.mdx +64 -186
- package/reference/sdk/deployment/index.mdx +2 -0
- package/reference/sdk/exports.mdx +4 -4
- package/reference/sdk/framework/agent.mdx +49 -119
- package/reference/sdk/framework/index.mdx +46 -65
- package/reference/sdk/framework/project-structure.mdx +150 -205
- package/reference/sdk/framework/tutorial-system.mdx +2 -2
- package/reference/sdk/human-in-the-loop.mdx +152 -0
- package/reference/sdk/index.mdx +6 -7
- package/reference/sdk/platform-tools/index.mdx +12 -0
- package/reference/sdk/platform-tools/type-safety.mdx +4 -0
- package/reference/sdk/project-deployment-spec.mdx +131 -0
- package/reference/sdk/resources/index.mdx +23 -7
- package/reference/sdk/resources/patterns.mdx +54 -24
- package/reference/sdk/resources/types.mdx +7 -4
- package/reference/sdk/templates/data-enrichment.mdx +7 -3
- package/reference/sdk/templates/email-sender.mdx +139 -135
- package/reference/sdk/templates/lead-scorer.mdx +5 -1
- package/reference/sdk/templates/pdf-generator.mdx +155 -151
- package/reference/sdk/templates/recurring-job.mdx +195 -189
- package/reference/sdk/templates/text-classifier.mdx +4 -0
- package/reference/sdk/templates/web-scraper.mdx +139 -135
- package/reference/spine/spine-primer.md +135 -96
- package/reference/ui/index.mdx +14 -7
- package/dist/types/worker/adapters/anymailfinder.d.ts +0 -14
- package/dist/types/worker/adapters/apify.d.ts +0 -14
- package/dist/types/worker/adapters/approval.d.ts +0 -23
- package/dist/types/worker/adapters/attio.d.ts +0 -22
- package/dist/types/worker/adapters/clickup.d.ts +0 -22
- package/dist/types/worker/adapters/create-adapter.d.ts +0 -41
- package/dist/types/worker/adapters/crm.d.ts +0 -20
- package/dist/types/worker/adapters/dropbox.d.ts +0 -14
- package/dist/types/worker/adapters/email.d.ts +0 -25
- package/dist/types/worker/adapters/execution.d.ts +0 -22
- package/dist/types/worker/adapters/gmail.d.ts +0 -14
- package/dist/types/worker/adapters/google-sheets.d.ts +0 -14
- package/dist/types/worker/adapters/index.d.ts +0 -33
- package/dist/types/worker/adapters/instantly.d.ts +0 -14
- package/dist/types/worker/adapters/lead.d.ts +0 -28
- package/dist/types/worker/adapters/list.d.ts +0 -9
- package/dist/types/worker/adapters/llm.d.ts +0 -45
- package/dist/types/worker/adapters/millionverifier.d.ts +0 -14
- package/dist/types/worker/adapters/notification.d.ts +0 -28
- package/dist/types/worker/adapters/pdf.d.ts +0 -22
- package/dist/types/worker/adapters/projects.d.ts +0 -20
- package/dist/types/worker/adapters/resend.d.ts +0 -14
- package/dist/types/worker/adapters/scheduler.d.ts +0 -25
- package/dist/types/worker/adapters/signature-api.d.ts +0 -14
- package/dist/types/worker/adapters/storage.d.ts +0 -33
- package/dist/types/worker/adapters/stripe.d.ts +0 -14
- package/dist/types/worker/adapters/tomba.d.ts +0 -14
- package/dist/types/worker/index.d.ts +0 -60
- package/dist/types/worker/platform.d.ts +0 -90
- package/dist/types/worker/utils.d.ts +0 -9
- package/reference/claude-config/Overview.md +0 -230
- package/reference/claude-config/hooks/post-edit-validate.mjs +0 -98
- package/reference/claude-config/hooks/scaffold-registry-reminder.mjs +0 -187
- package/reference/claude-config/hooks/tool-failure-recovery.mjs +0 -73
- package/reference/claude-config/registries/graph-skills.json +0 -4
- package/reference/claude-config/registries/knowledge-flags.json +0 -154
- package/reference/claude-config/registries/skill-coverage.json +0 -20
- package/reference/claude-config/rules/active-change-index.md +0 -22
- package/reference/claude-config/rules/agent-start-here.md +0 -22
- package/reference/claude-config/rules/deployment.md +0 -22
- package/reference/claude-config/rules/error-handling.md +0 -22
- package/reference/claude-config/rules/execution.md +0 -22
- package/reference/claude-config/rules/frontend.md +0 -22
- package/reference/claude-config/rules/observability.md +0 -22
- package/reference/claude-config/rules/operations.md +0 -22
- package/reference/claude-config/rules/organization-model.md +0 -22
- package/reference/claude-config/rules/organization-os.md +0 -22
- package/reference/claude-config/rules/package-taxonomy.md +0 -22
- package/reference/claude-config/rules/platform.md +0 -22
- package/reference/claude-config/rules/shared-types.md +0 -22
- package/reference/claude-config/rules/task-tracking.md +0 -22
- package/reference/claude-config/rules/topbar-actions.md +0 -70
- package/reference/claude-config/rules/ui.md +0 -22
- package/reference/claude-config/rules/vibe.md +0 -22
- package/reference/claude-config/scripts/statusline-command.js +0 -18
- package/reference/claude-config/settings.json +0 -30
- package/reference/claude-config/skills/client/SKILL.md +0 -201
- package/reference/claude-config/skills/deploy/SKILL.md +0 -159
- package/reference/claude-config/skills/dsp/SKILL.md +0 -66
- package/reference/claude-config/skills/elevasis/SKILL.md +0 -251
- package/reference/claude-config/skills/explore/SKILL.md +0 -78
- package/reference/claude-config/skills/git-sync/SKILL.md +0 -166
- package/reference/claude-config/skills/om/SKILL.md +0 -475
- package/reference/claude-config/skills/om/operations/build.md +0 -237
- package/reference/claude-config/skills/om/operations/codify-level-a.md +0 -109
- package/reference/claude-config/skills/om/operations/codify-level-b.md +0 -159
- package/reference/claude-config/skills/om/operations/customers.md +0 -114
- package/reference/claude-config/skills/om/operations/features.md +0 -88
- package/reference/claude-config/skills/om/operations/goals.md +0 -123
- package/reference/claude-config/skills/om/operations/identity.md +0 -97
- package/reference/claude-config/skills/om/operations/labels.md +0 -110
- package/reference/claude-config/skills/om/operations/offerings.md +0 -114
- package/reference/claude-config/skills/om/operations/roles.md +0 -104
- package/reference/claude-config/skills/om/operations/scaffold.md +0 -163
- package/reference/claude-config/skills/om/operations/techStack.md +0 -38
- package/reference/claude-config/skills/project/SKILL.md +0 -1114
- package/reference/claude-config/skills/run-ui/SKILL.md +0 -73
- package/reference/claude-config/skills/save/SKILL.md +0 -183
- package/reference/claude-config/skills/setup/SKILL.md +0 -290
- package/reference/claude-config/skills/status/SKILL.md +0 -59
- package/reference/claude-config/skills/submit-request/SKILL.md +0 -180
- package/reference/claude-config/skills/sync/SKILL.md +0 -47
- package/reference/claude-config/skills/tutorial/SKILL.md +0 -259
- package/reference/claude-config/skills/tutorial/progress-template.md +0 -74
- package/reference/claude-config/skills/tutorial/technical.md +0 -1303
- package/reference/claude-config/skills/tutorial/vibe-coder.md +0 -890
- package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +0 -27
- package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +0 -30
- package/reference/claude-config/sync-notes/2026-04-24-test-utils-and-template-tests.md +0 -73
- package/reference/claude-config/sync-notes/2026-04-24-ui-consolidation-and-sdk-cli-train.md +0 -86
- package/reference/claude-config/sync-notes/2026-04-25-auth-role-system-and-settings-roles.md +0 -55
- package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +0 -97
- package/reference/claude-config/sync-notes/2026-04-27-lead-gen-substrate-train.md +0 -112
- package/reference/claude-config/sync-notes/2026-04-29-crm-state-and-lead-gen-processing-status.md +0 -93
- package/reference/claude-config/sync-notes/2026-05-02-crm-ownership-next-action.md +0 -58
- package/reference/claude-config/sync-notes/2026-05-02-template-hardcode-workos-config.md +0 -56
- package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +0 -71
- package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +0 -83
- package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +0 -59
- package/reference/claude-config/sync-notes/2026-05-05-list-builder.md +0 -42
- package/reference/claude-config/sync-notes/2026-05-06-crm-spine.md +0 -60
- package/reference/claude-config/sync-notes/2026-05-06-sdk-changes-release-train.md +0 -37
- package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +0 -34
- package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +0 -38
- package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +0 -32
- package/reference/claude-config/sync-notes/2026-05-09-command-system.md +0 -33
- package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +0 -69
- package/reference/claude-config/sync-notes/2026-05-12-sdk-ready-release-train.md +0 -30
- package/reference/claude-config/sync-notes/2026-05-14-organization-model-ontology-refactor.md +0 -45
- package/reference/claude-config/sync-notes/2026-05-15-om-skill-rename-and-write-family.md +0 -52
- package/reference/claude-config/sync-notes/2026-05-17-sdk-boundary-consolidation.md +0 -33
- package/reference/claude-config/sync-notes/2026-05-20-om-define-helpers.md +0 -32
- package/reference/claude-config/sync-notes/2026-05-22-access-model-and-right-panel.md +0 -43
- package/reference/claude-config/sync-notes/2026-05-22-lead-gen-tenant-config.md +0 -40
- package/reference/claude-config/sync-notes/2026-05-22-org-model-multi-file-split.md +0 -61
- package/reference/claude-config/sync-notes/2026-05-23-branding-names-to-identity.md +0 -49
- package/reference/claude-config/sync-notes/2026-05-23-lead-gen-manage-access.md +0 -31
- package/reference/claude-config/sync-notes/2026-05-23-om-deployment-drift-detection.md +0 -42
- package/reference/claude-config/sync-notes/2026-05-23-om-full-model-deploy-contract.md +0 -33
- package/reference/claude-config/sync-notes/2026-05-23-ui-sdk-package-fixes.md +0 -37
- package/reference/claude-config/sync-notes/2026-05-24-platform-invite-router-core-baseline.md +0 -28
- package/reference/claude-config/sync-notes/2026-05-24-system-interface-readiness.md +0 -43
- package/reference/claude-config/sync-notes/2026-05-25-invitation-login-loader.md +0 -26
- package/reference/claude-config/sync-notes/2026-05-25-om-topbar-requests.md +0 -33
- package/reference/claude-config/sync-notes/2026-05-25-system-interface-profile-registry-and-substrate.md +0 -35
- package/reference/claude-config/sync-notes/2026-05-25-tenant-om-scaffold-cli.md +0 -49
- package/reference/claude-config/sync-notes/2026-05-25-vibe-operate-intent.md +0 -47
- package/reference/claude-config/sync-notes/2026-05-28-om-snapshot-sdk-workflow-config.md +0 -33
- package/reference/claude-config/sync-notes/2026-05-30-client-source-and-om-profiles.md +0 -39
- package/reference/claude-config/sync-notes/2026-06-02-knowledge-nested-group-routing.md +0 -27
- package/reference/claude-config/sync-notes/2026-06-02-nest-projects-under-platform.md +0 -45
- package/reference/claude-config/sync-notes/2026-06-03-skill-autogen-and-client-skill.md +0 -34
- package/reference/claude-config/sync-notes/2026-06-04-scaffold-registry-lane-severity.md +0 -34
- package/reference/claude-config/sync-notes/2026-06-05-appearance-app-mode-decouple.md +0 -29
- package/reference/claude-config/sync-notes/2026-06-05-ontology-endpoint-rename-and-knowledge-browser-ui.md +0 -86
- package/reference/claude-config/sync-notes/2026-06-06-om-build-systems-scaffold.md +0 -47
- package/reference/claude-config/sync-notes/2026-06-06-om-item-copy-references.md +0 -50
- package/reference/claude-config/sync-notes/2026-06-08-knowledge-base-page-not-found-fix.md +0 -76
- package/reference/claude-config/sync-notes/2026-06-09-agent-sessions-public-agent-chat-route.md +0 -75
- package/reference/claude-config/sync-notes/2026-06-09-sdk-cli-load-org-model-resolution.md +0 -42
- package/reference/claude-config/sync-notes/2026-06-12-agent-grants-visualizer-operations.md +0 -30
- package/reference/claude-config/sync-notes/2026-06-14-session-ux-and-project-cli-json.md +0 -33
- package/reference/claude-config/sync-notes/2026-06-14-shared-session-conversation-view.md +0 -26
- package/reference/claude-config/sync-notes/2026-06-15-session-chat-zero-wiring.md +0 -46
- package/reference/claude-config/sync-notes/2026-06-17-agent-session-ux-features.md +0 -34
- package/reference/claude-config/sync-notes/2026-06-25-shared-page-scroll-contract-guard.md +0 -52
- package/reference/claude-config/sync-notes/2026-06-26-leadgen-overview-om-telemetry.md +0 -47
- package/reference/claude-config/sync-notes/2026-07-21-agent-scaffold-hardening.md +0 -75
- package/reference/claude-config/sync-notes/2026-07-23-agent-session-memory.md +0 -49
- package/reference/claude-config/sync-notes/2026-07-23-workos-org-marker.md +0 -50
- package/reference/claude-config/sync-notes/2026-07-24-claude-5-models-and-session-surface-fixes.md +0 -116
- package/reference/claude-config/sync-notes/2026-07-27-agent-strict-output-and-turn-drift.md +0 -73
- package/reference/claude-config/sync-notes/2026-07-28-agent-reply-is-its-own-field.md +0 -84
- package/reference/claude-config/sync-notes/2026-07-30-login-screen-and-member-provisioning-state.md +0 -114
- package/reference/claude-config/sync-notes/2026-08-02-auth-guard-defaults-and-truncation-fix.md +0 -122
- package/reference/claude-config/sync-notes/2026-08-03-cli-gateway-errors-and-request-timeout.md +0 -120
- package/reference/claude-config/sync-notes/README.md +0 -43
- package/reference/sdk/framework/interaction-guidance.mdx +0 -182
- package/reference/sdk/framework/memory.mdx +0 -326
- package/reference/sdk/framework/resource-documentation.mdx +0 -90
- package/reference/sdk/roadmap.mdx +0 -164
package/dist/cli.cjs
CHANGED
|
@@ -8838,7 +8838,7 @@ var require_util = __commonJS({
|
|
|
8838
8838
|
exports2.randomString = randomString2;
|
|
8839
8839
|
exports2.esc = esc2;
|
|
8840
8840
|
exports2.isObject = isObject2;
|
|
8841
|
-
exports2.isPlainObject =
|
|
8841
|
+
exports2.isPlainObject = isPlainObject4;
|
|
8842
8842
|
exports2.shallowClone = shallowClone2;
|
|
8843
8843
|
exports2.numKeys = numKeys2;
|
|
8844
8844
|
exports2.escapeRegex = escapeRegex2;
|
|
@@ -9019,7 +9019,7 @@ var require_util = __commonJS({
|
|
|
9019
9019
|
return false;
|
|
9020
9020
|
}
|
|
9021
9021
|
});
|
|
9022
|
-
function
|
|
9022
|
+
function isPlainObject4(o) {
|
|
9023
9023
|
if (isObject2(o) === false)
|
|
9024
9024
|
return false;
|
|
9025
9025
|
const ctor = o.constructor;
|
|
@@ -9034,7 +9034,7 @@ var require_util = __commonJS({
|
|
|
9034
9034
|
return true;
|
|
9035
9035
|
}
|
|
9036
9036
|
function shallowClone2(o) {
|
|
9037
|
-
if (
|
|
9037
|
+
if (isPlainObject4(o))
|
|
9038
9038
|
return { ...o };
|
|
9039
9039
|
if (Array.isArray(o))
|
|
9040
9040
|
return [...o];
|
|
@@ -9218,7 +9218,7 @@ var require_util = __commonJS({
|
|
|
9218
9218
|
return clone2(schema, def);
|
|
9219
9219
|
}
|
|
9220
9220
|
function extend2(schema, shape) {
|
|
9221
|
-
if (!
|
|
9221
|
+
if (!isPlainObject4(shape)) {
|
|
9222
9222
|
throw new Error("Invalid input to extend: expected a plain object");
|
|
9223
9223
|
}
|
|
9224
9224
|
const checks = schema._zod.def.checks;
|
|
@@ -9237,7 +9237,7 @@ var require_util = __commonJS({
|
|
|
9237
9237
|
return clone2(schema, def);
|
|
9238
9238
|
}
|
|
9239
9239
|
function safeExtend2(schema, shape) {
|
|
9240
|
-
if (!
|
|
9240
|
+
if (!isPlainObject4(shape)) {
|
|
9241
9241
|
throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
9242
9242
|
}
|
|
9243
9243
|
const def = {
|
|
@@ -38001,6 +38001,9 @@ function knowledgeTargetExists(index, kind, id) {
|
|
|
38001
38001
|
if (kind === "ontology") return index.ontologyIds.has(id);
|
|
38002
38002
|
return false;
|
|
38003
38003
|
}
|
|
38004
|
+
function resourceOntologyBindingMissing(index, expectedKind, ontologyId) {
|
|
38005
|
+
return index.ontologyIndexByKind[expectedKind][ontologyId] === void 0;
|
|
38006
|
+
}
|
|
38004
38007
|
|
|
38005
38008
|
// ../core/src/organization-model/icons.ts
|
|
38006
38009
|
var ORGANIZATION_MODEL_ICON_TOKENS = [
|
|
@@ -38582,17 +38585,23 @@ var SystemInterfaceResourceScopeSchema = external_exports.array(ModelIdSchema).d
|
|
|
38582
38585
|
var SystemApiInterfaceReadinessContractSchema = external_exports.object({
|
|
38583
38586
|
/** Ontology IDs of object types the interface depends on. */
|
|
38584
38587
|
requiredObjects: external_exports.array(external_exports.string().trim().min(1)).default([]),
|
|
38585
|
-
/**
|
|
38586
|
-
|
|
38587
|
-
|
|
38588
|
-
|
|
38588
|
+
/**
|
|
38589
|
+
* Ontology IDs of catalog types the interface requires. Must declare at least one
|
|
38590
|
+
* entry — a `readinessContract` with no `requiredCatalogs` asserts nothing at all,
|
|
38591
|
+
* so it has no `.default([])`; omitting the field is rejected the same as an
|
|
38592
|
+
* explicit empty array.
|
|
38593
|
+
*/
|
|
38594
|
+
requiredCatalogs: external_exports.array(external_exports.string().trim().min(1)).min(1)
|
|
38589
38595
|
}).strict();
|
|
38590
38596
|
var SystemApiInterfaceSchema = external_exports.object({
|
|
38591
38597
|
lifecycle: SystemInterfaceLifecycleSchema.default("active"),
|
|
38592
38598
|
/**
|
|
38593
38599
|
* Open-string profile id. Built-in platform presets are looked up through
|
|
38594
38600
|
* the profile registry; custom ids are validated structurally via
|
|
38595
|
-
* `readinessContract`. Optional
|
|
38601
|
+
* `readinessContract`. Optional at the schema layer, but readiness
|
|
38602
|
+
* computation rejects an interface that omits it with a
|
|
38603
|
+
* `missing-readiness-profile` diagnostic — there is no positional
|
|
38604
|
+
* fallback to `${systemPath}.${interfaceKey}`.
|
|
38596
38605
|
*/
|
|
38597
38606
|
readinessProfile: SystemInterfaceReadinessProfileSchema.optional(),
|
|
38598
38607
|
/**
|
|
@@ -38613,9 +38622,6 @@ var _profileRegistry = new Map(
|
|
|
38613
38622
|
{ profileId, kind: "built-in" }
|
|
38614
38623
|
])
|
|
38615
38624
|
);
|
|
38616
|
-
function profileForInterface(systemPath, interfaceKey, readinessProfile) {
|
|
38617
|
-
return readinessProfile ?? `${systemPath}.${interfaceKey}`;
|
|
38618
|
-
}
|
|
38619
38625
|
function isBuiltInReadinessProfile(profileId) {
|
|
38620
38626
|
return _profileRegistry.get(profileId)?.kind === "built-in";
|
|
38621
38627
|
}
|
|
@@ -39940,6 +39946,64 @@ var DEFAULT_ORGANIZATION_MODEL = {
|
|
|
39940
39946
|
knowledge: DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE
|
|
39941
39947
|
};
|
|
39942
39948
|
|
|
39949
|
+
// ../core/src/organization-model/resolve.ts
|
|
39950
|
+
function isPlainObject2(value) {
|
|
39951
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
39952
|
+
}
|
|
39953
|
+
function collectNestedSystemPaths(systems, prefix = "") {
|
|
39954
|
+
const paths = /* @__PURE__ */ new Set();
|
|
39955
|
+
for (const [key, value] of Object.entries(systems)) {
|
|
39956
|
+
if (!isPlainObject2(value)) continue;
|
|
39957
|
+
const path3 = prefix ? `${prefix}.${key}` : key;
|
|
39958
|
+
for (const childKey of ["systems", "subsystems"]) {
|
|
39959
|
+
const childSystems = value[childKey];
|
|
39960
|
+
if (!isPlainObject2(childSystems)) continue;
|
|
39961
|
+
for (const childPath of collectNestedSystemPaths(childSystems, path3)) {
|
|
39962
|
+
paths.add(childPath);
|
|
39963
|
+
}
|
|
39964
|
+
}
|
|
39965
|
+
if (prefix !== "") {
|
|
39966
|
+
paths.add(path3);
|
|
39967
|
+
}
|
|
39968
|
+
}
|
|
39969
|
+
return paths;
|
|
39970
|
+
}
|
|
39971
|
+
function pruneFlatSystemDescendantCollisions(base, override) {
|
|
39972
|
+
const result = { ...base };
|
|
39973
|
+
for (const nestedPath of collectNestedSystemPaths(override)) {
|
|
39974
|
+
delete result[nestedPath];
|
|
39975
|
+
}
|
|
39976
|
+
return result;
|
|
39977
|
+
}
|
|
39978
|
+
function deepMerge(base, override) {
|
|
39979
|
+
if (override === void 0) {
|
|
39980
|
+
return base;
|
|
39981
|
+
}
|
|
39982
|
+
if (Array.isArray(base)) {
|
|
39983
|
+
return override ?? base;
|
|
39984
|
+
}
|
|
39985
|
+
if (!isPlainObject2(base) || !isPlainObject2(override)) {
|
|
39986
|
+
return override ?? base;
|
|
39987
|
+
}
|
|
39988
|
+
const result = { ...base };
|
|
39989
|
+
for (const [key, value] of Object.entries(override)) {
|
|
39990
|
+
if (value === void 0) continue;
|
|
39991
|
+
const existing = result[key];
|
|
39992
|
+
if (key === "systems" && isPlainObject2(existing) && isPlainObject2(value)) {
|
|
39993
|
+
result[key] = deepMerge(pruneFlatSystemDescendantCollisions(existing, value), value);
|
|
39994
|
+
continue;
|
|
39995
|
+
}
|
|
39996
|
+
result[key] = isPlainObject2(existing) && isPlainObject2(value) ? deepMerge(existing, value) : value;
|
|
39997
|
+
}
|
|
39998
|
+
return result;
|
|
39999
|
+
}
|
|
40000
|
+
function resolveOrganizationModel(override, organizationIdOrOptions, options) {
|
|
40001
|
+
const resolvedOptions = typeof organizationIdOrOptions === "object" ? organizationIdOrOptions : options;
|
|
40002
|
+
const mergeDefaults = resolvedOptions?.mergeDefaults ?? true;
|
|
40003
|
+
const merged = mergeDefaults ? deepMerge(DEFAULT_ORGANIZATION_MODEL, override) : override ?? {};
|
|
40004
|
+
return OrganizationModelSchema.parse(merged);
|
|
40005
|
+
}
|
|
40006
|
+
|
|
39943
40007
|
// ../core/src/organization-model/migration-helpers.ts
|
|
39944
40008
|
function catalogRecords(model) {
|
|
39945
40009
|
return Object.values(compileOrganizationOntology(model).ontology.catalogTypes);
|
|
@@ -39999,6 +40063,7 @@ function getAllPipelines(model) {
|
|
|
39999
40063
|
return { systemPath: catalog.ownerSystemId ?? systemScope(catalog.id), pipeline };
|
|
40000
40064
|
}).sort((a, b) => a.systemPath.localeCompare(b.systemPath) || a.pipeline.id.localeCompare(b.pipeline.id));
|
|
40001
40065
|
}
|
|
40066
|
+
var CRM_PIPELINE_CATALOG_ID = formatOntologyId({ scope: "sales.crm", kind: "catalog", localId: "crm.pipeline" });
|
|
40002
40067
|
function getAllBuildTemplates(model) {
|
|
40003
40068
|
const catalogs = catalogRecords(model);
|
|
40004
40069
|
const stepCatalogs = new Map(
|
|
@@ -41029,6 +41094,321 @@ function buildOrganizationGraph(input) {
|
|
|
41029
41094
|
return OrganizationGraphSchema.parse(graph);
|
|
41030
41095
|
}
|
|
41031
41096
|
|
|
41097
|
+
// ../core/src/organization-model/readiness/profile-registry.ts
|
|
41098
|
+
var _builtInProfileValidators = /* @__PURE__ */ new Map();
|
|
41099
|
+
function getBuiltInReadinessProfile(profileId) {
|
|
41100
|
+
return _builtInProfileValidators.get(profileId);
|
|
41101
|
+
}
|
|
41102
|
+
var _interfaceMarkerResolvers = /* @__PURE__ */ new Map();
|
|
41103
|
+
function interfaceMarkerKey(systemPath, interfaceKey) {
|
|
41104
|
+
return `${systemPath}::${interfaceKey}`;
|
|
41105
|
+
}
|
|
41106
|
+
function resolveReadinessInterfaceMarker(model, systemPath, interfaceKey) {
|
|
41107
|
+
return _interfaceMarkerResolvers.get(interfaceMarkerKey(systemPath, interfaceKey))?.(model);
|
|
41108
|
+
}
|
|
41109
|
+
|
|
41110
|
+
// ../core/src/organization-model/readiness/engine.ts
|
|
41111
|
+
function addReadinessIssue(issues, family, code, message, details = {}) {
|
|
41112
|
+
issues.push({
|
|
41113
|
+
family,
|
|
41114
|
+
code,
|
|
41115
|
+
message,
|
|
41116
|
+
...details
|
|
41117
|
+
});
|
|
41118
|
+
}
|
|
41119
|
+
function formatInterfaceIdentity(systemPath, interfaceKey) {
|
|
41120
|
+
return `${systemPath}/${interfaceKey}`;
|
|
41121
|
+
}
|
|
41122
|
+
function readinessMarkerPath(context) {
|
|
41123
|
+
return context.interfaceKey === "api" ? `systems.${context.systemPath}.apiInterface` : void 0;
|
|
41124
|
+
}
|
|
41125
|
+
function readinessMarkerFieldPath(context, suffix) {
|
|
41126
|
+
const base = readinessMarkerPath(context);
|
|
41127
|
+
return base === void 0 ? void 0 : `${base}${suffix}`;
|
|
41128
|
+
}
|
|
41129
|
+
function formatSupportedReadinessProfiles() {
|
|
41130
|
+
return SYSTEM_INTERFACE_PROFILES.map((p) => `"${p.readinessProfile}"`).join(", ");
|
|
41131
|
+
}
|
|
41132
|
+
function isPlainRecord(value) {
|
|
41133
|
+
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
41134
|
+
}
|
|
41135
|
+
function getCatalogEntries(catalog) {
|
|
41136
|
+
return isPlainRecord(catalog.entries) ? catalog.entries : {};
|
|
41137
|
+
}
|
|
41138
|
+
function getActiveScopedResources(model, resourceIds, issues, context) {
|
|
41139
|
+
const resources = [];
|
|
41140
|
+
for (const [index, resourceId] of resourceIds.entries()) {
|
|
41141
|
+
const resource = model.resources?.[resourceId];
|
|
41142
|
+
const path3 = readinessMarkerFieldPath(context, `.resourceIds.${index}`);
|
|
41143
|
+
if (resource === void 0) {
|
|
41144
|
+
addReadinessIssue(
|
|
41145
|
+
issues,
|
|
41146
|
+
"SYSTEM_INTERFACE_NOT_READY",
|
|
41147
|
+
"missing-resource",
|
|
41148
|
+
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" scopes missing resource "${resourceId}".`,
|
|
41149
|
+
{ path: path3, ref: resourceId }
|
|
41150
|
+
);
|
|
41151
|
+
continue;
|
|
41152
|
+
}
|
|
41153
|
+
if (resource.systemPath !== context.systemPath) {
|
|
41154
|
+
addReadinessIssue(
|
|
41155
|
+
issues,
|
|
41156
|
+
"SYSTEM_INTERFACE_INVALID",
|
|
41157
|
+
"resource-system-mismatch",
|
|
41158
|
+
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" scopes resource "${resourceId}" from system "${resource.systemPath}".`,
|
|
41159
|
+
{ path: path3, ref: resourceId }
|
|
41160
|
+
);
|
|
41161
|
+
continue;
|
|
41162
|
+
}
|
|
41163
|
+
if (resource.status !== "active") {
|
|
41164
|
+
addReadinessIssue(
|
|
41165
|
+
issues,
|
|
41166
|
+
"SYSTEM_INTERFACE_NOT_READY",
|
|
41167
|
+
"inactive-resource",
|
|
41168
|
+
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" scopes inactive resource "${resourceId}".`,
|
|
41169
|
+
{ path: path3, ref: resourceId }
|
|
41170
|
+
);
|
|
41171
|
+
continue;
|
|
41172
|
+
}
|
|
41173
|
+
resources.push(resource);
|
|
41174
|
+
}
|
|
41175
|
+
return resources;
|
|
41176
|
+
}
|
|
41177
|
+
function resourceBindingIds(resources, key) {
|
|
41178
|
+
return new Set(resources.flatMap((resource) => resource.ontology?.[key] ?? []));
|
|
41179
|
+
}
|
|
41180
|
+
function requireScopedBinding(issues, boundIds, bindingKey, ontologyId, context) {
|
|
41181
|
+
if (boundIds.has(ontologyId)) return;
|
|
41182
|
+
addReadinessIssue(
|
|
41183
|
+
issues,
|
|
41184
|
+
"SYSTEM_INTERFACE_NOT_READY",
|
|
41185
|
+
"missing-resource-binding",
|
|
41186
|
+
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" has no active scoped resource with ontology.${bindingKey} binding "${ontologyId}".`,
|
|
41187
|
+
{ path: readinessMarkerFieldPath(context, ".resourceIds"), ref: ontologyId }
|
|
41188
|
+
);
|
|
41189
|
+
}
|
|
41190
|
+
function ontologyOwnerMatches(ontologyId, expectedSystemPath, catalog) {
|
|
41191
|
+
if (catalog?.ownerSystemId !== void 0) return catalog.ownerSystemId === expectedSystemPath;
|
|
41192
|
+
return parseOntologyId(ontologyId).scope === expectedSystemPath;
|
|
41193
|
+
}
|
|
41194
|
+
function requireObjectReadiness(issues, index, objectId, context) {
|
|
41195
|
+
const object2 = index.ontology.objectTypes[objectId];
|
|
41196
|
+
if (object2 === void 0) {
|
|
41197
|
+
addReadinessIssue(
|
|
41198
|
+
issues,
|
|
41199
|
+
"SYSTEM_INTERFACE_NOT_READY",
|
|
41200
|
+
"missing-object",
|
|
41201
|
+
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" is missing required object type "${objectId}".`,
|
|
41202
|
+
{ ref: objectId }
|
|
41203
|
+
);
|
|
41204
|
+
return;
|
|
41205
|
+
}
|
|
41206
|
+
const ownerSystemId = object2.ownerSystemId ?? parseOntologyId(objectId).scope;
|
|
41207
|
+
if (ownerSystemId !== context.systemPath) {
|
|
41208
|
+
addReadinessIssue(
|
|
41209
|
+
issues,
|
|
41210
|
+
"SYSTEM_INTERFACE_INVALID",
|
|
41211
|
+
"foreign-object",
|
|
41212
|
+
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" requires object "${objectId}" owned by "${ownerSystemId}".`,
|
|
41213
|
+
{ ref: objectId }
|
|
41214
|
+
);
|
|
41215
|
+
}
|
|
41216
|
+
}
|
|
41217
|
+
function requireCatalogReadiness(issues, index, catalogId, context) {
|
|
41218
|
+
const catalog = index.ontology.catalogTypes[catalogId];
|
|
41219
|
+
if (catalog === void 0) {
|
|
41220
|
+
addReadinessIssue(
|
|
41221
|
+
issues,
|
|
41222
|
+
"SYSTEM_INTERFACE_NOT_READY",
|
|
41223
|
+
"missing-catalog",
|
|
41224
|
+
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" is missing required catalog "${catalogId}".`,
|
|
41225
|
+
{ ref: catalogId }
|
|
41226
|
+
);
|
|
41227
|
+
return void 0;
|
|
41228
|
+
}
|
|
41229
|
+
if (context.allowForeignOwner !== true && !ontologyOwnerMatches(catalogId, context.systemPath, catalog)) {
|
|
41230
|
+
addReadinessIssue(
|
|
41231
|
+
issues,
|
|
41232
|
+
"SYSTEM_INTERFACE_INVALID",
|
|
41233
|
+
"foreign-catalog",
|
|
41234
|
+
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" requires catalog "${catalogId}" owned by "${catalog.ownerSystemId ?? parseOntologyId(catalogId).scope}".`,
|
|
41235
|
+
{ ref: catalogId }
|
|
41236
|
+
);
|
|
41237
|
+
}
|
|
41238
|
+
if (Object.keys(getCatalogEntries(catalog)).length === 0) {
|
|
41239
|
+
addReadinessIssue(
|
|
41240
|
+
issues,
|
|
41241
|
+
"SYSTEM_INTERFACE_NOT_READY",
|
|
41242
|
+
"empty-catalog",
|
|
41243
|
+
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" requires catalog entries for "${catalogId}".`,
|
|
41244
|
+
{ ref: catalogId }
|
|
41245
|
+
);
|
|
41246
|
+
}
|
|
41247
|
+
return catalog;
|
|
41248
|
+
}
|
|
41249
|
+
function requireContractReadiness(issues, index, resources, contract, context) {
|
|
41250
|
+
const reads = resourceBindingIds(resources, "reads");
|
|
41251
|
+
const catalogs = resourceBindingIds(resources, "usesCatalogs");
|
|
41252
|
+
for (const objectId of contract.requiredObjects) {
|
|
41253
|
+
requireObjectReadiness(issues, index, objectId, context);
|
|
41254
|
+
requireScopedBinding(issues, reads, "reads", objectId, context);
|
|
41255
|
+
}
|
|
41256
|
+
for (const catalogId of contract.requiredCatalogs) {
|
|
41257
|
+
requireCatalogReadiness(issues, index, catalogId, context);
|
|
41258
|
+
requireScopedBinding(issues, catalogs, "usesCatalogs", catalogId, context);
|
|
41259
|
+
}
|
|
41260
|
+
}
|
|
41261
|
+
function getSystemInterfaceReadinessMarker(model, request2) {
|
|
41262
|
+
const system = getSystem(model, request2.systemPath);
|
|
41263
|
+
if (system === void 0) return void 0;
|
|
41264
|
+
const registeredMarker = resolveReadinessInterfaceMarker(model, request2.systemPath, request2.interfaceKey);
|
|
41265
|
+
if (registeredMarker !== void 0) return registeredMarker;
|
|
41266
|
+
if (request2.interfaceKey === "api" && system.apiInterface !== void 0) {
|
|
41267
|
+
return system.apiInterface;
|
|
41268
|
+
}
|
|
41269
|
+
return void 0;
|
|
41270
|
+
}
|
|
41271
|
+
function compileReadinessOntology(model, readinessProfile, prepareModel) {
|
|
41272
|
+
const preparedModel = prepareModel !== void 0 ? prepareModel(model) : model;
|
|
41273
|
+
const compilation = compileOrganizationOntology(preparedModel);
|
|
41274
|
+
if (compilation.diagnostics.length > 0) {
|
|
41275
|
+
const summary = compilation.diagnostics.map((diagnostic) => diagnostic.message).join("; ");
|
|
41276
|
+
throw new Error(`${readinessProfile} ontology validation index failed to compile: ${summary}`);
|
|
41277
|
+
}
|
|
41278
|
+
return { ontology: compilation.ontology };
|
|
41279
|
+
}
|
|
41280
|
+
function tryCompileReadinessOntology(model, readinessProfile, prepareModel, issues) {
|
|
41281
|
+
try {
|
|
41282
|
+
return compileReadinessOntology(model, readinessProfile, prepareModel);
|
|
41283
|
+
} catch (error46) {
|
|
41284
|
+
addReadinessIssue(
|
|
41285
|
+
issues,
|
|
41286
|
+
"SYSTEM_INTERFACE_INVALID",
|
|
41287
|
+
"ontology-compile-failed",
|
|
41288
|
+
error46 instanceof Error ? error46.message : String(error46)
|
|
41289
|
+
);
|
|
41290
|
+
return void 0;
|
|
41291
|
+
}
|
|
41292
|
+
}
|
|
41293
|
+
function computeInterfaceReadiness(model, request2) {
|
|
41294
|
+
const issues = [];
|
|
41295
|
+
const system = getSystem(model, request2.systemPath);
|
|
41296
|
+
const systemInterface = getSystemInterfaceReadinessMarker(model, request2);
|
|
41297
|
+
const readinessProfile = systemInterface?.readinessProfile;
|
|
41298
|
+
const scopedResourceIds = systemInterface?.resourceIds ?? [];
|
|
41299
|
+
if (system === void 0) {
|
|
41300
|
+
addReadinessIssue(
|
|
41301
|
+
issues,
|
|
41302
|
+
"SYSTEM_INTERFACE_MISSING",
|
|
41303
|
+
"missing-system",
|
|
41304
|
+
`System "${request2.systemPath}" is missing.`,
|
|
41305
|
+
{ ref: request2.systemPath }
|
|
41306
|
+
);
|
|
41307
|
+
return {
|
|
41308
|
+
ready: false,
|
|
41309
|
+
systemPath: request2.systemPath,
|
|
41310
|
+
interfaceKey: request2.interfaceKey,
|
|
41311
|
+
scopedResourceIds,
|
|
41312
|
+
issues
|
|
41313
|
+
};
|
|
41314
|
+
}
|
|
41315
|
+
if (systemInterface === void 0) {
|
|
41316
|
+
addReadinessIssue(
|
|
41317
|
+
issues,
|
|
41318
|
+
"SYSTEM_INTERFACE_MISSING",
|
|
41319
|
+
"missing-interface",
|
|
41320
|
+
`System "${request2.systemPath}" does not declare interface "${request2.interfaceKey}".`,
|
|
41321
|
+
{ path: readinessMarkerPath(request2) }
|
|
41322
|
+
);
|
|
41323
|
+
return {
|
|
41324
|
+
ready: false,
|
|
41325
|
+
systemPath: request2.systemPath,
|
|
41326
|
+
interfaceKey: request2.interfaceKey,
|
|
41327
|
+
scopedResourceIds,
|
|
41328
|
+
issues
|
|
41329
|
+
};
|
|
41330
|
+
}
|
|
41331
|
+
if (systemInterface.lifecycle !== "active") {
|
|
41332
|
+
addReadinessIssue(
|
|
41333
|
+
issues,
|
|
41334
|
+
"SYSTEM_INTERFACE_DISABLED",
|
|
41335
|
+
"inactive-interface",
|
|
41336
|
+
`System Interface "${formatInterfaceIdentity(request2.systemPath, request2.interfaceKey)}" lifecycle is "${systemInterface.lifecycle}".`,
|
|
41337
|
+
{ path: readinessMarkerFieldPath(request2, ".lifecycle") }
|
|
41338
|
+
);
|
|
41339
|
+
return {
|
|
41340
|
+
ready: false,
|
|
41341
|
+
systemPath: request2.systemPath,
|
|
41342
|
+
interfaceKey: request2.interfaceKey,
|
|
41343
|
+
readinessProfile,
|
|
41344
|
+
scopedResourceIds,
|
|
41345
|
+
issues
|
|
41346
|
+
};
|
|
41347
|
+
}
|
|
41348
|
+
if (readinessProfile === void 0) {
|
|
41349
|
+
addReadinessIssue(
|
|
41350
|
+
issues,
|
|
41351
|
+
"SYSTEM_INTERFACE_INVALID",
|
|
41352
|
+
"missing-readiness-profile",
|
|
41353
|
+
`System Interface "${formatInterfaceIdentity(request2.systemPath, request2.interfaceKey)}" declares an apiInterface but no readinessProfile. Declare a built-in profile (${formatSupportedReadinessProfiles()}) or a custom id paired with a readinessContract.`,
|
|
41354
|
+
{ path: readinessMarkerFieldPath(request2, ".readinessProfile") }
|
|
41355
|
+
);
|
|
41356
|
+
return {
|
|
41357
|
+
ready: false,
|
|
41358
|
+
systemPath: request2.systemPath,
|
|
41359
|
+
interfaceKey: request2.interfaceKey,
|
|
41360
|
+
scopedResourceIds,
|
|
41361
|
+
issues
|
|
41362
|
+
};
|
|
41363
|
+
}
|
|
41364
|
+
const isBuiltIn = isBuiltInReadinessProfile(readinessProfile);
|
|
41365
|
+
const readinessContract = systemInterface.readinessContract;
|
|
41366
|
+
if (!isBuiltIn && readinessContract === void 0) {
|
|
41367
|
+
addReadinessIssue(
|
|
41368
|
+
issues,
|
|
41369
|
+
"SYSTEM_INTERFACE_INVALID",
|
|
41370
|
+
"missing-readiness-contract",
|
|
41371
|
+
`System Interface "${formatInterfaceIdentity(request2.systemPath, request2.interfaceKey)}" uses custom readiness profile "${readinessProfile}" but declares no readinessContract. Built-in profiles: ${formatSupportedReadinessProfiles()}.`,
|
|
41372
|
+
{ path: readinessMarkerFieldPath(request2, ".readinessContract"), ref: readinessProfile }
|
|
41373
|
+
);
|
|
41374
|
+
return {
|
|
41375
|
+
ready: false,
|
|
41376
|
+
systemPath: request2.systemPath,
|
|
41377
|
+
interfaceKey: request2.interfaceKey,
|
|
41378
|
+
readinessProfile,
|
|
41379
|
+
scopedResourceIds,
|
|
41380
|
+
issues
|
|
41381
|
+
};
|
|
41382
|
+
}
|
|
41383
|
+
if (scopedResourceIds.length === 0) {
|
|
41384
|
+
addReadinessIssue(
|
|
41385
|
+
issues,
|
|
41386
|
+
"SYSTEM_INTERFACE_NOT_READY",
|
|
41387
|
+
"missing-scoped-resources",
|
|
41388
|
+
`System Interface "${formatInterfaceIdentity(request2.systemPath, request2.interfaceKey)}" must scope at least one active resource.`,
|
|
41389
|
+
{ path: readinessMarkerFieldPath(request2, ".resourceIds") }
|
|
41390
|
+
);
|
|
41391
|
+
}
|
|
41392
|
+
const resources = getActiveScopedResources(model, scopedResourceIds, issues, request2);
|
|
41393
|
+
const registration = getBuiltInReadinessProfile(readinessProfile);
|
|
41394
|
+
const index = tryCompileReadinessOntology(model, readinessProfile, registration?.prepareModel, issues);
|
|
41395
|
+
if (index !== void 0) {
|
|
41396
|
+
if (registration !== void 0) {
|
|
41397
|
+
registration.validate(issues, index, resources, model, request2);
|
|
41398
|
+
} else if (readinessContract !== void 0) {
|
|
41399
|
+
requireContractReadiness(issues, index, resources, readinessContract, request2);
|
|
41400
|
+
}
|
|
41401
|
+
}
|
|
41402
|
+
return {
|
|
41403
|
+
ready: issues.length === 0,
|
|
41404
|
+
systemPath: request2.systemPath,
|
|
41405
|
+
interfaceKey: request2.interfaceKey,
|
|
41406
|
+
readinessProfile,
|
|
41407
|
+
scopedResourceIds,
|
|
41408
|
+
issues
|
|
41409
|
+
};
|
|
41410
|
+
}
|
|
41411
|
+
|
|
41032
41412
|
// src/contract-ref.ts
|
|
41033
41413
|
var ContractRefResolutionError = class extends Error {
|
|
41034
41414
|
constructor(code, message, ref) {
|
|
@@ -43537,7 +43917,7 @@ function validateTokenConfiguration(model, maxOutputTokens) {
|
|
|
43537
43917
|
}
|
|
43538
43918
|
|
|
43539
43919
|
// ../core/src/execution/engine/llm/schema/compile.ts
|
|
43540
|
-
function
|
|
43920
|
+
function isPlainObject3(value) {
|
|
43541
43921
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
43542
43922
|
}
|
|
43543
43923
|
var UNSUPPORTED_KEYWORDS = /* @__PURE__ */ new Set([
|
|
@@ -43588,7 +43968,7 @@ function convertNode(node, state, depth) {
|
|
|
43588
43968
|
if (Array.isArray(node)) {
|
|
43589
43969
|
return node.map((item) => convertNode(item, state, depth + 1));
|
|
43590
43970
|
}
|
|
43591
|
-
if (!
|
|
43971
|
+
if (!isPlainObject3(node)) {
|
|
43592
43972
|
return node;
|
|
43593
43973
|
}
|
|
43594
43974
|
const strictEngaged = state.dialect.strict !== "unsupported";
|
|
@@ -43611,7 +43991,7 @@ function convertNode(node, state, depth) {
|
|
|
43611
43991
|
continue;
|
|
43612
43992
|
}
|
|
43613
43993
|
if (key === "properties") {
|
|
43614
|
-
if (!
|
|
43994
|
+
if (!isPlainObject3(value)) {
|
|
43615
43995
|
out.properties = value;
|
|
43616
43996
|
continue;
|
|
43617
43997
|
}
|
|
@@ -43655,9 +44035,9 @@ function convertNode(node, state, depth) {
|
|
|
43655
44035
|
}
|
|
43656
44036
|
out[key] = convertNode(value, state, depth + 1);
|
|
43657
44037
|
}
|
|
43658
|
-
const isObjectNode = out.type === "object" ||
|
|
44038
|
+
const isObjectNode = out.type === "object" || isPlainObject3(out.properties);
|
|
43659
44039
|
if (isObjectNode) {
|
|
43660
|
-
const properties =
|
|
44040
|
+
const properties = isPlainObject3(out.properties) ? out.properties : void 0;
|
|
43661
44041
|
const originalAdditionalProperties = node.additionalProperties;
|
|
43662
44042
|
if (strictEngaged) {
|
|
43663
44043
|
if (properties) {
|
|
@@ -43684,7 +44064,7 @@ function dedupe(values) {
|
|
|
43684
44064
|
return [...new Set(values)];
|
|
43685
44065
|
}
|
|
43686
44066
|
function compileSchema(schema, dialect) {
|
|
43687
|
-
if (!
|
|
44067
|
+
if (!isPlainObject3(schema)) {
|
|
43688
44068
|
const strictEngaged = dialect.strict !== "unsupported";
|
|
43689
44069
|
return {
|
|
43690
44070
|
schema,
|
|
@@ -43807,7 +44187,7 @@ function buildIterationResponseSchemaUncached(tools, capabilities) {
|
|
|
43807
44187
|
if (capabilities.message !== "off") {
|
|
43808
44188
|
properties.message = {
|
|
43809
44189
|
type: "string",
|
|
43810
|
-
description:
|
|
44190
|
+
description: 'Your reply to the user, as plain prose. This is the ONLY field the user sees. Use an empty string only when this iteration just calls tools and you have nothing to say yet. Write real line breaks and real quotation marks -- the two characters \\n are not a line break, and \\" is not a quotation mark. Serialization is handled for you.'
|
|
43811
44191
|
};
|
|
43812
44192
|
}
|
|
43813
44193
|
properties.reasoning = { type: "string", description: "Your reasoning process" };
|
|
@@ -43827,7 +44207,15 @@ function buildIterationResponseSchemaUncached(tools, capabilities) {
|
|
|
43827
44207
|
type: "object",
|
|
43828
44208
|
properties: {
|
|
43829
44209
|
key: { type: "string" },
|
|
43830
|
-
value: {
|
|
44210
|
+
value: {
|
|
44211
|
+
type: "string",
|
|
44212
|
+
// `memoryOps` has NO framework prompt section -- a grep across `prompt-sections/`
|
|
44213
|
+
// returns zero memory references -- so this description is the only framework-owned
|
|
44214
|
+
// lever on how a memory value is written. It matters more here than in `message`:
|
|
44215
|
+
// a session-memory value is re-sent on every iteration of every subsequent turn and
|
|
44216
|
+
// never ages out, so one literal escape stored here is one the model re-reads forever.
|
|
44217
|
+
description: "Stored verbatim and replayed to you on every later turn. Write real line breaks and real quotation marks -- the two characters \\n are not a line break."
|
|
44218
|
+
}
|
|
43831
44219
|
},
|
|
43832
44220
|
required: ["key", "value"],
|
|
43833
44221
|
additionalProperties: false
|
|
@@ -43846,465 +44234,6 @@ function buildIterationResponseSchemaUncached(tools, capabilities) {
|
|
|
43846
44234
|
};
|
|
43847
44235
|
}
|
|
43848
44236
|
|
|
43849
|
-
// ../core/src/business/acquisition/ontology-validation.ts
|
|
43850
|
-
var LEAD_GEN_API_INTERFACE = SYSTEM_INTERFACE_PROFILES[0];
|
|
43851
|
-
var CRM_API_INTERFACE = SYSTEM_INTERFACE_PROFILES[1];
|
|
43852
|
-
var LEAD_GEN_CRM_HANDOFF_INTERFACE = SYSTEM_INTERFACE_PROFILES[2];
|
|
43853
|
-
var LEAD_GEN_API_READINESS_LABEL = LEAD_GEN_API_INTERFACE.readinessProfile;
|
|
43854
|
-
var CRM_API_READINESS_LABEL = CRM_API_INTERFACE.readinessProfile;
|
|
43855
|
-
var LEAD_GEN_CRM_HANDOFF_READINESS_LABEL = LEAD_GEN_CRM_HANDOFF_INTERFACE.readinessProfile;
|
|
43856
|
-
var LEAD_GEN_LIST_OBJECT_ONTOLOGY_ID = formatOntologyId({
|
|
43857
|
-
scope: "sales.lead-gen",
|
|
43858
|
-
kind: "object",
|
|
43859
|
-
localId: "list"
|
|
43860
|
-
});
|
|
43861
|
-
var LEAD_GEN_COMPANY_OBJECT_ONTOLOGY_ID = formatOntologyId({
|
|
43862
|
-
scope: "sales.lead-gen",
|
|
43863
|
-
kind: "object",
|
|
43864
|
-
localId: "company"
|
|
43865
|
-
});
|
|
43866
|
-
var LEAD_GEN_CONTACT_OBJECT_ONTOLOGY_ID = formatOntologyId({
|
|
43867
|
-
scope: "sales.lead-gen",
|
|
43868
|
-
kind: "object",
|
|
43869
|
-
localId: "contact"
|
|
43870
|
-
});
|
|
43871
|
-
var LEAD_GEN_BUILD_TEMPLATE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
43872
|
-
scope: "sales.lead-gen",
|
|
43873
|
-
kind: "catalog",
|
|
43874
|
-
localId: "build-template"
|
|
43875
|
-
});
|
|
43876
|
-
var LEAD_GEN_COMPANY_STAGE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
43877
|
-
scope: "sales.lead-gen",
|
|
43878
|
-
kind: "catalog",
|
|
43879
|
-
localId: "company-stage"
|
|
43880
|
-
});
|
|
43881
|
-
var LEAD_GEN_CONTACT_STAGE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
43882
|
-
scope: "sales.lead-gen",
|
|
43883
|
-
kind: "catalog",
|
|
43884
|
-
localId: "contact-stage"
|
|
43885
|
-
});
|
|
43886
|
-
var CRM_PIPELINE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
43887
|
-
scope: "sales.crm",
|
|
43888
|
-
kind: "catalog",
|
|
43889
|
-
localId: "crm.pipeline"
|
|
43890
|
-
});
|
|
43891
|
-
var LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
43892
|
-
scope: "sales.lead-gen",
|
|
43893
|
-
kind: "catalog",
|
|
43894
|
-
localId: "lead-gen.stage-catalog"
|
|
43895
|
-
});
|
|
43896
|
-
function createLeadGenStageCatalog(model) {
|
|
43897
|
-
return {
|
|
43898
|
-
id: LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID,
|
|
43899
|
-
label: "Lead Gen Processing Stages",
|
|
43900
|
-
ownerSystemId: "sales.lead-gen",
|
|
43901
|
-
kind: "processing-stage-catalog",
|
|
43902
|
-
entries: Object.fromEntries(
|
|
43903
|
-
Object.entries(getLeadGenStageCatalog(model)).map(([key, entry]) => [
|
|
43904
|
-
key,
|
|
43905
|
-
{
|
|
43906
|
-
...entry
|
|
43907
|
-
}
|
|
43908
|
-
])
|
|
43909
|
-
),
|
|
43910
|
-
legacyCatalogKey: "LEAD_GEN_STAGE_CATALOG"
|
|
43911
|
-
};
|
|
43912
|
-
}
|
|
43913
|
-
function isPlainRecord(value) {
|
|
43914
|
-
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
43915
|
-
}
|
|
43916
|
-
function addReadinessIssue(issues, family, code, message, details = {}) {
|
|
43917
|
-
issues.push({
|
|
43918
|
-
family,
|
|
43919
|
-
code,
|
|
43920
|
-
message,
|
|
43921
|
-
...details
|
|
43922
|
-
});
|
|
43923
|
-
}
|
|
43924
|
-
function formatInterfaceIdentity(systemPath, interfaceKey) {
|
|
43925
|
-
return `${systemPath}/${interfaceKey}`;
|
|
43926
|
-
}
|
|
43927
|
-
function readinessMarkerPath(context) {
|
|
43928
|
-
return context.interfaceKey === "api" ? `systems.${context.systemPath}.apiInterface` : `systems.${context.systemPath}.derivedCrmHandoffReadiness`;
|
|
43929
|
-
}
|
|
43930
|
-
function formatSupportedReadinessProfiles() {
|
|
43931
|
-
return SYSTEM_INTERFACE_PROFILES.map((p) => `"${p.readinessProfile}"`).join(", ");
|
|
43932
|
-
}
|
|
43933
|
-
function getActiveScopedResources(model, resourceIds, issues, context) {
|
|
43934
|
-
const resources = [];
|
|
43935
|
-
for (const [index, resourceId] of resourceIds.entries()) {
|
|
43936
|
-
const resource = model.resources?.[resourceId];
|
|
43937
|
-
const path3 = `${readinessMarkerPath(context)}.resourceIds.${index}`;
|
|
43938
|
-
if (resource === void 0) {
|
|
43939
|
-
addReadinessIssue(
|
|
43940
|
-
issues,
|
|
43941
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
43942
|
-
"missing-resource",
|
|
43943
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" scopes missing resource "${resourceId}".`,
|
|
43944
|
-
{ path: path3, ref: resourceId }
|
|
43945
|
-
);
|
|
43946
|
-
continue;
|
|
43947
|
-
}
|
|
43948
|
-
if (resource.systemPath !== context.systemPath) {
|
|
43949
|
-
addReadinessIssue(
|
|
43950
|
-
issues,
|
|
43951
|
-
"SYSTEM_INTERFACE_INVALID",
|
|
43952
|
-
"resource-system-mismatch",
|
|
43953
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" scopes resource "${resourceId}" from system "${resource.systemPath}".`,
|
|
43954
|
-
{ path: path3, ref: resourceId }
|
|
43955
|
-
);
|
|
43956
|
-
continue;
|
|
43957
|
-
}
|
|
43958
|
-
if (resource.status !== "active") {
|
|
43959
|
-
addReadinessIssue(
|
|
43960
|
-
issues,
|
|
43961
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
43962
|
-
"inactive-resource",
|
|
43963
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" scopes inactive resource "${resourceId}".`,
|
|
43964
|
-
{ path: path3, ref: resourceId }
|
|
43965
|
-
);
|
|
43966
|
-
continue;
|
|
43967
|
-
}
|
|
43968
|
-
resources.push(resource);
|
|
43969
|
-
}
|
|
43970
|
-
return resources;
|
|
43971
|
-
}
|
|
43972
|
-
function resourceBindingIds(resources, key) {
|
|
43973
|
-
return new Set(resources.flatMap((resource) => resource.ontology?.[key] ?? []));
|
|
43974
|
-
}
|
|
43975
|
-
function requireScopedBinding(issues, boundIds, bindingKey, ontologyId, context) {
|
|
43976
|
-
if (boundIds.has(ontologyId)) return;
|
|
43977
|
-
addReadinessIssue(
|
|
43978
|
-
issues,
|
|
43979
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
43980
|
-
"missing-resource-binding",
|
|
43981
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" has no active scoped resource with ontology.${bindingKey} binding "${ontologyId}".`,
|
|
43982
|
-
{ path: `${readinessMarkerPath(context)}.resourceIds`, ref: ontologyId }
|
|
43983
|
-
);
|
|
43984
|
-
}
|
|
43985
|
-
function ontologyOwnerMatches(ontologyId, expectedSystemPath, catalog) {
|
|
43986
|
-
if (catalog?.ownerSystemId !== void 0) return catalog.ownerSystemId === expectedSystemPath;
|
|
43987
|
-
return parseOntologyId(ontologyId).scope === expectedSystemPath;
|
|
43988
|
-
}
|
|
43989
|
-
function requireObjectReadiness(issues, index, objectId, context) {
|
|
43990
|
-
const object2 = index.ontology.objectTypes[objectId];
|
|
43991
|
-
if (object2 === void 0) {
|
|
43992
|
-
addReadinessIssue(
|
|
43993
|
-
issues,
|
|
43994
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
43995
|
-
"missing-object",
|
|
43996
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" is missing required object type "${objectId}".`,
|
|
43997
|
-
{ ref: objectId }
|
|
43998
|
-
);
|
|
43999
|
-
return;
|
|
44000
|
-
}
|
|
44001
|
-
const ownerSystemId = object2.ownerSystemId ?? parseOntologyId(objectId).scope;
|
|
44002
|
-
if (ownerSystemId !== context.systemPath) {
|
|
44003
|
-
addReadinessIssue(
|
|
44004
|
-
issues,
|
|
44005
|
-
"SYSTEM_INTERFACE_INVALID",
|
|
44006
|
-
"foreign-object",
|
|
44007
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" requires object "${objectId}" owned by "${ownerSystemId}".`,
|
|
44008
|
-
{ ref: objectId }
|
|
44009
|
-
);
|
|
44010
|
-
}
|
|
44011
|
-
}
|
|
44012
|
-
function requireCatalogReadiness(issues, index, catalogId, context) {
|
|
44013
|
-
const catalog = index.ontology.catalogTypes[catalogId];
|
|
44014
|
-
if (catalog === void 0) {
|
|
44015
|
-
addReadinessIssue(
|
|
44016
|
-
issues,
|
|
44017
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
44018
|
-
"missing-catalog",
|
|
44019
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" is missing required catalog "${catalogId}".`,
|
|
44020
|
-
{ ref: catalogId }
|
|
44021
|
-
);
|
|
44022
|
-
return void 0;
|
|
44023
|
-
}
|
|
44024
|
-
if (context.allowForeignOwner !== true && !ontologyOwnerMatches(catalogId, context.systemPath, catalog)) {
|
|
44025
|
-
addReadinessIssue(
|
|
44026
|
-
issues,
|
|
44027
|
-
"SYSTEM_INTERFACE_INVALID",
|
|
44028
|
-
"foreign-catalog",
|
|
44029
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" requires catalog "${catalogId}" owned by "${catalog.ownerSystemId ?? parseOntologyId(catalogId).scope}".`,
|
|
44030
|
-
{ ref: catalogId }
|
|
44031
|
-
);
|
|
44032
|
-
}
|
|
44033
|
-
if (Object.keys(getCatalogEntries(catalog)).length === 0) {
|
|
44034
|
-
addReadinessIssue(
|
|
44035
|
-
issues,
|
|
44036
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
44037
|
-
"empty-catalog",
|
|
44038
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" requires catalog entries for "${catalogId}".`,
|
|
44039
|
-
{ ref: catalogId }
|
|
44040
|
-
);
|
|
44041
|
-
}
|
|
44042
|
-
return catalog;
|
|
44043
|
-
}
|
|
44044
|
-
function requireLeadGenInterfaceReadiness(issues, index, resources, context) {
|
|
44045
|
-
const reads = resourceBindingIds(resources, "reads");
|
|
44046
|
-
const catalogs = resourceBindingIds(resources, "usesCatalogs");
|
|
44047
|
-
for (const objectId of [
|
|
44048
|
-
LEAD_GEN_LIST_OBJECT_ONTOLOGY_ID,
|
|
44049
|
-
LEAD_GEN_COMPANY_OBJECT_ONTOLOGY_ID,
|
|
44050
|
-
LEAD_GEN_CONTACT_OBJECT_ONTOLOGY_ID
|
|
44051
|
-
]) {
|
|
44052
|
-
requireObjectReadiness(issues, index, objectId, context);
|
|
44053
|
-
requireScopedBinding(issues, reads, "reads", objectId, context);
|
|
44054
|
-
}
|
|
44055
|
-
for (const catalogId of [
|
|
44056
|
-
LEAD_GEN_BUILD_TEMPLATE_CATALOG_ONTOLOGY_ID,
|
|
44057
|
-
LEAD_GEN_COMPANY_STAGE_CATALOG_ONTOLOGY_ID,
|
|
44058
|
-
LEAD_GEN_CONTACT_STAGE_CATALOG_ONTOLOGY_ID
|
|
44059
|
-
]) {
|
|
44060
|
-
requireCatalogReadiness(issues, index, catalogId, context);
|
|
44061
|
-
requireScopedBinding(issues, catalogs, "usesCatalogs", catalogId, context);
|
|
44062
|
-
}
|
|
44063
|
-
const templateStepCatalog = findLeadGenTemplateStepCatalog(index);
|
|
44064
|
-
if (templateStepCatalog === void 0) {
|
|
44065
|
-
addReadinessIssue(
|
|
44066
|
-
issues,
|
|
44067
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
44068
|
-
"missing-template-step-catalog",
|
|
44069
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" is missing a lead-gen template-step catalog.`
|
|
44070
|
-
);
|
|
44071
|
-
} else {
|
|
44072
|
-
requireCatalogReadiness(issues, index, templateStepCatalog.id, context);
|
|
44073
|
-
requireScopedBinding(issues, catalogs, "usesCatalogs", templateStepCatalog.id, context);
|
|
44074
|
-
}
|
|
44075
|
-
const leadGenStageCatalog = requireCatalogReadiness(issues, index, LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID, context);
|
|
44076
|
-
return leadGenStageCatalog;
|
|
44077
|
-
}
|
|
44078
|
-
function requireCrmInterfaceReadiness(issues, index, resources, context) {
|
|
44079
|
-
const catalogs = resourceBindingIds(resources, "usesCatalogs");
|
|
44080
|
-
const crmPipelineCatalog = requireCatalogReadiness(issues, index, CRM_PIPELINE_CATALOG_ONTOLOGY_ID, context);
|
|
44081
|
-
requireScopedBinding(issues, catalogs, "usesCatalogs", CRM_PIPELINE_CATALOG_ONTOLOGY_ID, context);
|
|
44082
|
-
return crmPipelineCatalog;
|
|
44083
|
-
}
|
|
44084
|
-
function findSystemInterfaceGrant(model, consumer, provider) {
|
|
44085
|
-
return Object.values(model.topology?.relationships ?? {}).find((relationship) => {
|
|
44086
|
-
const grant = relationship.metadata?.["systemInterfaceGrant"];
|
|
44087
|
-
if (!isPlainRecord(grant) || !isPlainRecord(grant.consumer) || !isPlainRecord(grant.provider)) return false;
|
|
44088
|
-
return grant.consumer.systemPath === consumer.systemPath && grant.consumer.interfaceKey === consumer.interfaceKey && grant.provider.systemPath === provider.systemPath && grant.provider.interfaceKey === provider.interfaceKey;
|
|
44089
|
-
});
|
|
44090
|
-
}
|
|
44091
|
-
function requireHandoffBridgeReadiness(issues, model, context) {
|
|
44092
|
-
const crmResult = computeInterfaceReadiness(model, CRM_API_INTERFACE);
|
|
44093
|
-
if (!crmResult.ready) {
|
|
44094
|
-
for (const issue2 of crmResult.issues) {
|
|
44095
|
-
addReadinessIssue(
|
|
44096
|
-
issues,
|
|
44097
|
-
"SYSTEM_BRIDGE_NOT_READY",
|
|
44098
|
-
issue2.code,
|
|
44099
|
-
`Provider interface ${formatInterfaceIdentity(CRM_API_INTERFACE.systemPath, CRM_API_INTERFACE.interfaceKey)} is not ready: ${issue2.message}`,
|
|
44100
|
-
{ path: issue2.path, ref: issue2.ref }
|
|
44101
|
-
);
|
|
44102
|
-
}
|
|
44103
|
-
}
|
|
44104
|
-
const bridgeGrant = findSystemInterfaceGrant(model, context, CRM_API_INTERFACE);
|
|
44105
|
-
if (bridgeGrant === void 0) {
|
|
44106
|
-
addReadinessIssue(
|
|
44107
|
-
issues,
|
|
44108
|
-
"SYSTEM_BRIDGE_NOT_READY",
|
|
44109
|
-
"missing-topology-grant",
|
|
44110
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" requires a scoped topology grant to "${formatInterfaceIdentity(CRM_API_INTERFACE.systemPath, CRM_API_INTERFACE.interfaceKey)}".`
|
|
44111
|
-
);
|
|
44112
|
-
}
|
|
44113
|
-
return bridgeGrant;
|
|
44114
|
-
}
|
|
44115
|
-
function getLeadGenCrmHandoffResourceIds(model) {
|
|
44116
|
-
return Object.values(model.resources ?? {}).filter(
|
|
44117
|
-
(resource) => resource.systemPath === LEAD_GEN_CRM_HANDOFF_INTERFACE.systemPath && resource.ontology?.usesCatalogs?.includes(CRM_PIPELINE_CATALOG_ONTOLOGY_ID) === true
|
|
44118
|
-
).map((resource) => resource.id);
|
|
44119
|
-
}
|
|
44120
|
-
function getSystemInterfaceReadinessMarker(model, request2) {
|
|
44121
|
-
const system = getSystem(model, request2.systemPath);
|
|
44122
|
-
if (system === void 0) return void 0;
|
|
44123
|
-
if (request2.systemPath === LEAD_GEN_CRM_HANDOFF_INTERFACE.systemPath && request2.interfaceKey === LEAD_GEN_CRM_HANDOFF_INTERFACE.interfaceKey) {
|
|
44124
|
-
return {
|
|
44125
|
-
lifecycle: "active",
|
|
44126
|
-
readinessProfile: LEAD_GEN_CRM_HANDOFF_INTERFACE.readinessProfile,
|
|
44127
|
-
resourceIds: getLeadGenCrmHandoffResourceIds(model)
|
|
44128
|
-
};
|
|
44129
|
-
}
|
|
44130
|
-
if (request2.interfaceKey === "api" && system.apiInterface !== void 0) {
|
|
44131
|
-
return system.apiInterface;
|
|
44132
|
-
}
|
|
44133
|
-
return void 0;
|
|
44134
|
-
}
|
|
44135
|
-
function mergeLeadGenDerivedCatalogs(model) {
|
|
44136
|
-
const baseCatalogTypes = model.ontology?.catalogTypes ?? {};
|
|
44137
|
-
const derivedCatalogTypes = {};
|
|
44138
|
-
if (baseCatalogTypes[LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID] === void 0) {
|
|
44139
|
-
derivedCatalogTypes[LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID] = createLeadGenStageCatalog(model);
|
|
44140
|
-
}
|
|
44141
|
-
if (Object.keys(derivedCatalogTypes).length === 0) return model;
|
|
44142
|
-
return {
|
|
44143
|
-
...model,
|
|
44144
|
-
ontology: {
|
|
44145
|
-
...model.ontology ?? {},
|
|
44146
|
-
catalogTypes: {
|
|
44147
|
-
...baseCatalogTypes,
|
|
44148
|
-
...derivedCatalogTypes
|
|
44149
|
-
}
|
|
44150
|
-
}
|
|
44151
|
-
};
|
|
44152
|
-
}
|
|
44153
|
-
function compileBusinessOntology(model, contractId) {
|
|
44154
|
-
const compilation = compileOrganizationOntology(mergeLeadGenDerivedCatalogs(model));
|
|
44155
|
-
if (compilation.diagnostics.length > 0) {
|
|
44156
|
-
const summary = compilation.diagnostics.map((diagnostic) => diagnostic.message).join("; ");
|
|
44157
|
-
throw new Error(`${contractId} ontology validation index failed to compile: ${summary}`);
|
|
44158
|
-
}
|
|
44159
|
-
return {
|
|
44160
|
-
ontology: compilation.ontology,
|
|
44161
|
-
actionTypesByLegacyId: indexActionTypesByLegacyId(compilation.ontology.actionTypes)
|
|
44162
|
-
};
|
|
44163
|
-
}
|
|
44164
|
-
function tryCompileBusinessOntology(model, readinessProfile, issues) {
|
|
44165
|
-
try {
|
|
44166
|
-
return compileBusinessOntology(model, readinessProfile);
|
|
44167
|
-
} catch (error46) {
|
|
44168
|
-
addReadinessIssue(
|
|
44169
|
-
issues,
|
|
44170
|
-
"SYSTEM_INTERFACE_INVALID",
|
|
44171
|
-
"ontology-compile-failed",
|
|
44172
|
-
error46 instanceof Error ? error46.message : String(error46)
|
|
44173
|
-
);
|
|
44174
|
-
return void 0;
|
|
44175
|
-
}
|
|
44176
|
-
}
|
|
44177
|
-
function requireContractReadiness(issues, index, resources, contract, context) {
|
|
44178
|
-
const reads = resourceBindingIds(resources, "reads");
|
|
44179
|
-
const catalogs = resourceBindingIds(resources, "usesCatalogs");
|
|
44180
|
-
for (const objectId of contract.requiredObjects) {
|
|
44181
|
-
requireObjectReadiness(issues, index, objectId, context);
|
|
44182
|
-
requireScopedBinding(issues, reads, "reads", objectId, context);
|
|
44183
|
-
}
|
|
44184
|
-
for (const catalogId of contract.requiredCatalogs) {
|
|
44185
|
-
requireCatalogReadiness(issues, index, catalogId, context);
|
|
44186
|
-
requireScopedBinding(issues, catalogs, "usesCatalogs", catalogId, context);
|
|
44187
|
-
}
|
|
44188
|
-
}
|
|
44189
|
-
function computeInterfaceReadiness(model, request2) {
|
|
44190
|
-
const issues = [];
|
|
44191
|
-
const system = getSystem(model, request2.systemPath);
|
|
44192
|
-
const systemInterface = getSystemInterfaceReadinessMarker(model, request2);
|
|
44193
|
-
const readinessProfile = systemInterface === void 0 ? void 0 : profileForInterface(request2.systemPath, request2.interfaceKey, systemInterface.readinessProfile);
|
|
44194
|
-
const scopedResourceIds = systemInterface?.resourceIds ?? [];
|
|
44195
|
-
if (system === void 0) {
|
|
44196
|
-
addReadinessIssue(
|
|
44197
|
-
issues,
|
|
44198
|
-
"SYSTEM_INTERFACE_MISSING",
|
|
44199
|
-
"missing-system",
|
|
44200
|
-
`System "${request2.systemPath}" is missing.`,
|
|
44201
|
-
{ ref: request2.systemPath }
|
|
44202
|
-
);
|
|
44203
|
-
return {
|
|
44204
|
-
ready: false,
|
|
44205
|
-
systemPath: request2.systemPath,
|
|
44206
|
-
interfaceKey: request2.interfaceKey,
|
|
44207
|
-
scopedResourceIds,
|
|
44208
|
-
issues
|
|
44209
|
-
};
|
|
44210
|
-
}
|
|
44211
|
-
if (systemInterface === void 0) {
|
|
44212
|
-
addReadinessIssue(
|
|
44213
|
-
issues,
|
|
44214
|
-
"SYSTEM_INTERFACE_MISSING",
|
|
44215
|
-
"missing-interface",
|
|
44216
|
-
`System "${request2.systemPath}" does not declare interface "${request2.interfaceKey}".`,
|
|
44217
|
-
{ path: readinessMarkerPath(request2) }
|
|
44218
|
-
);
|
|
44219
|
-
return {
|
|
44220
|
-
ready: false,
|
|
44221
|
-
systemPath: request2.systemPath,
|
|
44222
|
-
interfaceKey: request2.interfaceKey,
|
|
44223
|
-
scopedResourceIds,
|
|
44224
|
-
issues
|
|
44225
|
-
};
|
|
44226
|
-
}
|
|
44227
|
-
if (systemInterface.lifecycle !== "active") {
|
|
44228
|
-
addReadinessIssue(
|
|
44229
|
-
issues,
|
|
44230
|
-
"SYSTEM_INTERFACE_DISABLED",
|
|
44231
|
-
"inactive-interface",
|
|
44232
|
-
`System Interface "${formatInterfaceIdentity(request2.systemPath, request2.interfaceKey)}" lifecycle is "${systemInterface.lifecycle}".`,
|
|
44233
|
-
{ path: `${readinessMarkerPath(request2)}.lifecycle` }
|
|
44234
|
-
);
|
|
44235
|
-
}
|
|
44236
|
-
const checkedReadinessProfile = readinessProfile ?? profileForInterface(request2.systemPath, request2.interfaceKey);
|
|
44237
|
-
const isBuiltIn = isBuiltInReadinessProfile(checkedReadinessProfile);
|
|
44238
|
-
const readinessContract = systemInterface.readinessContract;
|
|
44239
|
-
if (!isBuiltIn && readinessContract === void 0) {
|
|
44240
|
-
addReadinessIssue(
|
|
44241
|
-
issues,
|
|
44242
|
-
"SYSTEM_INTERFACE_INVALID",
|
|
44243
|
-
"missing-readiness-contract",
|
|
44244
|
-
`System Interface "${formatInterfaceIdentity(request2.systemPath, request2.interfaceKey)}" uses custom readiness profile "${checkedReadinessProfile}" but declares no readinessContract. Built-in profiles: ${formatSupportedReadinessProfiles()}.`,
|
|
44245
|
-
{ path: `${readinessMarkerPath(request2)}.readinessContract`, ref: checkedReadinessProfile }
|
|
44246
|
-
);
|
|
44247
|
-
return {
|
|
44248
|
-
ready: false,
|
|
44249
|
-
systemPath: request2.systemPath,
|
|
44250
|
-
interfaceKey: request2.interfaceKey,
|
|
44251
|
-
readinessProfile: checkedReadinessProfile,
|
|
44252
|
-
scopedResourceIds,
|
|
44253
|
-
issues
|
|
44254
|
-
};
|
|
44255
|
-
}
|
|
44256
|
-
if (scopedResourceIds.length === 0) {
|
|
44257
|
-
addReadinessIssue(
|
|
44258
|
-
issues,
|
|
44259
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
44260
|
-
"missing-scoped-resources",
|
|
44261
|
-
`System Interface "${formatInterfaceIdentity(request2.systemPath, request2.interfaceKey)}" must scope at least one active resource.`,
|
|
44262
|
-
{ path: `${readinessMarkerPath(request2)}.resourceIds` }
|
|
44263
|
-
);
|
|
44264
|
-
}
|
|
44265
|
-
const resources = getActiveScopedResources(model, scopedResourceIds, issues, request2);
|
|
44266
|
-
const index = tryCompileBusinessOntology(model, checkedReadinessProfile, issues);
|
|
44267
|
-
if (index !== void 0) {
|
|
44268
|
-
if (checkedReadinessProfile === LEAD_GEN_API_INTERFACE.readinessProfile) {
|
|
44269
|
-
requireLeadGenInterfaceReadiness(issues, index, resources, request2);
|
|
44270
|
-
} else if (checkedReadinessProfile === CRM_API_INTERFACE.readinessProfile) {
|
|
44271
|
-
requireCrmInterfaceReadiness(issues, index, resources, request2);
|
|
44272
|
-
} else if (checkedReadinessProfile === LEAD_GEN_CRM_HANDOFF_INTERFACE.readinessProfile) {
|
|
44273
|
-
requireLeadGenInterfaceReadiness(issues, index, resources, request2);
|
|
44274
|
-
requireCrmInterfaceReadiness(issues, index, resources, { ...request2, allowForeignOwner: true });
|
|
44275
|
-
requireHandoffBridgeReadiness(issues, model, request2);
|
|
44276
|
-
} else if (readinessContract !== void 0) {
|
|
44277
|
-
requireContractReadiness(issues, index, resources, readinessContract, request2);
|
|
44278
|
-
}
|
|
44279
|
-
}
|
|
44280
|
-
return {
|
|
44281
|
-
ready: issues.length === 0,
|
|
44282
|
-
systemPath: request2.systemPath,
|
|
44283
|
-
interfaceKey: request2.interfaceKey,
|
|
44284
|
-
readinessProfile: checkedReadinessProfile,
|
|
44285
|
-
scopedResourceIds,
|
|
44286
|
-
issues
|
|
44287
|
-
};
|
|
44288
|
-
}
|
|
44289
|
-
function findLeadGenTemplateStepCatalog(index) {
|
|
44290
|
-
return Object.values(index.ontology.catalogTypes).find(
|
|
44291
|
-
(catalog) => catalog.ownerSystemId === "sales.lead-gen" && catalog.kind === "template-step" && catalog.appliesTo === LEAD_GEN_LIST_OBJECT_ONTOLOGY_ID
|
|
44292
|
-
);
|
|
44293
|
-
}
|
|
44294
|
-
function indexActionTypesByLegacyId(actionTypes) {
|
|
44295
|
-
const byLegacyId = {};
|
|
44296
|
-
for (const actionType of Object.values(actionTypes)) {
|
|
44297
|
-
const legacyActionId = actionType["legacyActionId"];
|
|
44298
|
-
if (typeof legacyActionId === "string") {
|
|
44299
|
-
byLegacyId[legacyActionId] = actionType;
|
|
44300
|
-
}
|
|
44301
|
-
}
|
|
44302
|
-
return byLegacyId;
|
|
44303
|
-
}
|
|
44304
|
-
function getCatalogEntries(catalog) {
|
|
44305
|
-
return isPlainRecord(catalog.entries) ? catalog.entries : {};
|
|
44306
|
-
}
|
|
44307
|
-
|
|
44308
44237
|
// ../core/src/platform/registry/validation.ts
|
|
44309
44238
|
var RegistryValidationError = class extends Error {
|
|
44310
44239
|
constructor(orgName, resourceId, field2, message) {
|
|
@@ -44704,7 +44633,6 @@ function validateDeclaredSystemInterfaceReadiness(orgName, organizationModel) {
|
|
|
44704
44633
|
message: `System Interface "${path3}/${interfaceKey}" references unknown readiness profile "${readinessProfile}".`
|
|
44705
44634
|
});
|
|
44706
44635
|
}
|
|
44707
|
-
continue;
|
|
44708
44636
|
}
|
|
44709
44637
|
const result = computeInterfaceReadiness(model, { systemPath: path3, interfaceKey });
|
|
44710
44638
|
for (const issue2 of result.issues) {
|
|
@@ -46265,7 +46193,7 @@ function wrapAction(commandName, fn) {
|
|
|
46265
46193
|
// package.json
|
|
46266
46194
|
var package_default = {
|
|
46267
46195
|
name: "@elevasis/sdk",
|
|
46268
|
-
version: "1.
|
|
46196
|
+
version: "1.45.0",
|
|
46269
46197
|
description: "SDK for building Elevasis organization resources",
|
|
46270
46198
|
type: "module",
|
|
46271
46199
|
bin: {
|
|
@@ -46277,7 +46205,7 @@ var package_default = {
|
|
|
46277
46205
|
import: "./dist/index.js"
|
|
46278
46206
|
},
|
|
46279
46207
|
"./worker": {
|
|
46280
|
-
types: "./dist/
|
|
46208
|
+
types: "./dist/worker/index.d.ts",
|
|
46281
46209
|
import: "./dist/worker/index.js"
|
|
46282
46210
|
},
|
|
46283
46211
|
"./test-utils": {
|
|
@@ -46293,10 +46221,7 @@ var package_default = {
|
|
|
46293
46221
|
"dist/index.js",
|
|
46294
46222
|
"dist/index.d.ts",
|
|
46295
46223
|
"dist/worker/index.js",
|
|
46296
|
-
"dist/
|
|
46297
|
-
"dist/types/worker/platform.d.ts",
|
|
46298
|
-
"dist/types/worker/utils.d.ts",
|
|
46299
|
-
"dist/types/worker/adapters/",
|
|
46224
|
+
"dist/worker/index.d.ts",
|
|
46300
46225
|
"dist/test-utils/index.js",
|
|
46301
46226
|
"dist/test-utils/index.d.ts",
|
|
46302
46227
|
"dist/node/",
|
|
@@ -47154,7 +47079,7 @@ function registerExecCommand(program3) {
|
|
|
47154
47079
|
Example: elevasis-sdk exec my-workflow -i '{"key":"value"}'`).option("-i, --input <json>", "Input data as JSON string").option(
|
|
47155
47080
|
"-f, --input-file <path>",
|
|
47156
47081
|
"Read input from a JSON file (avoids shell escaping issues). Relative paths resolve against the project root."
|
|
47157
|
-
).option("--async", "Execute asynchronously with polling").option("--api-url <url>", "API URL").option(
|
|
47082
|
+
).option("--async", "Execute asynchronously with polling").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").option(
|
|
47158
47083
|
"--cleanup-input",
|
|
47159
47084
|
"Delete the input file after a successful execution (only files under <projectRoot>/tmp/ are eligible; files outside tmp/ produce a warning and are left untouched)"
|
|
47160
47085
|
).action(
|
|
@@ -47163,7 +47088,7 @@ function registerExecCommand(program3) {
|
|
|
47163
47088
|
async (resourceId, options) => {
|
|
47164
47089
|
const resolvedInputFile = options.inputFile ? resolveProjectRelative(options.inputFile) : void 0;
|
|
47165
47090
|
const input = resolvedInputFile ? JSON.parse((0, import_node_fs2.readFileSync)(resolvedInputFile, "utf8")) : options.input ? JSON.parse(options.input) : {};
|
|
47166
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
47091
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
47167
47092
|
const maybeCleanupInput = () => {
|
|
47168
47093
|
if (!options.cleanupInput || !resolvedInputFile) return;
|
|
47169
47094
|
const tmpDir = (0, import_node_path3.join)(getProjectRoot(), "tmp");
|
|
@@ -47249,8 +47174,8 @@ function getResourceType(resource) {
|
|
|
47249
47174
|
return resource.type ?? resource.resourceType;
|
|
47250
47175
|
}
|
|
47251
47176
|
function registerResourcesCommand(program3) {
|
|
47252
|
-
program3.command("resources").description("List deployed resources for your organization").option("--api-url <url>", "API URL").option("--json", "Output as JSON").action(wrapAction("resources", async (options) => {
|
|
47253
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
47177
|
+
program3.command("resources").description("List deployed resources for your organization").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").option("--json", "Output as JSON").action(wrapAction("resources", async (options) => {
|
|
47178
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
47254
47179
|
const spinner = ora("Fetching resources...").start();
|
|
47255
47180
|
const data = await apiGet(
|
|
47256
47181
|
"/api/external/resources",
|
|
@@ -47297,8 +47222,8 @@ function registerResourcesCommand(program3) {
|
|
|
47297
47222
|
init_source();
|
|
47298
47223
|
init_config();
|
|
47299
47224
|
function registerExecutionsCommand(program3) {
|
|
47300
|
-
program3.command("executions <resourceId>").description("List execution history for a resource\n Example: elevasis-sdk executions my-workflow --limit 10").option("--api-url <url>", "API URL").option("--json", "Output as JSON").option("--limit <number>", "Limit number of results (default: 50)").option("--status <status>", "Filter by status (running|completed|failed)").action(wrapAction("executions", async (resourceId, options) => {
|
|
47301
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
47225
|
+
program3.command("executions <resourceId>").description("List execution history for a resource\n Example: elevasis-sdk executions my-workflow --limit 10").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").option("--json", "Output as JSON").option("--limit <number>", "Limit number of results (default: 50)").option("--status <status>", "Filter by status (running|completed|failed)").action(wrapAction("executions", async (resourceId, options) => {
|
|
47226
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
47302
47227
|
const spinner = ora(`Fetching executions for ${resourceId}...`).start();
|
|
47303
47228
|
const params = new URLSearchParams();
|
|
47304
47229
|
if (options.limit) params.set("limit", options.limit);
|
|
@@ -47357,8 +47282,8 @@ function registerExecutionsCommand(program3) {
|
|
|
47357
47282
|
init_source();
|
|
47358
47283
|
init_config();
|
|
47359
47284
|
function registerExecutionCommand(program3) {
|
|
47360
|
-
program3.command("execution <resourceId> <executionId>").description("Get detailed information about a specific execution\n Example: elevasis-sdk execution my-workflow abc-123-uuid --logs-only").option("--api-url <url>", "API URL").option("--json", "Output raw JSON response").option("--logs-only", "Show only execution logs").option("--input", "Include input data in output").option("--result", "Include result data in output").action(wrapAction("execution", async (resourceId, executionId, options) => {
|
|
47361
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
47285
|
+
program3.command("execution <resourceId> <executionId>").description("Get detailed information about a specific execution\n Example: elevasis-sdk execution my-workflow abc-123-uuid --logs-only").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").option("--json", "Output raw JSON response").option("--logs-only", "Show only execution logs").option("--input", "Include input data in output").option("--result", "Include result data in output").action(wrapAction("execution", async (resourceId, executionId, options) => {
|
|
47286
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
47362
47287
|
const spinner = ora("Fetching execution details...").start();
|
|
47363
47288
|
const execution = await apiGet(
|
|
47364
47289
|
`/api/external/executions/${resourceId}/${executionId}`,
|
|
@@ -47457,12 +47382,99 @@ function displayLog(log) {
|
|
|
47457
47382
|
}
|
|
47458
47383
|
}
|
|
47459
47384
|
|
|
47385
|
+
// src/cli/commands/execution-cancel.ts
|
|
47386
|
+
init_source();
|
|
47387
|
+
init_config();
|
|
47388
|
+
function registerExecutionCancelCommand(program3) {
|
|
47389
|
+
program3.command("execution:cancel <resourceId> <executionId>").description(
|
|
47390
|
+
"Cancel a running execution\n Example: elevasis-sdk execution:cancel my-workflow 9c47c944-67eb-4c84-98cb-bb951d05ede3"
|
|
47391
|
+
).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output raw JSON response").action(
|
|
47392
|
+
wrapAction("execution:cancel", async (resourceId, executionId, options) => {
|
|
47393
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
47394
|
+
const spinner = options.json ? void 0 : ora("Cancelling execution...").start();
|
|
47395
|
+
let result;
|
|
47396
|
+
try {
|
|
47397
|
+
result = await apiPost(
|
|
47398
|
+
`/api/external/executions/${resourceId}/${executionId}/cancel`,
|
|
47399
|
+
{},
|
|
47400
|
+
apiUrl
|
|
47401
|
+
);
|
|
47402
|
+
} catch (error46) {
|
|
47403
|
+
spinner?.stop();
|
|
47404
|
+
const message = error46 instanceof Error ? error46.message : String(error46);
|
|
47405
|
+
if (message.includes("409") || message.includes("not running")) {
|
|
47406
|
+
console.error(source_default.yellow("Execution is not in a running state"));
|
|
47407
|
+
}
|
|
47408
|
+
throw error46;
|
|
47409
|
+
}
|
|
47410
|
+
spinner?.stop();
|
|
47411
|
+
if (options.json) {
|
|
47412
|
+
console.log(JSON.stringify(result, null, 2));
|
|
47413
|
+
return;
|
|
47414
|
+
}
|
|
47415
|
+
console.log(source_default.green("Execution cancelled"));
|
|
47416
|
+
console.log(source_default.gray(" Resource: ") + source_default.cyan(resourceId));
|
|
47417
|
+
console.log(source_default.gray(" Execution ID: ") + source_default.cyan(executionId));
|
|
47418
|
+
console.log(
|
|
47419
|
+
source_default.gray(" Method: ") + (result.method === "signal" ? "in-memory signal" : "database fallback")
|
|
47420
|
+
);
|
|
47421
|
+
})
|
|
47422
|
+
);
|
|
47423
|
+
}
|
|
47424
|
+
|
|
47425
|
+
// src/cli/commands/executions-delete.ts
|
|
47426
|
+
init_source();
|
|
47427
|
+
init_config();
|
|
47428
|
+
function registerExecutionsDeleteCommand(program3) {
|
|
47429
|
+
program3.command("executions:delete <resourceId>").description(
|
|
47430
|
+
"Delete a resource\u2019s execution history (destructive)\n Example: elevasis-sdk executions:delete my-workflow --force"
|
|
47431
|
+
).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--resource-status <status>", "Only delete runs from this deployment lane (dev|prod)").option("--force", "Skip the typed confirmation prompt").option("--json", "Output raw JSON response").action(
|
|
47432
|
+
wrapAction("executions:delete", async (resourceId, options) => {
|
|
47433
|
+
if (options.resourceStatus && options.resourceStatus !== "dev" && options.resourceStatus !== "prod") {
|
|
47434
|
+
throw new Error('--resource-status must be "dev" or "prod"');
|
|
47435
|
+
}
|
|
47436
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
47437
|
+
const lane = options.resourceStatus ? ` (${options.resourceStatus} only)` : "";
|
|
47438
|
+
if (!options.force) {
|
|
47439
|
+
if (options.json) {
|
|
47440
|
+
throw new Error("executions:delete requires --force when --json is set");
|
|
47441
|
+
}
|
|
47442
|
+
console.log(source_default.yellow(`This permanently deletes all execution history for ${resourceId}${lane}.`));
|
|
47443
|
+
const readline3 = await import("readline");
|
|
47444
|
+
const rl = readline3.createInterface({ input: process.stdin, output: process.stdout });
|
|
47445
|
+
const answer = await new Promise((resolve6) => {
|
|
47446
|
+
rl.question(source_default.yellow('Type "DELETE" to confirm: '), resolve6);
|
|
47447
|
+
});
|
|
47448
|
+
rl.close();
|
|
47449
|
+
if (answer !== "DELETE") {
|
|
47450
|
+
console.log(source_default.red("Deletion cancelled"));
|
|
47451
|
+
return;
|
|
47452
|
+
}
|
|
47453
|
+
}
|
|
47454
|
+
const params = new URLSearchParams();
|
|
47455
|
+
if (options.resourceStatus) params.set("resourceStatus", options.resourceStatus);
|
|
47456
|
+
const query = params.toString() ? `?${params.toString()}` : "";
|
|
47457
|
+
const spinner = options.json ? void 0 : ora("Deleting execution history...").start();
|
|
47458
|
+
const result = await apiDelete(
|
|
47459
|
+
`/api/external/executions/${resourceId}${query}`,
|
|
47460
|
+
apiUrl
|
|
47461
|
+
);
|
|
47462
|
+
spinner?.stop();
|
|
47463
|
+
if (options.json) {
|
|
47464
|
+
console.log(JSON.stringify(result, null, 2));
|
|
47465
|
+
return;
|
|
47466
|
+
}
|
|
47467
|
+
console.log(source_default.green(result.message));
|
|
47468
|
+
})
|
|
47469
|
+
);
|
|
47470
|
+
}
|
|
47471
|
+
|
|
47460
47472
|
// src/cli/commands/deployments.ts
|
|
47461
47473
|
init_source();
|
|
47462
47474
|
init_config();
|
|
47463
47475
|
function registerDeploymentsCommand(program3) {
|
|
47464
|
-
program3.command("deployments").description("List deployments for your organization").option("--api-url <url>", "API URL").option("--json", "Output as JSON").action(wrapAction("deployments", async (options) => {
|
|
47465
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
47476
|
+
program3.command("deployments").description("List deployments for your organization").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").option("--json", "Output as JSON").action(wrapAction("deployments", async (options) => {
|
|
47477
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
47466
47478
|
const spinner = ora("Fetching deployments...").start();
|
|
47467
47479
|
const data = await apiGet(
|
|
47468
47480
|
"/api/external/deployments",
|
|
@@ -47542,9 +47554,9 @@ function formatJsonSchema(schema, indent = 2) {
|
|
|
47542
47554
|
return JSON.stringify(schema, null, 2);
|
|
47543
47555
|
}
|
|
47544
47556
|
function registerDescribeCommand(program3) {
|
|
47545
|
-
program3.command("describe <resourceId>").description("Show resource definition (metadata + schemas)\n Example: elevasis-sdk describe my-workflow").option("--api-url <url>", "API URL").option("--json", "Output raw JSON response").action(
|
|
47557
|
+
program3.command("describe <resourceId>").description("Show resource definition (metadata + schemas)\n Example: elevasis-sdk describe my-workflow").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").option("--json", "Output raw JSON response").action(
|
|
47546
47558
|
wrapAction("describe", async (resourceId, options) => {
|
|
47547
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
47559
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
47548
47560
|
const spinner = ora("Fetching resource definition...").start();
|
|
47549
47561
|
const definition = await apiGet(
|
|
47550
47562
|
`/api/external/resources/${resourceId}/definition`,
|
|
@@ -47795,20 +47807,20 @@ Credential '${name}' deleted successfully.`));
|
|
|
47795
47807
|
// src/cli/commands/creds/creds.ts
|
|
47796
47808
|
function registerCredsCommand(program3) {
|
|
47797
47809
|
const creds = program3.command("creds").description("Manage organization credentials");
|
|
47798
|
-
creds.command("list").description("List all credentials (metadata only, no secrets)").option("--api-url <url>", "API URL").option("--json", "Output as JSON").action(wrapAction("creds list", async (options) => {
|
|
47799
|
-
await listCreds(resolveApiUrl(options.apiUrl), options.json);
|
|
47810
|
+
creds.command("list").description("List all credentials (metadata only, no secrets)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").option("--json", "Output as JSON").action(wrapAction("creds list", async (options) => {
|
|
47811
|
+
await listCreds(resolveApiUrl(options.apiUrl, options.prod), options.json);
|
|
47800
47812
|
}));
|
|
47801
|
-
creds.command("create").description("Create a new credential").requiredOption("--name <name>", "Credential name (lowercase, digits, hyphens)").requiredOption("--type <type>", "Credential type (api-key, webhook-secret)").option("--value <json>", "Credential value as JSON string").option("--api-url <url>", "API URL").action(wrapAction("creds create", async (options) => {
|
|
47802
|
-
await createCreds(resolveApiUrl(options.apiUrl), options.name, options.type, options.value);
|
|
47813
|
+
creds.command("create").description("Create a new credential").requiredOption("--name <name>", "Credential name (lowercase, digits, hyphens)").requiredOption("--type <type>", "Credential type (api-key, webhook-secret)").option("--value <json>", "Credential value as JSON string").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").action(wrapAction("creds create", async (options) => {
|
|
47814
|
+
await createCreds(resolveApiUrl(options.apiUrl, options.prod), options.name, options.type, options.value);
|
|
47803
47815
|
}));
|
|
47804
|
-
creds.command("update <name>").description("Update a credential value").requiredOption("--value <json>", "New credential value as JSON string").option("--api-url <url>", "API URL").action(wrapAction("creds update", async (name, options) => {
|
|
47805
|
-
await updateCreds(resolveApiUrl(options.apiUrl), name, options.value);
|
|
47816
|
+
creds.command("update <name>").description("Update a credential value").requiredOption("--value <json>", "New credential value as JSON string").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").action(wrapAction("creds update", async (name, options) => {
|
|
47817
|
+
await updateCreds(resolveApiUrl(options.apiUrl, options.prod), name, options.value);
|
|
47806
47818
|
}));
|
|
47807
|
-
creds.command("rename <name>").description("Rename a credential").requiredOption("--to <newName>", "New credential name").option("--api-url <url>", "API URL").action(wrapAction("creds rename", async (name, options) => {
|
|
47808
|
-
await renameCreds(resolveApiUrl(options.apiUrl), name, options.to);
|
|
47819
|
+
creds.command("rename <name>").description("Rename a credential").requiredOption("--to <newName>", "New credential name").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").action(wrapAction("creds rename", async (name, options) => {
|
|
47820
|
+
await renameCreds(resolveApiUrl(options.apiUrl, options.prod), name, options.to);
|
|
47809
47821
|
}));
|
|
47810
|
-
creds.command("delete <name>").description("Delete a credential").option("--force", "Skip confirmation prompt").option("--api-url <url>", "API URL").action(wrapAction("creds delete", async (name, options) => {
|
|
47811
|
-
await deleteCreds(resolveApiUrl(options.apiUrl), name, options.force);
|
|
47822
|
+
creds.command("delete <name>").description("Delete a credential").option("--force", "Skip confirmation prompt").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").action(wrapAction("creds delete", async (name, options) => {
|
|
47823
|
+
await deleteCreds(resolveApiUrl(options.apiUrl, options.prod), name, options.force);
|
|
47812
47824
|
}));
|
|
47813
47825
|
}
|
|
47814
47826
|
|
|
@@ -47839,14 +47851,14 @@ ${result.count} error(s) resolved for execution '${executionId}'.`));
|
|
|
47839
47851
|
// src/cli/commands/error/error.ts
|
|
47840
47852
|
function registerErrorCommand(program3) {
|
|
47841
47853
|
const error46 = program3.command("error").description("Manage execution errors");
|
|
47842
|
-
error46.command("resolve <errorId>").description("Mark a specific execution error as resolved").option("--api-url <url>", "API URL").action(
|
|
47854
|
+
error46.command("resolve <errorId>").description("Mark a specific execution error as resolved").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").action(
|
|
47843
47855
|
wrapAction("error resolve", async (errorId, options) => {
|
|
47844
|
-
await resolveError(resolveApiUrl(options.apiUrl), errorId);
|
|
47856
|
+
await resolveError(resolveApiUrl(options.apiUrl, options.prod), errorId);
|
|
47845
47857
|
})
|
|
47846
47858
|
);
|
|
47847
|
-
error46.command("resolve-execution <executionId>").description("Mark all errors for an execution as resolved").option("--api-url <url>", "API URL").action(
|
|
47859
|
+
error46.command("resolve-execution <executionId>").description("Mark all errors for an execution as resolved").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API URL").action(
|
|
47848
47860
|
wrapAction("error resolve-execution", async (executionId, options) => {
|
|
47849
|
-
await resolveErrorsByExecution(resolveApiUrl(options.apiUrl), executionId);
|
|
47861
|
+
await resolveErrorsByExecution(resolveApiUrl(options.apiUrl, options.prod), executionId);
|
|
47850
47862
|
})
|
|
47851
47863
|
);
|
|
47852
47864
|
}
|
|
@@ -47896,7 +47908,6 @@ init_source();
|
|
|
47896
47908
|
init_config();
|
|
47897
47909
|
|
|
47898
47910
|
// src/cli/commands/project/resolve-project.ts
|
|
47899
|
-
init_config();
|
|
47900
47911
|
function isUuid(value) {
|
|
47901
47912
|
return /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(value);
|
|
47902
47913
|
}
|
|
@@ -47906,12 +47917,11 @@ function normalize(value) {
|
|
|
47906
47917
|
function formatCandidates(projects) {
|
|
47907
47918
|
return projects.slice(0, 5).map((project) => `${project.name} (${project.id})`).join(", ");
|
|
47908
47919
|
}
|
|
47909
|
-
async function resolveProject(query,
|
|
47920
|
+
async function resolveProject(query, apiUrl) {
|
|
47910
47921
|
const trimmedQuery = query.trim();
|
|
47911
47922
|
if (!trimmedQuery) {
|
|
47912
47923
|
throw new Error("Project query is required");
|
|
47913
47924
|
}
|
|
47914
|
-
const apiUrl = resolveApiUrl(apiUrlOverride);
|
|
47915
47925
|
if (isUuid(trimmedQuery)) {
|
|
47916
47926
|
try {
|
|
47917
47927
|
const result2 = await apiGet(`/api/external/projects/${trimmedQuery}`, apiUrl);
|
|
@@ -48144,12 +48154,11 @@ function normalizeStr(value) {
|
|
|
48144
48154
|
function formatClientCandidates(clients) {
|
|
48145
48155
|
return clients.slice(0, 5).map((c) => `${c.name} (${c.id})`).join(", ");
|
|
48146
48156
|
}
|
|
48147
|
-
async function resolveClient(query,
|
|
48157
|
+
async function resolveClient(query, apiUrl) {
|
|
48148
48158
|
const trimmedQuery = query.trim();
|
|
48149
48159
|
if (!trimmedQuery) {
|
|
48150
48160
|
throw new Error("Client query is required");
|
|
48151
48161
|
}
|
|
48152
|
-
const apiUrl = resolveApiUrl(apiUrlOverride);
|
|
48153
48162
|
if (isUuid2(trimmedQuery)) {
|
|
48154
48163
|
try {
|
|
48155
48164
|
const result2 = await apiGet(`/api/external/clients/${trimmedQuery}`, apiUrl);
|
|
@@ -48195,11 +48204,11 @@ function endpointWithQuery(endpoint, params) {
|
|
|
48195
48204
|
return query ? `${endpoint}?${query}` : endpoint;
|
|
48196
48205
|
}
|
|
48197
48206
|
function registerClientList(program3) {
|
|
48198
|
-
program3.command("client:list").description("List clients\n Example: elevasis-sdk client:list --status active").option("--status <status>", "Filter by status: active | onboarding | paused | completed | churned").option("--search <query>", "Search by client name").option("--limit <limit>", "Maximum number of clients to return").option("--offset <offset>", "Number of clients to skip").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
48207
|
+
program3.command("client:list").description("List clients\n Example: elevasis-sdk client:list --status active").option("--status <status>", "Filter by status: active | onboarding | paused | completed | churned").option("--search <query>", "Search by client name").option("--limit <limit>", "Maximum number of clients to return").option("--offset <offset>", "Number of clients to skip").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
48199
48208
|
wrapAction(
|
|
48200
48209
|
"client:list",
|
|
48201
48210
|
async (options) => {
|
|
48202
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48211
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48203
48212
|
const params = new URLSearchParams();
|
|
48204
48213
|
appendQuery(params, "status", options.status);
|
|
48205
48214
|
appendQuery(params, "search", options.search);
|
|
@@ -48228,9 +48237,9 @@ Clients (${result.data.length} of ${result.total}):
|
|
|
48228
48237
|
);
|
|
48229
48238
|
}
|
|
48230
48239
|
function registerClientGet(program3) {
|
|
48231
|
-
program3.command("client:get <id>").description("Get a client by ID\n Example: elevasis-sdk client:get <uuid>").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
48240
|
+
program3.command("client:get <id>").description("Get a client by ID\n Example: elevasis-sdk client:get <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
48232
48241
|
wrapAction("client:get", async (id, options) => {
|
|
48233
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48242
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48234
48243
|
const result = await apiGet(`/api/external/clients/${id}`, apiUrl);
|
|
48235
48244
|
if (!options.pretty) {
|
|
48236
48245
|
printJson(result);
|
|
@@ -48247,9 +48256,9 @@ Client: ${result.name}`));
|
|
|
48247
48256
|
);
|
|
48248
48257
|
}
|
|
48249
48258
|
function registerClientStatus(program3) {
|
|
48250
|
-
program3.command("client:status").description("Show client portfolio status").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
48259
|
+
program3.command("client:status").description("Show client portfolio status").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
48251
48260
|
wrapAction("client:status", async (options) => {
|
|
48252
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48261
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48253
48262
|
const result = await apiGet("/api/external/clients/status", apiUrl);
|
|
48254
48263
|
if (!options.pretty) {
|
|
48255
48264
|
printJson(result);
|
|
@@ -48274,9 +48283,9 @@ function registerClientStatus(program3) {
|
|
|
48274
48283
|
function registerClientResolve(program3) {
|
|
48275
48284
|
program3.command("client:resolve <query>").description(
|
|
48276
48285
|
'Resolve a client ID from a name, UUID, or search query\n Example: elevasis-sdk client:resolve "Acme"'
|
|
48277
|
-
).option("--api-url <url>", "API base URL").option("--pretty", "Render client details instead of only the resolved ID").action(
|
|
48286
|
+
).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render client details instead of only the resolved ID").action(
|
|
48278
48287
|
wrapAction("client:resolve", async (query, options) => {
|
|
48279
|
-
const client = await resolveClient(query, options.apiUrl);
|
|
48288
|
+
const client = await resolveClient(query, resolveApiUrl(options.apiUrl, options.prod));
|
|
48280
48289
|
if (options.pretty) {
|
|
48281
48290
|
console.log(source_default.cyan(`
|
|
48282
48291
|
Resolved client: ${client.name}`));
|
|
@@ -48295,14 +48304,14 @@ function printJson2(value) {
|
|
|
48295
48304
|
console.log(JSON.stringify(value, null, 2));
|
|
48296
48305
|
}
|
|
48297
48306
|
function registerProjectList(program3) {
|
|
48298
|
-
program3.command("project:list").description("List projects\n Example: elevasis-sdk project:list --search alpha").option("--kind <kind>", "Filter by kind: client_engagement | internal | research | other").option("--status <status>", "Filter by status: active | on_track | at_risk | blocked | completed | paused").option("--search <query>", "Search by project name or description").option("--client <id-or-name>", "Filter by client hub record (UUID or fuzzy name)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48307
|
+
program3.command("project:list").description("List projects\n Example: elevasis-sdk project:list --search alpha").option("--kind <kind>", "Filter by kind: client_engagement | internal | research | other").option("--status <status>", "Filter by status: active | on_track | at_risk | blocked | completed | paused").option("--search <query>", "Search by project name or description").option("--client <id-or-name>", "Filter by client hub record (UUID or fuzzy name)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48299
48308
|
wrapAction(
|
|
48300
48309
|
"project:list",
|
|
48301
48310
|
async (options) => {
|
|
48302
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48311
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48303
48312
|
let clientId;
|
|
48304
48313
|
if (options.client) {
|
|
48305
|
-
const resolved = await resolveClient(options.client,
|
|
48314
|
+
const resolved = await resolveClient(options.client, apiUrl);
|
|
48306
48315
|
clientId = resolved.id;
|
|
48307
48316
|
}
|
|
48308
48317
|
const params = new URLSearchParams();
|
|
@@ -48342,9 +48351,9 @@ Projects (${projects.length}):
|
|
|
48342
48351
|
function registerProjectResolve(program3) {
|
|
48343
48352
|
program3.command("project:resolve <query>").description(
|
|
48344
48353
|
'Resolve a project ID from a name, UUID, or search query\n Example: elevasis-sdk project:resolve "Alpha"'
|
|
48345
|
-
).option("--api-url <url>", "API base URL").option("--pretty", "Render project details instead of only the resolved ID").option("--json", "Output as JSON").action(
|
|
48354
|
+
).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render project details instead of only the resolved ID").option("--json", "Output as JSON").action(
|
|
48346
48355
|
wrapAction("project:resolve", async (query, options) => {
|
|
48347
|
-
const project = await resolveProject(query, options.apiUrl);
|
|
48356
|
+
const project = await resolveProject(query, resolveApiUrl(options.apiUrl, options.prod));
|
|
48348
48357
|
if (options.json) {
|
|
48349
48358
|
printJson2(project);
|
|
48350
48359
|
return;
|
|
@@ -48366,10 +48375,10 @@ Resolved project: ${project.name}`));
|
|
|
48366
48375
|
function registerProjectWork(program3) {
|
|
48367
48376
|
program3.command("project:work <query>").alias("project:open").description(
|
|
48368
48377
|
'Resolve a project and print a lifecycle-aware work brief\n Example: elevasis-sdk project:work "Alpha"'
|
|
48369
|
-
).option("--api-url <url>", "API base URL").option("--json", "Render the structured work brief as JSON").action(
|
|
48378
|
+
).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Render the structured work brief as JSON").action(
|
|
48370
48379
|
wrapAction("project:work", async (query, options) => {
|
|
48371
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48372
|
-
const resolved = await resolveProject(query,
|
|
48380
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48381
|
+
const resolved = await resolveProject(query, apiUrl);
|
|
48373
48382
|
const [projectResult, notesResult] = await Promise.all([
|
|
48374
48383
|
apiGet(`/api/external/projects/${resolved.id}`, apiUrl),
|
|
48375
48384
|
apiGet(`/api/external/projects/${resolved.id}/notes`, apiUrl)
|
|
@@ -48386,9 +48395,9 @@ ${renderProjectWorkBrief(brief)}
|
|
|
48386
48395
|
);
|
|
48387
48396
|
}
|
|
48388
48397
|
function registerProjectGet(program3) {
|
|
48389
|
-
program3.command("project:get <id>").description("Get a project by ID\n Example: elevasis-sdk project:get <uuid>").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48398
|
+
program3.command("project:get <id>").description("Get a project by ID\n Example: elevasis-sdk project:get <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48390
48399
|
wrapAction("project:get", async (id, options) => {
|
|
48391
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48400
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48392
48401
|
const result = await apiGet(`/api/external/projects/${id}`, apiUrl);
|
|
48393
48402
|
if (options.json) {
|
|
48394
48403
|
printJson2(result);
|
|
@@ -48410,14 +48419,14 @@ Project: ${p.name}`));
|
|
|
48410
48419
|
);
|
|
48411
48420
|
}
|
|
48412
48421
|
function registerProjectCreate(program3) {
|
|
48413
|
-
program3.command("project:create").description('Create a new project\n Example: elevasis-sdk project:create --name "My Project" --kind internal').requiredOption("--name <name>", "Project name").requiredOption("--kind <kind>", "Project kind: client_engagement | internal | research | other").option("--status <status>", "Project status: active | on_track | at_risk | blocked | completed | paused").option("--description <description>", "Project description").option("--deal-id <uuid>", "Link to a deal (UUID)").option("--client <id-or-name>", "Link to a client hub record (UUID or fuzzy name)").option("--client-company-id <uuid>", "Link to a client company (UUID)").option("--start-date <date>", "Start date (ISO 8601, e.g. 2026-06-01)").option("--target-end-date <date>", "Target end date (ISO 8601, e.g. 2026-12-31)").option("--contract-value <amount>", "Contract value (number)", parseFloat).option("--metadata <json>", "Arbitrary metadata (JSON string)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48422
|
+
program3.command("project:create").description('Create a new project\n Example: elevasis-sdk project:create --name "My Project" --kind internal').requiredOption("--name <name>", "Project name").requiredOption("--kind <kind>", "Project kind: client_engagement | internal | research | other").option("--status <status>", "Project status: active | on_track | at_risk | blocked | completed | paused").option("--description <description>", "Project description").option("--deal-id <uuid>", "Link to a deal (UUID)").option("--client <id-or-name>", "Link to a client hub record (UUID or fuzzy name)").option("--client-company-id <uuid>", "Link to a client company (UUID)").option("--start-date <date>", "Start date (ISO 8601, e.g. 2026-06-01)").option("--target-end-date <date>", "Target end date (ISO 8601, e.g. 2026-12-31)").option("--contract-value <amount>", "Contract value (number)", parseFloat).option("--metadata <json>", "Arbitrary metadata (JSON string)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48414
48423
|
wrapAction(
|
|
48415
48424
|
"project:create",
|
|
48416
48425
|
async (options) => {
|
|
48417
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48426
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48418
48427
|
let clientId;
|
|
48419
48428
|
if (options.client) {
|
|
48420
|
-
const resolved = await resolveClient(options.client,
|
|
48429
|
+
const resolved = await resolveClient(options.client, apiUrl);
|
|
48421
48430
|
clientId = resolved.id;
|
|
48422
48431
|
}
|
|
48423
48432
|
const body = {
|
|
@@ -48454,7 +48463,7 @@ Project created: ${p.name}`));
|
|
|
48454
48463
|
);
|
|
48455
48464
|
}
|
|
48456
48465
|
function registerProjectUpdate(program3) {
|
|
48457
|
-
program3.command("project:update <id>").description("Update a project\n Example: elevasis-sdk project:update <uuid> --status completed").option("--name <name>", "New project name").option("--status <status>", "New status: active | on_track | at_risk | blocked | completed | paused").option("--description <description>", "New description").option("--deal-id <uuid>", "Link to a deal (UUID)").option("--client <id-or-name>", "Link to a client hub record (UUID or fuzzy name)").option("--clear-client", "Remove the client hub link (sets client_id to null)").option("--client-company-id <uuid>", "Link to a client company (UUID)").option("--start-date <date>", "Start date (ISO 8601, e.g. 2026-06-01)").option("--target-end-date <date>", "Target end date (ISO 8601, e.g. 2026-12-31)").option("--actual-end-date <date>", "Actual end date (ISO 8601)").option("--contract-value <amount>", "Contract value (number)", parseFloat).option("--metadata <json>", "Arbitrary metadata (JSON string)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48466
|
+
program3.command("project:update <id>").description("Update a project\n Example: elevasis-sdk project:update <uuid> --status completed").option("--name <name>", "New project name").option("--status <status>", "New status: active | on_track | at_risk | blocked | completed | paused").option("--description <description>", "New description").option("--deal-id <uuid>", "Link to a deal (UUID)").option("--client <id-or-name>", "Link to a client hub record (UUID or fuzzy name)").option("--clear-client", "Remove the client hub link (sets client_id to null)").option("--client-company-id <uuid>", "Link to a client company (UUID)").option("--start-date <date>", "Start date (ISO 8601, e.g. 2026-06-01)").option("--target-end-date <date>", "Target end date (ISO 8601, e.g. 2026-12-31)").option("--actual-end-date <date>", "Actual end date (ISO 8601)").option("--contract-value <amount>", "Contract value (number)", parseFloat).option("--metadata <json>", "Arbitrary metadata (JSON string)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48458
48467
|
wrapAction(
|
|
48459
48468
|
"project:update",
|
|
48460
48469
|
async (id, options) => {
|
|
@@ -48467,11 +48476,12 @@ function registerProjectUpdate(program3) {
|
|
|
48467
48476
|
);
|
|
48468
48477
|
process.exit(1);
|
|
48469
48478
|
}
|
|
48479
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48470
48480
|
let clientId;
|
|
48471
48481
|
if (options.clearClient) {
|
|
48472
48482
|
clientId = null;
|
|
48473
48483
|
} else if (options.client) {
|
|
48474
|
-
const resolved = await resolveClient(options.client,
|
|
48484
|
+
const resolved = await resolveClient(options.client, apiUrl);
|
|
48475
48485
|
clientId = resolved.id;
|
|
48476
48486
|
}
|
|
48477
48487
|
const body = {};
|
|
@@ -48495,7 +48505,6 @@ function registerProjectUpdate(program3) {
|
|
|
48495
48505
|
);
|
|
48496
48506
|
process.exit(1);
|
|
48497
48507
|
}
|
|
48498
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48499
48508
|
const result = await apiPatch(`/api/external/projects/${id}`, body, apiUrl);
|
|
48500
48509
|
if (options.json) {
|
|
48501
48510
|
printJson2(result);
|
|
@@ -48515,9 +48524,9 @@ Project updated: ${p.name}`));
|
|
|
48515
48524
|
);
|
|
48516
48525
|
}
|
|
48517
48526
|
function registerProjectDelete(program3) {
|
|
48518
|
-
program3.command("project:delete <id>").description("Delete a project\n Example: elevasis-sdk project:delete <uuid>").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48527
|
+
program3.command("project:delete <id>").description("Delete a project\n Example: elevasis-sdk project:delete <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48519
48528
|
wrapAction("project:delete", async (id, options) => {
|
|
48520
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48529
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48521
48530
|
const result = await apiDelete(`/api/external/projects/${id}`, apiUrl);
|
|
48522
48531
|
if (options.json) {
|
|
48523
48532
|
printJson2(result);
|
|
@@ -48561,9 +48570,9 @@ function parseChecklistOption(options) {
|
|
|
48561
48570
|
}
|
|
48562
48571
|
}
|
|
48563
48572
|
function registerMilestoneList(program3) {
|
|
48564
|
-
program3.command("project:milestone:list").description("List milestones for a project\n Example: elevasis-sdk project:milestone:list --project <uuid>").requiredOption("--project <project-id>", "Project ID (UUID)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48573
|
+
program3.command("project:milestone:list").description("List milestones for a project\n Example: elevasis-sdk project:milestone:list --project <uuid>").requiredOption("--project <project-id>", "Project ID (UUID)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48565
48574
|
wrapAction("project:milestone:list", async (options) => {
|
|
48566
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48575
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48567
48576
|
const result = await apiGet(`/api/external/projects/${options.project}/milestones`, apiUrl);
|
|
48568
48577
|
if (options.json) {
|
|
48569
48578
|
printJson3(result);
|
|
@@ -48593,7 +48602,7 @@ Milestones (${milestones.length}):
|
|
|
48593
48602
|
function registerMilestoneCreate(program3) {
|
|
48594
48603
|
program3.command("project:milestone:create").description(
|
|
48595
48604
|
'Create a milestone\n Example: elevasis-sdk project:milestone:create --project <uuid> --name "Phase 1"'
|
|
48596
|
-
).requiredOption("--project <project-id>", "Project ID (UUID)").requiredOption("--name <name>", "Milestone name").option("--status <status>", "Status: upcoming | in_progress | completed | overdue | blocked").option("--due-date <date>", "Due date (ISO 8601, e.g. 2026-06-01)").option("--description <description>", "Milestone description").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48605
|
+
).requiredOption("--project <project-id>", "Project ID (UUID)").requiredOption("--name <name>", "Milestone name").option("--status <status>", "Status: upcoming | in_progress | completed | overdue | blocked").option("--due-date <date>", "Due date (ISO 8601, e.g. 2026-06-01)").option("--description <description>", "Milestone description").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48597
48606
|
wrapAction(
|
|
48598
48607
|
"project:milestone:create",
|
|
48599
48608
|
async (options) => {
|
|
@@ -48601,7 +48610,7 @@ function registerMilestoneCreate(program3) {
|
|
|
48601
48610
|
if (options.status) body.status = options.status;
|
|
48602
48611
|
if (options.dueDate) body.due_date = options.dueDate;
|
|
48603
48612
|
if (options.description) body.description = options.description;
|
|
48604
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48613
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48605
48614
|
const result = await apiPost(
|
|
48606
48615
|
`/api/external/projects/${options.project}/milestones`,
|
|
48607
48616
|
body,
|
|
@@ -48630,7 +48639,7 @@ function registerMilestoneUpdate(program3) {
|
|
|
48630
48639
|
program3.command("project:milestone:update <id>").description("Update a milestone\n Example: elevasis-sdk project:milestone:update <uuid> --status completed").option("--name <name>", "New milestone name").option("--status <status>", "New status: upcoming | in_progress | completed | overdue | blocked").option("--description <description>", "New description").option("--due-date <date>", "New due date (ISO 8601)").option("--checklist <json>", `Replace checklist (full array): '[{"id":"1","label":"Step","completed":false}]'`).option(
|
|
48631
48640
|
"--checklist-file <path>",
|
|
48632
48641
|
"Read replacement checklist from a JSON file. Relative paths resolve against the project root."
|
|
48633
|
-
).option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48642
|
+
).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48634
48643
|
wrapAction(
|
|
48635
48644
|
"project:milestone:update",
|
|
48636
48645
|
async (id, options) => {
|
|
@@ -48650,7 +48659,7 @@ function registerMilestoneUpdate(program3) {
|
|
|
48650
48659
|
);
|
|
48651
48660
|
process.exit(1);
|
|
48652
48661
|
}
|
|
48653
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48662
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48654
48663
|
const result = await apiPatch(`/api/external/milestones/${id}`, body, apiUrl);
|
|
48655
48664
|
if (options.json) {
|
|
48656
48665
|
printJson3(result);
|
|
@@ -48670,9 +48679,9 @@ Milestone updated: ${m.name}`));
|
|
|
48670
48679
|
);
|
|
48671
48680
|
}
|
|
48672
48681
|
function registerMilestoneDelete(program3) {
|
|
48673
|
-
program3.command("project:milestone:delete <id>").description("Delete a milestone\n Example: elevasis-sdk project:milestone:delete <uuid>").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48682
|
+
program3.command("project:milestone:delete <id>").description("Delete a milestone\n Example: elevasis-sdk project:milestone:delete <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48674
48683
|
wrapAction("project:milestone:delete", async (id, options) => {
|
|
48675
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48684
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48676
48685
|
const result = await apiDelete(`/api/external/milestones/${id}`, apiUrl);
|
|
48677
48686
|
if (options.json) {
|
|
48678
48687
|
printJson3(result);
|
|
@@ -48721,11 +48730,11 @@ function registerTaskList(program3) {
|
|
|
48721
48730
|
).requiredOption("--project <project-id>", "Project ID (UUID)").option(
|
|
48722
48731
|
"--status <status>",
|
|
48723
48732
|
"Filter by status: planned | in_progress | blocked | completed | cancelled | submitted | approved | rejected | revision_requested"
|
|
48724
|
-
).option("--milestone <milestone-id>", "Filter by milestone ID (UUID)").option("--parent <parent-task-id>", "Filter by parent task ID (UUID)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48733
|
+
).option("--milestone <milestone-id>", "Filter by milestone ID (UUID)").option("--parent <parent-task-id>", "Filter by parent task ID (UUID)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48725
48734
|
wrapAction(
|
|
48726
48735
|
"project:task:list",
|
|
48727
48736
|
async (options) => {
|
|
48728
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48737
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48729
48738
|
const params = new URLSearchParams();
|
|
48730
48739
|
if (options.status) params.set("status", options.status);
|
|
48731
48740
|
if (options.milestone) params.set("milestone_id", options.milestone);
|
|
@@ -48760,9 +48769,9 @@ Tasks (${tasks.length}):
|
|
|
48760
48769
|
);
|
|
48761
48770
|
}
|
|
48762
48771
|
function registerTaskGet(program3) {
|
|
48763
|
-
program3.command("project:task:get <id>").description("Get a task by ID\n Example: elevasis-sdk project:task:get <uuid>").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48772
|
+
program3.command("project:task:get <id>").description("Get a task by ID\n Example: elevasis-sdk project:task:get <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48764
48773
|
wrapAction("project:task:get", async (id, options) => {
|
|
48765
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48774
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48766
48775
|
const result = await apiGet(`/api/external/project-tasks/${id}`, apiUrl);
|
|
48767
48776
|
if (options.json) {
|
|
48768
48777
|
printJson4(result);
|
|
@@ -48793,7 +48802,7 @@ function registerTaskCreate(program3) {
|
|
|
48793
48802
|
).option("--milestone <milestone-id>", "Milestone ID (UUID)").option("--parent <parent-task-id>", "Parent task ID (UUID) for subtasks").option("--description <description>", "Task description").option("--checklist <json>", `Checklist items as JSON array: '[{"id":"1","label":"Step","completed":false}]'`).option(
|
|
48794
48803
|
"--checklist-file <path>",
|
|
48795
48804
|
"Read checklist items from a JSON file. Relative paths resolve against the project root."
|
|
48796
|
-
).option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48805
|
+
).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48797
48806
|
wrapAction(
|
|
48798
48807
|
"project:task:create",
|
|
48799
48808
|
async (options) => {
|
|
@@ -48808,7 +48817,7 @@ function registerTaskCreate(program3) {
|
|
|
48808
48817
|
if (options.description) body.description = options.description;
|
|
48809
48818
|
const checklist = parseChecklistOption2(options);
|
|
48810
48819
|
if (checklist !== void 0) body.checklist = checklist;
|
|
48811
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48820
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48812
48821
|
const result = await apiPost("/api/external/project-tasks", body, apiUrl);
|
|
48813
48822
|
if (!options.milestone) {
|
|
48814
48823
|
process.stderr.write(
|
|
@@ -48842,7 +48851,7 @@ function registerTaskUpdate(program3) {
|
|
|
48842
48851
|
).option("--milestone <milestone-id>", "New milestone ID (UUID)").option("--description <description>", "New description").option("--checklist <json>", `Replace checklist (full array): '[{"id":"1","label":"Step","completed":false}]'`).option(
|
|
48843
48852
|
"--checklist-file <path>",
|
|
48844
48853
|
"Read replacement checklist from a JSON file. Relative paths resolve against the project root."
|
|
48845
|
-
).option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48854
|
+
).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48846
48855
|
wrapAction(
|
|
48847
48856
|
"project:task:update",
|
|
48848
48857
|
async (id, options) => {
|
|
@@ -48862,7 +48871,7 @@ function registerTaskUpdate(program3) {
|
|
|
48862
48871
|
);
|
|
48863
48872
|
process.exit(1);
|
|
48864
48873
|
}
|
|
48865
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48874
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48866
48875
|
const result = await apiPatch(`/api/external/project-tasks/${id}`, body, apiUrl);
|
|
48867
48876
|
if (options.json) {
|
|
48868
48877
|
printJson4(result);
|
|
@@ -48882,9 +48891,9 @@ Task updated: ${t.name}`));
|
|
|
48882
48891
|
);
|
|
48883
48892
|
}
|
|
48884
48893
|
function registerTaskDelete(program3) {
|
|
48885
|
-
program3.command("project:task:delete <id>").description("Delete a task\n Example: elevasis-sdk project:task:delete <uuid>").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48894
|
+
program3.command("project:task:delete <id>").description("Delete a task\n Example: elevasis-sdk project:task:delete <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48886
48895
|
wrapAction("project:task:delete", async (id, options) => {
|
|
48887
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48896
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48888
48897
|
const result = await apiDelete(`/api/external/project-tasks/${id}`, apiUrl);
|
|
48889
48898
|
if (options.json) {
|
|
48890
48899
|
printJson4(result);
|
|
@@ -48903,9 +48912,9 @@ Task ${id} deleted.`));
|
|
|
48903
48912
|
function registerTaskResume(program3) {
|
|
48904
48913
|
program3.command("project:task:resume <id>").description(
|
|
48905
48914
|
"Fetch the resume_context JSONB for a task (used by /work resume)\n Example: elevasis-sdk project:task:resume <uuid>"
|
|
48906
|
-
).option("--api-url <url>", "API base URL").option("--pretty", "Render a human-readable resume briefing instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48915
|
+
).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render a human-readable resume briefing instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48907
48916
|
wrapAction("project:task:resume", async (id, options) => {
|
|
48908
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48917
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48909
48918
|
const result = await apiGet(`/api/external/project-tasks/${id}`, apiUrl);
|
|
48910
48919
|
const task = result.task;
|
|
48911
48920
|
const ctx = task.resume_context ?? {};
|
|
@@ -48956,7 +48965,7 @@ function registerTaskSave(program3) {
|
|
|
48956
48965
|
program3.command("project:task:save <id>").description(
|
|
48957
48966
|
`Merge fields into resume_context for a task (used by /work save)
|
|
48958
48967
|
Example: elevasis-sdk project:task:save <uuid> --current-state "Implemented X" --files-modified '["src/foo.ts"]'`
|
|
48959
|
-
).requiredOption("--current-state <text>", "Current state description").option("--files-modified <json>", "JSON array of modified file paths").option("--next-steps <text>", "Next steps description").option("--key-docs <json>", "JSON array of key doc paths").option("--tools <json>", "JSON array of tool names used").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48968
|
+
).requiredOption("--current-state <text>", "Current state description").option("--files-modified <json>", "JSON array of modified file paths").option("--next-steps <text>", "Next steps description").option("--key-docs <json>", "JSON array of key doc paths").option("--tools <json>", "JSON array of tool names used").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
48960
48969
|
wrapAction(
|
|
48961
48970
|
"project:task:save",
|
|
48962
48971
|
async (id, options) => {
|
|
@@ -48996,7 +49005,7 @@ function registerTaskSave(program3) {
|
|
|
48996
49005
|
process.exit(1);
|
|
48997
49006
|
}
|
|
48998
49007
|
}
|
|
48999
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
49008
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
49000
49009
|
const result = await apiPatch(`/api/external/project-tasks/${id}/resume-context`, body, apiUrl);
|
|
49001
49010
|
if (options.json) {
|
|
49002
49011
|
printJson4(result);
|
|
@@ -49185,9 +49194,9 @@ function printJson5(value) {
|
|
|
49185
49194
|
}
|
|
49186
49195
|
var NOTE_TYPE_HELP = NoteTypeSchema.options.join(" | ");
|
|
49187
49196
|
function registerNoteList(program3) {
|
|
49188
|
-
program3.command("project:note:list").description("List notes for a project\n Example: elevasis-sdk project:note:list --project <uuid>").requiredOption("--project <project-id>", "Project ID (UUID)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
49197
|
+
program3.command("project:note:list").description("List notes for a project\n Example: elevasis-sdk project:note:list --project <uuid>").requiredOption("--project <project-id>", "Project ID (UUID)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
49189
49198
|
wrapAction("project:note:list", async (options) => {
|
|
49190
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
49199
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
49191
49200
|
const result = await apiGet(`/api/external/projects/${options.project}/notes`, apiUrl);
|
|
49192
49201
|
if (options.json) {
|
|
49193
49202
|
printJson5(result);
|
|
@@ -49217,7 +49226,7 @@ Notes (${notes.length}):
|
|
|
49217
49226
|
function registerNoteCreate(program3) {
|
|
49218
49227
|
program3.command("project:note:create").description(
|
|
49219
49228
|
'Create a note\n Example: elevasis-sdk project:note:create --project <uuid> --content "Status update"'
|
|
49220
|
-
).requiredOption("--project <project-id>", "Project ID (UUID)").requiredOption("--content <content>", "Note content").option("--task <task-id>", "Attach to a task (UUID)").option("--milestone <milestone-id>", "Attach to a milestone (UUID)").option("--type <type>", `Note type: ${NOTE_TYPE_HELP}`).option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
49229
|
+
).requiredOption("--project <project-id>", "Project ID (UUID)").requiredOption("--content <content>", "Note content").option("--task <task-id>", "Attach to a task (UUID)").option("--milestone <milestone-id>", "Attach to a milestone (UUID)").option("--type <type>", `Note type: ${NOTE_TYPE_HELP}`).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
49221
49230
|
wrapAction(
|
|
49222
49231
|
"project:note:create",
|
|
49223
49232
|
async (options) => {
|
|
@@ -49228,7 +49237,7 @@ function registerNoteCreate(program3) {
|
|
|
49228
49237
|
if (options.task) body.task_id = options.task;
|
|
49229
49238
|
if (options.milestone) body.milestone_id = options.milestone;
|
|
49230
49239
|
if (options.type) body.type = options.type;
|
|
49231
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
49240
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
49232
49241
|
const result = await apiPost("/api/external/project-notes", body, apiUrl);
|
|
49233
49242
|
if (options.json) {
|
|
49234
49243
|
printJson5(result);
|
|
@@ -49249,9 +49258,9 @@ Note created`));
|
|
|
49249
49258
|
);
|
|
49250
49259
|
}
|
|
49251
49260
|
function registerNoteUpdate(program3) {
|
|
49252
|
-
program3.command("project:note:update <id>").description('Update a note\n Example: elevasis-sdk project:note:update <uuid> --content "Updated content"').requiredOption("--content <content>", "New note content").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
49261
|
+
program3.command("project:note:update <id>").description('Update a note\n Example: elevasis-sdk project:note:update <uuid> --content "Updated content"').requiredOption("--content <content>", "New note content").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
49253
49262
|
wrapAction("project:note:update", async (id, options) => {
|
|
49254
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
49263
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
49255
49264
|
const result = await apiPatch(
|
|
49256
49265
|
`/api/external/project-notes/${id}`,
|
|
49257
49266
|
{ content: options.content },
|
|
@@ -49272,9 +49281,9 @@ Note ${id} updated.`));
|
|
|
49272
49281
|
);
|
|
49273
49282
|
}
|
|
49274
49283
|
function registerNoteDelete(program3) {
|
|
49275
|
-
program3.command("project:note:delete <id>").description("Delete a note\n Example: elevasis-sdk project:note:delete <uuid>").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
49284
|
+
program3.command("project:note:delete <id>").description("Delete a note\n Example: elevasis-sdk project:note:delete <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option("--json", "Output as JSON").action(
|
|
49276
49285
|
wrapAction("project:note:delete", async (id, options) => {
|
|
49277
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
49286
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
49278
49287
|
const result = await apiDelete(`/api/external/project-notes/${id}`, apiUrl);
|
|
49279
49288
|
if (options.json) {
|
|
49280
49289
|
printJson5(result);
|
|
@@ -51206,7 +51215,7 @@ function registerRequestCommands(program3) {
|
|
|
51206
51215
|
).option("-i, --input <json>", "Request body as JSON string").option(
|
|
51207
51216
|
"-f, --input-file <path>",
|
|
51208
51217
|
"Read request body from a JSON file (e.g. request-report.json, avoids shell escaping). Relative paths resolve against the project root."
|
|
51209
|
-
).option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option(
|
|
51218
|
+
).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").option(
|
|
51210
51219
|
"--cleanup-input",
|
|
51211
51220
|
"Delete the input file after a successful submission (only files under <projectRoot>/tmp/ are eligible; files outside tmp/ produce a warning and are left untouched)"
|
|
51212
51221
|
).action(
|
|
@@ -51222,7 +51231,7 @@ function registerRequestCommands(program3) {
|
|
|
51222
51231
|
throw new Error(`Invalid request body:
|
|
51223
51232
|
${issues}`);
|
|
51224
51233
|
}
|
|
51225
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51234
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51226
51235
|
const result = await apiPost("/api/external/requests", parsed.data, apiUrl);
|
|
51227
51236
|
if (options.pretty) {
|
|
51228
51237
|
const r = result.request;
|
|
@@ -51256,7 +51265,7 @@ ${issues}`);
|
|
|
51256
51265
|
Example: elevasis-sdk request:list --status open --severity critical
|
|
51257
51266
|
status: ${REQUEST_STATUS_HELP}
|
|
51258
51267
|
severity: ${REQUEST_SEVERITY_HELP}`
|
|
51259
|
-
).option("--status <status>", `Filter by status (${REQUEST_STATUS_HELP})`).option("--severity <severity>", `Filter by severity (${REQUEST_SEVERITY_HELP})`).option("--project-id <uuid>", "Filter by project id").option("--limit <n>", "Max rows to return (1-200, default 50)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51268
|
+
).option("--status <status>", `Filter by status (${REQUEST_STATUS_HELP})`).option("--severity <severity>", `Filter by severity (${REQUEST_SEVERITY_HELP})`).option("--project-id <uuid>", "Filter by project id").option("--limit <n>", "Max rows to return (1-200, default 50)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51260
51269
|
wrapAction("request:list", async (options) => {
|
|
51261
51270
|
const params = new URLSearchParams();
|
|
51262
51271
|
if (options.status) params.set("status", options.status);
|
|
@@ -51264,7 +51273,7 @@ ${issues}`);
|
|
|
51264
51273
|
if (options.projectId) params.set("project_id", options.projectId);
|
|
51265
51274
|
if (options.limit) params.set("limit", options.limit);
|
|
51266
51275
|
const qs = params.toString();
|
|
51267
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51276
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51268
51277
|
const result = await apiGet(`/api/external/requests${qs ? `?${qs}` : ""}`, apiUrl);
|
|
51269
51278
|
if (options.pretty) {
|
|
51270
51279
|
const rows = result.requests;
|
|
@@ -51285,9 +51294,9 @@ ${rows.length} request${rows.length === 1 ? "" : "s"}`));
|
|
|
51285
51294
|
);
|
|
51286
51295
|
program3.command("request:get <id>").description(
|
|
51287
51296
|
"Get a reported request by id via GET /api/external/requests/:id\n Example: elevasis-sdk request:get 1a2b3c4d-5e6f-7890-abcd-ef1234567890"
|
|
51288
|
-
).option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51297
|
+
).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51289
51298
|
wrapAction("request:get", async (id, options) => {
|
|
51290
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51299
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51291
51300
|
const result = await apiGet(`/api/external/requests/${encodeURIComponent(id)}`, apiUrl);
|
|
51292
51301
|
if (options.pretty) {
|
|
51293
51302
|
const r = result.request;
|
|
@@ -51467,7 +51476,7 @@ function verbose(detail) {
|
|
|
51467
51476
|
console.log(source_default.gray(` ${detail}`));
|
|
51468
51477
|
}
|
|
51469
51478
|
function registerDoctorCommand(program3) {
|
|
51470
|
-
program3.command("doctor").description("Check that your Elevasis project is correctly configured\n Example: elevasis-sdk doctor [--verbose]").option("--verbose", "Print full paths, response bodies, and error details for each check").action(async (options) => {
|
|
51479
|
+
program3.command("doctor").description("Check that your Elevasis project is correctly configured\n Example: elevasis-sdk doctor [--verbose]").option("--verbose", "Print full paths, response bodies, and error details for each check").option("--prod", "Report against production (overrides NODE_ENV=development)").action(async (options) => {
|
|
51471
51480
|
const isVerbose = Boolean(options.verbose);
|
|
51472
51481
|
let failCount = 0;
|
|
51473
51482
|
console.log(source_default.cyan("Running Elevasis SDK doctor checks\u2026\n"));
|
|
@@ -51500,7 +51509,7 @@ function registerDoctorCommand(program3) {
|
|
|
51500
51509
|
}
|
|
51501
51510
|
ok(".env", `Found at ${envPath2}`);
|
|
51502
51511
|
if (isVerbose) verbose(`Path: ${envPath2}`);
|
|
51503
|
-
const apiKey = resolveApiKey();
|
|
51512
|
+
const apiKey = resolveApiKey(options.prod);
|
|
51504
51513
|
if (!apiKey) {
|
|
51505
51514
|
fail("API key", "ELEVASIS_PLATFORM_KEY not set or empty.");
|
|
51506
51515
|
if (isVerbose) verbose("Checked process.env.ELEVASIS_PLATFORM_KEY \u2014 not set or empty string");
|
|
@@ -51510,7 +51519,7 @@ function registerDoctorCommand(program3) {
|
|
|
51510
51519
|
}
|
|
51511
51520
|
ok("API key", `Set (length: ${apiKey.length})`);
|
|
51512
51521
|
if (isVerbose) verbose(`Key prefix: ${apiKey.slice(0, 6)}\u2026`);
|
|
51513
|
-
const apiUrl = resolveApiUrl();
|
|
51522
|
+
const apiUrl = resolveApiUrl(void 0, options.prod);
|
|
51514
51523
|
const healthUrl = `${apiUrl}/api/external/health`;
|
|
51515
51524
|
let healthBody;
|
|
51516
51525
|
let healthStatus;
|
|
@@ -51624,11 +51633,11 @@ function dealListId(deal) {
|
|
|
51624
51633
|
return deal.sourceListId ?? deal.source_list_id ?? null;
|
|
51625
51634
|
}
|
|
51626
51635
|
function registerAcquisitionDealList(program3) {
|
|
51627
|
-
program3.command("acquisition:deal:list").description("List acquisition deals\n Example: elevasis-sdk acquisition:deal:list --stage discovery").option("--stage <stage>", "Filter by CRM stage").option("--list <id>", "Filter by source acquisition list ID").option("--batch <batch>", "Filter by source batch ID").option("--stale-since <datetime>", "Filter to deals stale since an ISO datetime").option("--search <query>", "Search by contact, company, or deal label").option("--limit <limit>", "Maximum number of deals to return").option("--offset <offset>", "Number of deals to skip").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51636
|
+
program3.command("acquisition:deal:list").description("List acquisition deals\n Example: elevasis-sdk acquisition:deal:list --stage discovery").option("--stage <stage>", "Filter by CRM stage").option("--list <id>", "Filter by source acquisition list ID").option("--batch <batch>", "Filter by source batch ID").option("--stale-since <datetime>", "Filter to deals stale since an ISO datetime").option("--search <query>", "Search by contact, company, or deal label").option("--limit <limit>", "Maximum number of deals to return").option("--offset <offset>", "Number of deals to skip").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51628
51637
|
wrapAction(
|
|
51629
51638
|
"acquisition:deal:list",
|
|
51630
51639
|
async (options) => {
|
|
51631
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51640
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51632
51641
|
const params = new URLSearchParams();
|
|
51633
51642
|
appendQuery2(params, "stage", options.stage);
|
|
51634
51643
|
appendQuery2(params, "list", options.list);
|
|
@@ -51662,9 +51671,9 @@ Acquisition deals (${result.data.length} of ${result.total}):
|
|
|
51662
51671
|
);
|
|
51663
51672
|
}
|
|
51664
51673
|
function registerAcquisitionDealGet(program3) {
|
|
51665
|
-
program3.command("acquisition:deal:get <id>").description("Get an acquisition deal by ID\n Example: elevasis-sdk acquisition:deal:get <uuid>").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51674
|
+
program3.command("acquisition:deal:get <id>").description("Get an acquisition deal by ID\n Example: elevasis-sdk acquisition:deal:get <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51666
51675
|
wrapAction("acquisition:deal:get", async (id, options) => {
|
|
51667
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51676
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51668
51677
|
const result = await apiGet("/api/external/deals/" + id, apiUrl);
|
|
51669
51678
|
if (!options.pretty) {
|
|
51670
51679
|
printJson6(result);
|
|
@@ -51684,9 +51693,9 @@ Acquisition deal: ${dealEmail(result)}`));
|
|
|
51684
51693
|
);
|
|
51685
51694
|
}
|
|
51686
51695
|
function registerAcquisitionDealStatus(program3) {
|
|
51687
|
-
program3.command("acquisition:deal:status").description("Show CRM funnel status for acquisition deals").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51696
|
+
program3.command("acquisition:deal:status").description("Show CRM funnel status for acquisition deals").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51688
51697
|
wrapAction("acquisition:deal:status", async (options) => {
|
|
51689
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51698
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51690
51699
|
const result = await apiGet("/api/external/deals/summary", apiUrl);
|
|
51691
51700
|
if (!options.pretty) {
|
|
51692
51701
|
printJson6(result);
|
|
@@ -51731,11 +51740,11 @@ function renderListSummary(list) {
|
|
|
51731
51740
|
if (list.description) console.log(source_default.gray(` ${list.description}`));
|
|
51732
51741
|
}
|
|
51733
51742
|
function registerAcquisitionListList(program3) {
|
|
51734
|
-
program3.command("acquisition:list:list").description("List acquisition lists\n Example: elevasis-sdk acquisition:list:list --status launched").option("--status <status>", "Filter by status: draft | enriching | launched | closing | archived").option("--batch <batch>", "Filter by batch ID").option("--vertical <vertical>", "Filter by scraping vertical").option("--limit <limit>", "Maximum number of lists to return").option("--offset <offset>", "Number of lists to skip").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51743
|
+
program3.command("acquisition:list:list").description("List acquisition lists\n Example: elevasis-sdk acquisition:list:list --status launched").option("--status <status>", "Filter by status: draft | enriching | launched | closing | archived").option("--batch <batch>", "Filter by batch ID").option("--vertical <vertical>", "Filter by scraping vertical").option("--limit <limit>", "Maximum number of lists to return").option("--offset <offset>", "Number of lists to skip").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51735
51744
|
wrapAction(
|
|
51736
51745
|
"acquisition:list:list",
|
|
51737
51746
|
async (options) => {
|
|
51738
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51747
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51739
51748
|
const params = new URLSearchParams();
|
|
51740
51749
|
appendQuery3(params, "status", options.status);
|
|
51741
51750
|
appendQuery3(params, "batch", options.batch);
|
|
@@ -51764,11 +51773,11 @@ Acquisition lists (${result.length}):
|
|
|
51764
51773
|
);
|
|
51765
51774
|
}
|
|
51766
51775
|
function registerAcquisitionListGet(program3) {
|
|
51767
|
-
program3.command("acquisition:list:get <id>").description("Get an acquisition list by ID\n Example: elevasis-sdk acquisition:list:get <uuid>").option("--no-include-deals", "Exclude thin deal lineage refs").option("--deal-limit <limit>", "Maximum number of thin deal refs to include").option("--include-progress", "Include processing progress aggregates").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51776
|
+
program3.command("acquisition:list:get <id>").description("Get an acquisition list by ID\n Example: elevasis-sdk acquisition:list:get <uuid>").option("--no-include-deals", "Exclude thin deal lineage refs").option("--deal-limit <limit>", "Maximum number of thin deal refs to include").option("--include-progress", "Include processing progress aggregates").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51768
51777
|
wrapAction(
|
|
51769
51778
|
"acquisition:list:get",
|
|
51770
51779
|
async (id, options) => {
|
|
51771
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51780
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51772
51781
|
const params = new URLSearchParams();
|
|
51773
51782
|
if (options.includeDeals === false) appendQuery3(params, "includeDeals", false);
|
|
51774
51783
|
appendQuery3(params, "dealLimit", options.dealLimit);
|
|
@@ -51795,9 +51804,9 @@ Acquisition list: ${result.name}`));
|
|
|
51795
51804
|
);
|
|
51796
51805
|
}
|
|
51797
51806
|
function registerAcquisitionListStatus(program3) {
|
|
51798
|
-
program3.command("acquisition:list:status").description("Show portfolio status across acquisition lists").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51807
|
+
program3.command("acquisition:list:status").description("Show portfolio status across acquisition lists").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51799
51808
|
wrapAction("acquisition:list:status", async (options) => {
|
|
51800
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51809
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51801
51810
|
const result = await apiGet("/api/external/acquisition/lists/status", apiUrl);
|
|
51802
51811
|
if (!options.pretty) {
|
|
51803
51812
|
printJson7(result);
|
|
@@ -51831,11 +51840,11 @@ function registerAcquisitionCommands(program3) {
|
|
|
51831
51840
|
init_source();
|
|
51832
51841
|
init_config();
|
|
51833
51842
|
function registerClientCreate(program3) {
|
|
51834
|
-
program3.command("client:create").description('Create a new client\n Example: elevasis-sdk client:create --name "Acme Corp"').requiredOption("--name <name>", "Client name").option("--status <status>", "Client status: active | onboarding | paused | completed | churned").option("--source <source>", "Client source (for example: acquisition | word_of_mouth)").option("--source-deal-id <uuid>", "UUID of the source deal").option("--primary-company-id <uuid>", "UUID of the primary company").option("--primary-contact-id <uuid>", "UUID of the primary contact").option("--metadata <json>", "Arbitrary metadata (JSON string)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51843
|
+
program3.command("client:create").description('Create a new client\n Example: elevasis-sdk client:create --name "Acme Corp"').requiredOption("--name <name>", "Client name").option("--status <status>", "Client status: active | onboarding | paused | completed | churned").option("--source <source>", "Client source (for example: acquisition | word_of_mouth)").option("--source-deal-id <uuid>", "UUID of the source deal").option("--primary-company-id <uuid>", "UUID of the primary company").option("--primary-contact-id <uuid>", "UUID of the primary contact").option("--metadata <json>", "Arbitrary metadata (JSON string)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51835
51844
|
wrapAction(
|
|
51836
51845
|
"client:create",
|
|
51837
51846
|
async (options) => {
|
|
51838
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51847
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51839
51848
|
const body = { name: options.name };
|
|
51840
51849
|
if (options.status !== void 0) body.status = options.status;
|
|
51841
51850
|
if (options.source !== void 0) body.source = options.source;
|
|
@@ -51858,7 +51867,7 @@ Client created: ${result.name}`));
|
|
|
51858
51867
|
);
|
|
51859
51868
|
}
|
|
51860
51869
|
function registerClientUpdate(program3) {
|
|
51861
|
-
program3.command("client:update <id>").description("Update a client\n Example: elevasis-sdk client:update <uuid> --status active").option("--name <name>", "New client name").option("--status <status>", "New status: active | onboarding | paused | completed | churned").option("--source <source>", "Set client source (for example: acquisition | word_of_mouth)").option("--source-deal-id <uuid>", "Set source deal (UUID)").option("--clear-source-deal", "Remove the source deal link (sets sourceDealId to null)").option("--primary-company-id <uuid>", "Set primary company (UUID)").option("--clear-primary-company", "Remove the primary company link (sets primaryCompanyId to null)").option("--primary-contact-id <uuid>", "Set primary contact (UUID)").option("--clear-primary-contact", "Remove the primary contact link (sets primaryContactId to null)").option("--metadata <json>", "Arbitrary metadata (JSON string)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51870
|
+
program3.command("client:update <id>").description("Update a client\n Example: elevasis-sdk client:update <uuid> --status active").option("--name <name>", "New client name").option("--status <status>", "New status: active | onboarding | paused | completed | churned").option("--source <source>", "Set client source (for example: acquisition | word_of_mouth)").option("--source-deal-id <uuid>", "Set source deal (UUID)").option("--clear-source-deal", "Remove the source deal link (sets sourceDealId to null)").option("--primary-company-id <uuid>", "Set primary company (UUID)").option("--clear-primary-company", "Remove the primary company link (sets primaryCompanyId to null)").option("--primary-contact-id <uuid>", "Set primary contact (UUID)").option("--clear-primary-contact", "Remove the primary contact link (sets primaryContactId to null)").option("--metadata <json>", "Arbitrary metadata (JSON string)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51862
51871
|
wrapAction(
|
|
51863
51872
|
"client:update",
|
|
51864
51873
|
async (id, options) => {
|
|
@@ -51889,7 +51898,8 @@ function registerClientUpdate(program3) {
|
|
|
51889
51898
|
);
|
|
51890
51899
|
process.exit(1);
|
|
51891
51900
|
}
|
|
51892
|
-
const
|
|
51901
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51902
|
+
const client = await resolveClient(id, apiUrl);
|
|
51893
51903
|
const body = {};
|
|
51894
51904
|
if (options.name !== void 0) body.name = options.name;
|
|
51895
51905
|
if (options.status !== void 0) body.status = options.status;
|
|
@@ -51919,7 +51929,6 @@ function registerClientUpdate(program3) {
|
|
|
51919
51929
|
);
|
|
51920
51930
|
process.exit(1);
|
|
51921
51931
|
}
|
|
51922
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51923
51932
|
const result = await apiPatch(`/api/external/clients/${client.id}`, body, apiUrl);
|
|
51924
51933
|
if (options.pretty) {
|
|
51925
51934
|
console.log(source_default.green(`
|
|
@@ -51935,10 +51944,10 @@ Client updated: ${result.name}`));
|
|
|
51935
51944
|
);
|
|
51936
51945
|
}
|
|
51937
51946
|
function registerClientDelete(program3) {
|
|
51938
|
-
program3.command("client:delete <id>").description("Delete a client\n Example: elevasis-sdk client:delete <uuid>").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51947
|
+
program3.command("client:delete <id>").description("Delete a client\n Example: elevasis-sdk client:delete <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51939
51948
|
wrapAction("client:delete", async (id, options) => {
|
|
51940
|
-
const
|
|
51941
|
-
const
|
|
51949
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51950
|
+
const client = await resolveClient(id, apiUrl);
|
|
51942
51951
|
await apiDelete(`/api/external/clients/${client.id}`, apiUrl);
|
|
51943
51952
|
if (options.pretty) {
|
|
51944
51953
|
console.log(source_default.green(`
|
|
@@ -51988,11 +51997,11 @@ function taskTitle(task) {
|
|
|
51988
51997
|
return task.description || task.humanCheckpoint || task.id;
|
|
51989
51998
|
}
|
|
51990
51999
|
function registerQueueList(program3) {
|
|
51991
|
-
program3.command("queue:list").description("List HITL command queue tasks\n Example: elevasis-sdk queue:list --status pending --pretty").option("--status <status>", "Filter by status: pending | processing | completed | failed | expired").option("--human-checkpoint <id>", 'Filter by checkpoint ID, or "ungrouped" for tasks without a checkpoint').option("--time-range <range>", "Filter by created time range: 1h | 24h | 7d | 30d").option("--priority-min <number>", "Minimum priority, 1-10").option("--priority-max <number>", "Maximum priority, 1-10").option("--limit <limit>", "Maximum number of tasks to return").option("--offset <offset>", "Number of tasks to skip").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52000
|
+
program3.command("queue:list").description("List HITL command queue tasks\n Example: elevasis-sdk queue:list --status pending --pretty").option("--status <status>", "Filter by status: pending | processing | completed | failed | expired").option("--human-checkpoint <id>", 'Filter by checkpoint ID, or "ungrouped" for tasks without a checkpoint').option("--time-range <range>", "Filter by created time range: 1h | 24h | 7d | 30d").option("--priority-min <number>", "Minimum priority, 1-10").option("--priority-max <number>", "Maximum priority, 1-10").option("--limit <limit>", "Maximum number of tasks to return").option("--offset <offset>", "Number of tasks to skip").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
51992
52001
|
wrapAction(
|
|
51993
52002
|
"queue:list",
|
|
51994
52003
|
async (options) => {
|
|
51995
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52004
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51996
52005
|
const params = new URLSearchParams();
|
|
51997
52006
|
appendQuery4(params, "status", options.status);
|
|
51998
52007
|
appendQuery4(params, "humanCheckpoint", options.humanCheckpoint);
|
|
@@ -52029,9 +52038,9 @@ Queue tasks (${result.tasks.length} of ${result.total}):
|
|
|
52029
52038
|
);
|
|
52030
52039
|
}
|
|
52031
52040
|
function registerQueueGet(program3) {
|
|
52032
|
-
program3.command("queue:get <id>").description("Get a HITL command queue task\n Example: elevasis-sdk queue:get <uuid>").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52041
|
+
program3.command("queue:get <id>").description("Get a HITL command queue task\n Example: elevasis-sdk queue:get <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52033
52042
|
wrapAction("queue:get", async (id, options) => {
|
|
52034
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52043
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52035
52044
|
const result = await apiGet(`/api/external/command-queue/${id}`, apiUrl);
|
|
52036
52045
|
if (!options.pretty) {
|
|
52037
52046
|
printJson8(result);
|
|
@@ -52052,11 +52061,11 @@ Queue task: ${taskTitle(task)}`));
|
|
|
52052
52061
|
function registerQueueSelect(program3) {
|
|
52053
52062
|
program3.command("queue:select <id>").description(
|
|
52054
52063
|
"Select and execute a HITL queue action\n Example: elevasis-sdk queue:select <uuid> --action-id approve"
|
|
52055
|
-
).requiredOption("--action-id <id>", "Action ID to select").option("--payload <json>", "Optional action payload as JSON").option("--notes <notes>", "Optional human decision notes").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52064
|
+
).requiredOption("--action-id <id>", "Action ID to select").option("--payload <json>", "Optional action payload as JSON").option("--notes <notes>", "Optional human decision notes").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52056
52065
|
wrapAction(
|
|
52057
52066
|
"queue:select",
|
|
52058
52067
|
async (id, options) => {
|
|
52059
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52068
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52060
52069
|
const body = { actionId: options.actionId };
|
|
52061
52070
|
const payload = parseJsonOption(options.payload, "--payload");
|
|
52062
52071
|
if (payload !== void 0) body.payload = payload;
|
|
@@ -52079,9 +52088,9 @@ Selected action ${options.actionId} for queue task ${id}.`));
|
|
|
52079
52088
|
);
|
|
52080
52089
|
}
|
|
52081
52090
|
function registerQueueExpire(program3) {
|
|
52082
|
-
program3.command("queue:expire <id>").description("Mark a HITL queue task as expired\n Example: elevasis-sdk queue:expire <uuid>").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52091
|
+
program3.command("queue:expire <id>").description("Mark a HITL queue task as expired\n Example: elevasis-sdk queue:expire <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52083
52092
|
wrapAction("queue:expire", async (id, options) => {
|
|
52084
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52093
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52085
52094
|
const result = await apiPatch(
|
|
52086
52095
|
`/api/external/command-queue/${id}`,
|
|
52087
52096
|
{ status: "expired" },
|
|
@@ -52099,11 +52108,11 @@ Expired queue task ${id}.`));
|
|
|
52099
52108
|
);
|
|
52100
52109
|
}
|
|
52101
52110
|
function registerQueueStatus(program3) {
|
|
52102
|
-
program3.command("queue:status").description("Show HITL queue checkpoint and status counts").option("--time-range <range>", "Filter by created time range: 1h | 24h | 7d | 30d").option("--priority-min <number>", "Minimum priority, 1-10").option("--priority-max <number>", "Maximum priority, 1-10").option("--status <status>", "Filter checkpoint totals by status: pending | completed | expired").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52111
|
+
program3.command("queue:status").description("Show HITL queue checkpoint and status counts").option("--time-range <range>", "Filter by created time range: 1h | 24h | 7d | 30d").option("--priority-min <number>", "Minimum priority, 1-10").option("--priority-max <number>", "Maximum priority, 1-10").option("--status <status>", "Filter checkpoint totals by status: pending | completed | expired").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52103
52112
|
wrapAction(
|
|
52104
52113
|
"queue:status",
|
|
52105
52114
|
async (options) => {
|
|
52106
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52115
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52107
52116
|
const params = new URLSearchParams();
|
|
52108
52117
|
appendQuery4(params, "timeRange", options.timeRange);
|
|
52109
52118
|
appendQuery4(params, "priorityMin", options.priorityMin);
|
|
@@ -52178,11 +52187,11 @@ function printSchedule(schedule) {
|
|
|
52178
52187
|
if (schedule.nextRunAt) console.log(source_default.gray(` Next: ${new Date(schedule.nextRunAt).toLocaleString()}`));
|
|
52179
52188
|
}
|
|
52180
52189
|
function registerScheduleList(program3) {
|
|
52181
|
-
program3.command("schedule:list").description("List task schedules\n Example: elevasis-sdk schedule:list --status active --pretty").option("--status <status>", "Filter by status: active | paused | completed | cancelled").option("--target-resource-type <type>", "Filter by target resource type: agent | workflow").option("--target-resource-id <id>", "Filter by target resource ID").option("--limit <limit>", "Maximum number of schedules to return").option("--offset <offset>", "Number of schedules to skip").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52190
|
+
program3.command("schedule:list").description("List task schedules\n Example: elevasis-sdk schedule:list --status active --pretty").option("--status <status>", "Filter by status: active | paused | completed | cancelled").option("--target-resource-type <type>", "Filter by target resource type: agent | workflow").option("--target-resource-id <id>", "Filter by target resource ID").option("--limit <limit>", "Maximum number of schedules to return").option("--offset <offset>", "Number of schedules to skip").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52182
52191
|
wrapAction(
|
|
52183
52192
|
"schedule:list",
|
|
52184
52193
|
async (options) => {
|
|
52185
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52194
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52186
52195
|
const params = new URLSearchParams();
|
|
52187
52196
|
appendQuery5(params, "status", options.status);
|
|
52188
52197
|
appendQuery5(params, "targetResourceType", options.targetResourceType);
|
|
@@ -52213,9 +52222,9 @@ Schedules (${result.schedules.length} of ${result.total}):
|
|
|
52213
52222
|
);
|
|
52214
52223
|
}
|
|
52215
52224
|
function registerScheduleGet(program3) {
|
|
52216
|
-
program3.command("schedule:get <id>").description("Get a task schedule\n Example: elevasis-sdk schedule:get <uuid>").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52225
|
+
program3.command("schedule:get <id>").description("Get a task schedule\n Example: elevasis-sdk schedule:get <uuid>").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52217
52226
|
wrapAction("schedule:get", async (id, options) => {
|
|
52218
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52227
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52219
52228
|
const result = await apiGet(
|
|
52220
52229
|
`/api/external/task-scheduler/schedules/${id}`,
|
|
52221
52230
|
apiUrl
|
|
@@ -52242,11 +52251,11 @@ function registerScheduleCreate(program3) {
|
|
|
52242
52251
|
program3.command("schedule:create").description(
|
|
52243
52252
|
`Create a task schedule
|
|
52244
52253
|
Example: elevasis-sdk schedule:create --name "Weekly report" --target-resource-type workflow --target-resource-id weekly-report --schedule-config '{"type":"recurring","interval":"weekly","time":"09:00","timezone":"America/New_York","payload":{}}'`
|
|
52245
|
-
).requiredOption("--name <name>", "Schedule name").option("--description <description>", "Schedule description").requiredOption("--target-resource-type <type>", "Target resource type: agent | workflow").requiredOption("--target-resource-id <id>", "Target resource ID").requiredOption("--schedule-config <json>", "Schedule config JSON").option("--max-retries <number>", "Maximum retry attempts, 0-10").option("--idempotency-key <key>", "Idempotency key").option("--origin-execution-id <uuid>", "Origin execution UUID").option("--origin-resource-type <type>", "Origin resource type").option("--origin-resource-id <id>", "Origin resource ID").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52254
|
+
).requiredOption("--name <name>", "Schedule name").option("--description <description>", "Schedule description").requiredOption("--target-resource-type <type>", "Target resource type: agent | workflow").requiredOption("--target-resource-id <id>", "Target resource ID").requiredOption("--schedule-config <json>", "Schedule config JSON").option("--max-retries <number>", "Maximum retry attempts, 0-10").option("--idempotency-key <key>", "Idempotency key").option("--origin-execution-id <uuid>", "Origin execution UUID").option("--origin-resource-type <type>", "Origin resource type").option("--origin-resource-id <id>", "Origin resource ID").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52246
52255
|
wrapAction(
|
|
52247
52256
|
"schedule:create",
|
|
52248
52257
|
async (options) => {
|
|
52249
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52258
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52250
52259
|
const scheduleConfig = parseJsonOption2(options.scheduleConfig, "--schedule-config");
|
|
52251
52260
|
if (scheduleConfig === void 0) throw new Error("--schedule-config is required");
|
|
52252
52261
|
const body = {
|
|
@@ -52284,7 +52293,7 @@ Schedule created: ${result.schedule.name}`));
|
|
|
52284
52293
|
);
|
|
52285
52294
|
}
|
|
52286
52295
|
function registerScheduleUpdate(program3) {
|
|
52287
|
-
program3.command("schedule:update <id>").description('Update a task schedule\n Example: elevasis-sdk schedule:update <uuid> --name "New name"').option("--name <name>", "New schedule name").option("--description <description>", "New schedule description").option("--clear-description", "Remove the schedule description").option("--schedule-config <json>", "Replacement schedule config JSON").option("--max-retries <number>", "Maximum retry attempts, 0-10").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52296
|
+
program3.command("schedule:update <id>").description('Update a task schedule\n Example: elevasis-sdk schedule:update <uuid> --name "New name"').option("--name <name>", "New schedule name").option("--description <description>", "New schedule description").option("--clear-description", "Remove the schedule description").option("--schedule-config <json>", "Replacement schedule config JSON").option("--max-retries <number>", "Maximum retry attempts, 0-10").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52288
52297
|
wrapAction(
|
|
52289
52298
|
"schedule:update",
|
|
52290
52299
|
async (id, options) => {
|
|
@@ -52316,7 +52325,7 @@ function registerScheduleUpdate(program3) {
|
|
|
52316
52325
|
);
|
|
52317
52326
|
process.exit(1);
|
|
52318
52327
|
}
|
|
52319
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52328
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52320
52329
|
const result = await apiPatch(
|
|
52321
52330
|
`/api/external/task-scheduler/schedules/${id}`,
|
|
52322
52331
|
body,
|
|
@@ -52337,9 +52346,9 @@ Schedule updated: ${result.schedule.name}`));
|
|
|
52337
52346
|
}
|
|
52338
52347
|
function registerScheduleStatusMutation(program3, commandName, description) {
|
|
52339
52348
|
program3.command(`schedule:${commandName} <id>`).description(`${description}
|
|
52340
|
-
Example: elevasis-sdk schedule:${commandName} <uuid>`).option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52349
|
+
Example: elevasis-sdk schedule:${commandName} <uuid>`).option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52341
52350
|
wrapAction(`schedule:${commandName}`, async (id, options) => {
|
|
52342
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52351
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52343
52352
|
const result = await apiPost(
|
|
52344
52353
|
`/api/external/task-scheduler/schedules/${id}/${commandName}`,
|
|
52345
52354
|
{},
|
|
@@ -52386,7 +52395,7 @@ var PRIORITY_HELP = "low | normal | high | urgent";
|
|
|
52386
52395
|
function registerNoteCreate2(program3) {
|
|
52387
52396
|
program3.command("note:create").description(
|
|
52388
52397
|
'Create a personal note for a user\n Example: elevasis-sdk note:create --content "Deal X stalled" --user agent@example.com'
|
|
52389
|
-
).requiredOption("--content <text>", "Note content").option("--user <email>", "Target user email (default: API key owner)").option("--title <text>", "Optional note title").option("--priority <priority>", `Priority: ${PRIORITY_HELP}`).option("--pinned", "Pin the note to the top of the panel").option("--source <id>", "Source identifier (e.g. workflow or agent ID)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52398
|
+
).requiredOption("--content <text>", "Note content").option("--user <email>", "Target user email (default: API key owner)").option("--title <text>", "Optional note title").option("--priority <priority>", `Priority: ${PRIORITY_HELP}`).option("--pinned", "Pin the note to the top of the panel").option("--source <id>", "Source identifier (e.g. workflow or agent ID)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52390
52399
|
wrapAction(
|
|
52391
52400
|
"note:create",
|
|
52392
52401
|
async (options) => {
|
|
@@ -52398,7 +52407,7 @@ function registerNoteCreate2(program3) {
|
|
|
52398
52407
|
if (options.priority) body.priority = options.priority;
|
|
52399
52408
|
if (options.pinned) body.pinned = true;
|
|
52400
52409
|
if (options.source) body.source = options.source;
|
|
52401
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52410
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52402
52411
|
const result = await apiPost("/api/external/user-notes", body, apiUrl);
|
|
52403
52412
|
if (options.pretty) {
|
|
52404
52413
|
const n = result.note;
|
|
@@ -52416,7 +52425,7 @@ Note created`));
|
|
|
52416
52425
|
);
|
|
52417
52426
|
}
|
|
52418
52427
|
function registerNoteList2(program3) {
|
|
52419
|
-
program3.command("note:list").description("List notes for a user\n Example: elevasis-sdk note:list --user agent@example.com").requiredOption("--user <email>", "User email to list notes for (required by the external API)").option("--priority <priority>", `Filter by priority: ${PRIORITY_HELP}`).option("--pinned", "Return only pinned notes").option("--limit <n>", "Maximum number of results").option("--offset <n>", "Pagination offset").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52428
|
+
program3.command("note:list").description("List notes for a user\n Example: elevasis-sdk note:list --user agent@example.com").requiredOption("--user <email>", "User email to list notes for (required by the external API)").option("--priority <priority>", `Filter by priority: ${PRIORITY_HELP}`).option("--pinned", "Return only pinned notes").option("--limit <n>", "Maximum number of results").option("--offset <n>", "Pagination offset").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--pretty", "Render human-readable output instead of raw JSON").action(
|
|
52420
52429
|
wrapAction(
|
|
52421
52430
|
"note:list",
|
|
52422
52431
|
async (options) => {
|
|
@@ -52426,7 +52435,7 @@ function registerNoteList2(program3) {
|
|
|
52426
52435
|
if (options.pinned) params.set("pinned", "true");
|
|
52427
52436
|
if (options.limit) params.set("limit", options.limit);
|
|
52428
52437
|
if (options.offset) params.set("offset", options.offset);
|
|
52429
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52438
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52430
52439
|
const result = await apiGet(`/api/external/user-notes?${params.toString()}`, apiUrl);
|
|
52431
52440
|
if (options.pretty) {
|
|
52432
52441
|
const notes = result.notes;
|
|
@@ -52467,9 +52476,9 @@ function printJson10(value) {
|
|
|
52467
52476
|
console.log(JSON.stringify(value, null, 2));
|
|
52468
52477
|
}
|
|
52469
52478
|
function registerAgentList(program3) {
|
|
52470
|
-
program3.command("agent:list").description("List deployed agents for your organization").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52479
|
+
program3.command("agent:list").description("List deployed agents for your organization").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52471
52480
|
wrapAction("agent:list", async (options) => {
|
|
52472
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52481
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52473
52482
|
const result = await apiGet("/api/external/resources", apiUrl);
|
|
52474
52483
|
const agents = result.resources.filter((resource) => getResourceType2(resource) === "agent");
|
|
52475
52484
|
if (options.json) {
|
|
@@ -52496,9 +52505,9 @@ function registerAgentList(program3) {
|
|
|
52496
52505
|
);
|
|
52497
52506
|
}
|
|
52498
52507
|
function registerAgentGet(program3) {
|
|
52499
|
-
program3.command("agent:get <id>").description("Get full agent metadata and organization model linkage").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52508
|
+
program3.command("agent:get <id>").description("Get full agent metadata and organization model linkage").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52500
52509
|
wrapAction("agent:get", async (id, options) => {
|
|
52501
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52510
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52502
52511
|
const definition = await apiGet(`/api/external/resources/${id}/definition`, apiUrl);
|
|
52503
52512
|
if (options.json) {
|
|
52504
52513
|
printJson10(definition);
|
|
@@ -52635,9 +52644,9 @@ function printMessage(message) {
|
|
|
52635
52644
|
}
|
|
52636
52645
|
}
|
|
52637
52646
|
function registerSessionCreate(program3) {
|
|
52638
|
-
program3.command("session:create <resourceId>").description("Create a multi-turn agent session").option("--user-id <id>", "User ID for the session").option("--metadata <json>", "Session metadata as JSON").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52647
|
+
program3.command("session:create <resourceId>").description("Create a multi-turn agent session").option("--user-id <id>", "User ID for the session").option("--metadata <json>", "Session metadata as JSON").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52639
52648
|
wrapAction("session:create", async (resourceId, options) => {
|
|
52640
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52649
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52641
52650
|
const body = { resourceId };
|
|
52642
52651
|
if (options.userId) body.userId = options.userId;
|
|
52643
52652
|
if (options.metadata) body.metadata = parseJson(options.metadata, "--metadata");
|
|
@@ -52654,9 +52663,9 @@ function registerSessionCreate(program3) {
|
|
|
52654
52663
|
);
|
|
52655
52664
|
}
|
|
52656
52665
|
function registerSessionList(program3) {
|
|
52657
|
-
program3.command("session:list").description("List multi-turn agent sessions").option("--resource-id <id>", "Filter by agent resource ID").option("--user-id <id>", "Filter by user ID").option("--limit <limit>", "Maximum number of sessions to return").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52666
|
+
program3.command("session:list").description("List multi-turn agent sessions").option("--resource-id <id>", "Filter by agent resource ID").option("--user-id <id>", "Filter by user ID").option("--limit <limit>", "Maximum number of sessions to return").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52658
52667
|
wrapAction("session:list", async (options) => {
|
|
52659
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52668
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52660
52669
|
const params = new URLSearchParams();
|
|
52661
52670
|
appendQuery6(params, "resourceId", options.resourceId);
|
|
52662
52671
|
appendQuery6(params, "userId", options.userId);
|
|
@@ -52684,9 +52693,9 @@ function registerSessionList(program3) {
|
|
|
52684
52693
|
);
|
|
52685
52694
|
}
|
|
52686
52695
|
function registerSessionGet(program3) {
|
|
52687
|
-
program3.command("session:get <id>").description("Get session details").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52696
|
+
program3.command("session:get <id>").description("Get session details").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52688
52697
|
wrapAction("session:get", async (id, options) => {
|
|
52689
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52698
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52690
52699
|
const session = await apiGet(`/api/external/sessions/${id}`, apiUrl);
|
|
52691
52700
|
if (options.json) {
|
|
52692
52701
|
printJson11(session);
|
|
@@ -52705,9 +52714,9 @@ function registerSessionGet(program3) {
|
|
|
52705
52714
|
);
|
|
52706
52715
|
}
|
|
52707
52716
|
function registerSessionTurn(program3) {
|
|
52708
|
-
program3.command("session:turn <id>").description("Execute a turn in an active agent session").option("-i, --input <json>", "Turn input as JSON").option("-f, --input-file <path>", "Read turn input from a JSON file").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52717
|
+
program3.command("session:turn <id>").description("Execute a turn in an active agent session").option("-i, --input <json>", "Turn input as JSON").option("-f, --input-file <path>", "Read turn input from a JSON file").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52709
52718
|
wrapAction("session:turn", async (id, options) => {
|
|
52710
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52719
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52711
52720
|
const input = resolveTurnInput(options);
|
|
52712
52721
|
const result = await apiPost(`/api/external/sessions/${id}/turns`, { input }, apiUrl);
|
|
52713
52722
|
if (options.json) {
|
|
@@ -52738,9 +52747,9 @@ function registerSessionTurn(program3) {
|
|
|
52738
52747
|
);
|
|
52739
52748
|
}
|
|
52740
52749
|
function registerSessionMessages(program3) {
|
|
52741
|
-
program3.command("session:messages <id>").description("Export session transcript messages").option("--limit <limit>", "Messages per API page").option("--cursor <cursor>", "Message_index cursor to start after").option("--page", "Fetch one API page instead of the full transcript").option("--all", "Fetch all pages (default)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52750
|
+
program3.command("session:messages <id>").description("Export session transcript messages").option("--limit <limit>", "Messages per API page").option("--cursor <cursor>", "Message_index cursor to start after").option("--page", "Fetch one API page instead of the full transcript").option("--all", "Fetch all pages (default)").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52742
52751
|
wrapAction("session:messages", async (id, options) => {
|
|
52743
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52752
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52744
52753
|
const result = await fetchSessionMessages(id, apiUrl, options);
|
|
52745
52754
|
if (options.json) {
|
|
52746
52755
|
printJson11(result);
|
|
@@ -52760,9 +52769,9 @@ function registerSessionMessages(program3) {
|
|
|
52760
52769
|
);
|
|
52761
52770
|
}
|
|
52762
52771
|
function registerSessionEnd(program3) {
|
|
52763
|
-
program3.command("session:end <id>").description("End an active agent session").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52772
|
+
program3.command("session:end <id>").description("End an active agent session").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52764
52773
|
wrapAction("session:end", async (id, options) => {
|
|
52765
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52774
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52766
52775
|
const result = await apiPost(
|
|
52767
52776
|
`/api/external/sessions/${id}/end`,
|
|
52768
52777
|
{},
|
|
@@ -52854,9 +52863,9 @@ function printGrant(grant) {
|
|
|
52854
52863
|
if (grant.disabledAt) console.log(source_default.gray(` Disabled: ${new Date(grant.disabledAt).toLocaleString()}`));
|
|
52855
52864
|
}
|
|
52856
52865
|
function registerGrantList(program3) {
|
|
52857
|
-
program3.command("grant:list").description("List public/code-gated agent access grants").option("--resource-id <id>", "Filter by agent resource ID").option("--include-disabled", "Include disabled grants").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52866
|
+
program3.command("grant:list").description("List public/code-gated agent access grants").option("--resource-id <id>", "Filter by agent resource ID").option("--include-disabled", "Include disabled grants").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52858
52867
|
wrapAction("grant:list", async (options) => {
|
|
52859
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52868
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52860
52869
|
const params = new URLSearchParams();
|
|
52861
52870
|
appendQuery7(params, "resourceId", options.resourceId);
|
|
52862
52871
|
appendQuery7(params, "includeDisabled", options.includeDisabled ? "true" : void 0);
|
|
@@ -52881,7 +52890,7 @@ function registerGrantList(program3) {
|
|
|
52881
52890
|
);
|
|
52882
52891
|
}
|
|
52883
52892
|
function registerGrantCreate(program3) {
|
|
52884
|
-
program3.command("grant:create").description("Create a public/code-gated agent access grant").requiredOption("--resource <id>", "Agent resource ID to expose").option("--slug <slug>", "Public slug; defaults to normalized --resource").option("--mode <mode>", "Access mode: public | code", "public").option("--code <code>", "Access code for --mode code").option("--origins <origins>", "Comma-separated allowed origins; omit for any origin").option("--expires-at <iso>", "ISO timestamp when the grant expires").option("--max-turns <number>", "Maximum turns per public session").option("--max-sessions <number>", "Maximum sessions per visitor").option("--branding <json>", "Branding metadata JSON object").option("--capture-fields <json>", "Capture fields JSON array").option("--tool-policy <json>", "Tool policy JSON object").option("--public-base-url <url>", "Client public app base URL for printed public URL").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52893
|
+
program3.command("grant:create").description("Create a public/code-gated agent access grant").requiredOption("--resource <id>", "Agent resource ID to expose").option("--slug <slug>", "Public slug; defaults to normalized --resource").option("--mode <mode>", "Access mode: public | code", "public").option("--code <code>", "Access code for --mode code").option("--origins <origins>", "Comma-separated allowed origins; omit for any origin").option("--expires-at <iso>", "ISO timestamp when the grant expires").option("--max-turns <number>", "Maximum turns per public session").option("--max-sessions <number>", "Maximum sessions per visitor").option("--branding <json>", "Branding metadata JSON object").option("--capture-fields <json>", "Capture fields JSON array").option("--tool-policy <json>", "Tool policy JSON object").option("--public-base-url <url>", "Client public app base URL for printed public URL").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52885
52894
|
wrapAction("grant:create", async (options) => {
|
|
52886
52895
|
const mode = options.mode ?? "public";
|
|
52887
52896
|
if (mode !== "public" && mode !== "code") {
|
|
@@ -52910,7 +52919,7 @@ function registerGrantCreate(program3) {
|
|
|
52910
52919
|
if (captureFields !== void 0) body.captureFields = captureFields;
|
|
52911
52920
|
const toolPolicy = parseJson2(options.toolPolicy, "--tool-policy");
|
|
52912
52921
|
if (toolPolicy !== void 0) body.toolPolicy = toolPolicy;
|
|
52913
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52922
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52914
52923
|
const result = await apiPost("/api/external/agent-access-grants", body, apiUrl);
|
|
52915
52924
|
if (options.json) {
|
|
52916
52925
|
printJson12(result.grant);
|
|
@@ -52923,7 +52932,7 @@ function registerGrantCreate(program3) {
|
|
|
52923
52932
|
);
|
|
52924
52933
|
}
|
|
52925
52934
|
function registerGrantUpdate(program3) {
|
|
52926
|
-
program3.command("grant:update <slug>").description("Update mutable fields on an existing agent access grant (branding, limits, mode, origins)").option("--mode <mode>", "Access mode: public | code").option("--code <code>", "Access code; required when switching --mode code without an existing code").option("--origins <origins>", "Comma-separated allowed origins (replaces existing)").option("--expires-at <iso>", "ISO timestamp when the grant expires").option("--max-turns <number>", "Maximum turns per public session").option("--max-sessions <number>", "Maximum sessions per visitor").option("--branding <json>", "Branding metadata JSON object (full replace)").option("--capture-fields <json>", "Capture fields JSON array (full replace)").option("--tool-policy <json>", "Tool policy JSON object (full replace)").option("--public-base-url <url>", "Client public app base URL for printed public URL").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52935
|
+
program3.command("grant:update <slug>").description("Update mutable fields on an existing agent access grant (branding, limits, mode, origins)").option("--mode <mode>", "Access mode: public | code").option("--code <code>", "Access code; required when switching --mode code without an existing code").option("--origins <origins>", "Comma-separated allowed origins (replaces existing)").option("--expires-at <iso>", "ISO timestamp when the grant expires").option("--max-turns <number>", "Maximum turns per public session").option("--max-sessions <number>", "Maximum sessions per visitor").option("--branding <json>", "Branding metadata JSON object (full replace)").option("--capture-fields <json>", "Capture fields JSON array (full replace)").option("--tool-policy <json>", "Tool policy JSON object (full replace)").option("--public-base-url <url>", "Client public app base URL for printed public URL").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52927
52936
|
wrapAction("grant:update", async (slug, options) => {
|
|
52928
52937
|
const body = {};
|
|
52929
52938
|
if (options.mode !== void 0) {
|
|
@@ -52949,7 +52958,7 @@ function registerGrantUpdate(program3) {
|
|
|
52949
52958
|
if (Object.keys(body).length === 0) {
|
|
52950
52959
|
throw new Error("Provide at least one field to update (e.g. --branding, --mode, --max-turns)");
|
|
52951
52960
|
}
|
|
52952
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52961
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52953
52962
|
const result = await apiPatch(
|
|
52954
52963
|
`/api/external/agent-access-grants/${encodeURIComponent(slug)}`,
|
|
52955
52964
|
body,
|
|
@@ -52966,9 +52975,9 @@ function registerGrantUpdate(program3) {
|
|
|
52966
52975
|
);
|
|
52967
52976
|
}
|
|
52968
52977
|
function registerGrantDisable(program3) {
|
|
52969
|
-
program3.command("grant:disable <slug>").description("Disable an agent access grant without deleting it").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52978
|
+
program3.command("grant:disable <slug>").description("Disable an agent access grant without deleting it").option("--prod", "Target production (overrides NODE_ENV=development)").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
|
|
52970
52979
|
wrapAction("grant:disable", async (slug, options) => {
|
|
52971
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52980
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52972
52981
|
const result = await apiPost(
|
|
52973
52982
|
`/api/external/agent-access-grants/${encodeURIComponent(slug)}/disable`,
|
|
52974
52983
|
{},
|
|
@@ -52991,6 +53000,341 @@ function registerGrantCommands(program3) {
|
|
|
52991
53000
|
registerGrantDisable(program3);
|
|
52992
53001
|
}
|
|
52993
53002
|
|
|
53003
|
+
// src/cli/commands/om/doctor.ts
|
|
53004
|
+
init_config();
|
|
53005
|
+
|
|
53006
|
+
// src/cli/commands/om/doctor-checks.ts
|
|
53007
|
+
var SEVERITIES = ["error", "warn", "info"];
|
|
53008
|
+
function emptyDiagnostics() {
|
|
53009
|
+
return { error: [], warn: [], info: [] };
|
|
53010
|
+
}
|
|
53011
|
+
function summarize(diagnostics) {
|
|
53012
|
+
const error46 = diagnostics.error.length;
|
|
53013
|
+
const warn2 = diagnostics.warn.length;
|
|
53014
|
+
const info = diagnostics.info.length;
|
|
53015
|
+
return { error: error46, warn: warn2, info, total: error46 + warn2 + info };
|
|
53016
|
+
}
|
|
53017
|
+
function isWithinScope(diagnostic, scope) {
|
|
53018
|
+
if (scope === void 0 || scope.length === 0) return true;
|
|
53019
|
+
const systemPaths = [
|
|
53020
|
+
...diagnostic.systemPath !== void 0 ? [diagnostic.systemPath] : [],
|
|
53021
|
+
...diagnostic.sourceSystemPaths ?? []
|
|
53022
|
+
];
|
|
53023
|
+
if (systemPaths.some((scoped) => scoped === scope || scoped.startsWith(`${scope}.`))) return true;
|
|
53024
|
+
if (diagnostic.targetId?.startsWith(`system:${scope}`)) return true;
|
|
53025
|
+
if (diagnostic.targetId?.startsWith(`ontology:${scope}:`)) return true;
|
|
53026
|
+
return false;
|
|
53027
|
+
}
|
|
53028
|
+
function groupDiagnostics(diagnostics, scope) {
|
|
53029
|
+
const grouped = emptyDiagnostics();
|
|
53030
|
+
for (const diagnostic of diagnostics) {
|
|
53031
|
+
if (!isWithinScope(diagnostic, scope)) continue;
|
|
53032
|
+
grouped[diagnostic.severity].push(diagnostic);
|
|
53033
|
+
}
|
|
53034
|
+
for (const severity of SEVERITIES) {
|
|
53035
|
+
grouped[severity].sort((a, b) => a.code.localeCompare(b.code) || a.message.localeCompare(b.message));
|
|
53036
|
+
}
|
|
53037
|
+
return grouped;
|
|
53038
|
+
}
|
|
53039
|
+
function ontologyIdsByKind(compilation) {
|
|
53040
|
+
return {
|
|
53041
|
+
object: new Set(Object.keys(compilation.ontology.objectTypes)),
|
|
53042
|
+
link: new Set(Object.keys(compilation.ontology.linkTypes)),
|
|
53043
|
+
action: new Set(Object.keys(compilation.ontology.actionTypes)),
|
|
53044
|
+
catalog: new Set(Object.keys(compilation.ontology.catalogTypes)),
|
|
53045
|
+
event: new Set(Object.keys(compilation.ontology.eventTypes)),
|
|
53046
|
+
interface: new Set(Object.keys(compilation.ontology.interfaceTypes)),
|
|
53047
|
+
"value-type": new Set(Object.keys(compilation.ontology.valueTypes)),
|
|
53048
|
+
property: new Set(Object.keys(compilation.ontology.sharedProperties)),
|
|
53049
|
+
group: new Set(Object.keys(compilation.ontology.groups)),
|
|
53050
|
+
endpoint: new Set(Object.keys(compilation.ontology.endpoints))
|
|
53051
|
+
};
|
|
53052
|
+
}
|
|
53053
|
+
function systemPathFromOntologyId(id) {
|
|
53054
|
+
try {
|
|
53055
|
+
const parsed = parseOntologyId(id);
|
|
53056
|
+
return parsed.isGlobal ? void 0 : parsed.scope;
|
|
53057
|
+
} catch {
|
|
53058
|
+
return void 0;
|
|
53059
|
+
}
|
|
53060
|
+
}
|
|
53061
|
+
function hasOntologyId(idsByKind, id, expectedKind) {
|
|
53062
|
+
if (expectedKind !== void 0) return idsByKind[expectedKind].has(id);
|
|
53063
|
+
try {
|
|
53064
|
+
const parsed = parseOntologyId(id);
|
|
53065
|
+
return idsByKind[parsed.kind].has(id);
|
|
53066
|
+
} catch {
|
|
53067
|
+
return false;
|
|
53068
|
+
}
|
|
53069
|
+
}
|
|
53070
|
+
function addOntologyReferenceDiagnostic(diagnostics, ownerId, refId, relation, path3) {
|
|
53071
|
+
diagnostics.push({
|
|
53072
|
+
severity: "error",
|
|
53073
|
+
code: "ontology-reference-missing",
|
|
53074
|
+
message: `Ontology record "${ownerId}" ${relation} references unknown ontology ID "${refId}".`,
|
|
53075
|
+
path: path3,
|
|
53076
|
+
systemPath: systemPathFromOntologyId(ownerId) ?? systemPathFromOntologyId(refId),
|
|
53077
|
+
targetId: `ontology:${refId}`
|
|
53078
|
+
});
|
|
53079
|
+
}
|
|
53080
|
+
function verifyOntologyReferences(model, diagnostics, context) {
|
|
53081
|
+
const compilation = context.ontologyCompilation;
|
|
53082
|
+
const idsByKind = ontologyIdsByKind(compilation);
|
|
53083
|
+
const idx = context.crossRefIndex;
|
|
53084
|
+
for (const diagnostic of compilation.diagnostics) {
|
|
53085
|
+
diagnostics.push({
|
|
53086
|
+
severity: "error",
|
|
53087
|
+
code: diagnostic.code,
|
|
53088
|
+
message: diagnostic.message,
|
|
53089
|
+
path: diagnostic.path,
|
|
53090
|
+
systemPath: diagnostic.origin.systemPath,
|
|
53091
|
+
targetId: `ontology:${diagnostic.id}`,
|
|
53092
|
+
source: diagnostic.source
|
|
53093
|
+
});
|
|
53094
|
+
}
|
|
53095
|
+
for (const { id, kind, record: record2 } of listResolvedOntologyRecords(compilation.ontology)) {
|
|
53096
|
+
let walk2 = function(value, path3, seen = /* @__PURE__ */ new WeakSet()) {
|
|
53097
|
+
if (Array.isArray(value)) {
|
|
53098
|
+
value.forEach((entry, index) => walk2(entry, [...path3, index], seen));
|
|
53099
|
+
return;
|
|
53100
|
+
}
|
|
53101
|
+
if (typeof value !== "object" || value === null) return;
|
|
53102
|
+
if (seen.has(value)) return;
|
|
53103
|
+
seen.add(value);
|
|
53104
|
+
Object.entries(value).forEach(([key, entry]) => {
|
|
53105
|
+
const expectedKind = ONTOLOGY_REFERENCE_KEY_KINDS[key];
|
|
53106
|
+
if (expectedKind !== void 0 && typeof entry === "string" && !hasOntologyId(idsByKind, entry, expectedKind)) {
|
|
53107
|
+
addOntologyReferenceDiagnostic(diagnostics, id, entry, key, [...path3, key]);
|
|
53108
|
+
}
|
|
53109
|
+
walk2(entry, [...path3, key], seen);
|
|
53110
|
+
});
|
|
53111
|
+
};
|
|
53112
|
+
var walk = walk2;
|
|
53113
|
+
if (kind === "action") {
|
|
53114
|
+
const action = record2;
|
|
53115
|
+
action.actsOn?.forEach((refId, index) => {
|
|
53116
|
+
if (!hasOntologyId(idsByKind, refId)) {
|
|
53117
|
+
addOntologyReferenceDiagnostic(diagnostics, id, refId, "actsOn", [...record2.origin.path, "actsOn", index]);
|
|
53118
|
+
}
|
|
53119
|
+
});
|
|
53120
|
+
}
|
|
53121
|
+
if (kind === "link") {
|
|
53122
|
+
const link = record2;
|
|
53123
|
+
["from", "to"].forEach((field2) => {
|
|
53124
|
+
const refId = link[field2];
|
|
53125
|
+
if (refId !== void 0 && !hasOntologyId(idsByKind, refId, "object")) {
|
|
53126
|
+
addOntologyReferenceDiagnostic(diagnostics, id, refId, field2, [...record2.origin.path, field2]);
|
|
53127
|
+
}
|
|
53128
|
+
});
|
|
53129
|
+
}
|
|
53130
|
+
if (kind === "catalog") {
|
|
53131
|
+
const catalog = record2;
|
|
53132
|
+
if (catalog.appliesTo !== void 0 && !hasOntologyId(idsByKind, catalog.appliesTo, "object")) {
|
|
53133
|
+
addOntologyReferenceDiagnostic(diagnostics, id, catalog.appliesTo, "appliesTo", [
|
|
53134
|
+
...record2.origin.path,
|
|
53135
|
+
"appliesTo"
|
|
53136
|
+
]);
|
|
53137
|
+
}
|
|
53138
|
+
}
|
|
53139
|
+
if (kind === "group") {
|
|
53140
|
+
const group = record2;
|
|
53141
|
+
group.members?.forEach((refId, index) => {
|
|
53142
|
+
if (!hasOntologyId(idsByKind, refId)) {
|
|
53143
|
+
addOntologyReferenceDiagnostic(diagnostics, id, refId, "members", [...record2.origin.path, "members", index]);
|
|
53144
|
+
}
|
|
53145
|
+
});
|
|
53146
|
+
}
|
|
53147
|
+
walk2(record2, record2.origin.path);
|
|
53148
|
+
}
|
|
53149
|
+
for (const resource of Object.values(model.resources ?? {})) {
|
|
53150
|
+
const binding = resource.ontology;
|
|
53151
|
+
if (binding === void 0) continue;
|
|
53152
|
+
const checks = [
|
|
53153
|
+
["actions", "action", binding.actions ?? []],
|
|
53154
|
+
["reads", "object", binding.reads ?? []],
|
|
53155
|
+
["writes", "object", binding.writes ?? []],
|
|
53156
|
+
["usesCatalogs", "catalog", binding.usesCatalogs ?? []],
|
|
53157
|
+
["emits", "event", binding.emits ?? []]
|
|
53158
|
+
];
|
|
53159
|
+
if (binding.primaryAction !== void 0) {
|
|
53160
|
+
checks.push(["primaryAction", "action", [binding.primaryAction]]);
|
|
53161
|
+
}
|
|
53162
|
+
for (const [bindingKey, expectedKind, ids] of checks) {
|
|
53163
|
+
ids.forEach((ontologyId, index) => {
|
|
53164
|
+
if (!resourceOntologyBindingMissing(idx, expectedKind, ontologyId)) return;
|
|
53165
|
+
diagnostics.push({
|
|
53166
|
+
severity: "error",
|
|
53167
|
+
code: "resource-ontology-reference-missing",
|
|
53168
|
+
message: `Resource "${resource.id}" ontology binding "${bindingKey}" references unknown ${expectedKind} ontology ID "${ontologyId}".`,
|
|
53169
|
+
path: ["resources", resource.id, "ontology", bindingKey, ...ids.length > 1 ? [index] : []],
|
|
53170
|
+
systemPath: resource.systemPath,
|
|
53171
|
+
targetId: `ontology:${ontologyId}`
|
|
53172
|
+
});
|
|
53173
|
+
});
|
|
53174
|
+
}
|
|
53175
|
+
}
|
|
53176
|
+
}
|
|
53177
|
+
function verifyKnowledgeLinks(model, diagnostics, context) {
|
|
53178
|
+
const idx = context.crossRefIndex;
|
|
53179
|
+
for (const [nodeKey, node] of Object.entries(model.knowledge ?? {})) {
|
|
53180
|
+
node.links.forEach((link, index) => {
|
|
53181
|
+
if (knowledgeTargetExists(idx, link.target.kind, link.target.id)) return;
|
|
53182
|
+
diagnostics.push({
|
|
53183
|
+
severity: "error",
|
|
53184
|
+
code: "knowledge-link-missing-target",
|
|
53185
|
+
message: `Knowledge node "${node.id}" references unknown ${link.target.kind} target "${link.target.id}".`,
|
|
53186
|
+
path: ["knowledge", nodeKey, "links", index, "target"],
|
|
53187
|
+
systemPath: link.target.kind === "system" ? link.target.id : systemPathFromOntologyId(link.target.id),
|
|
53188
|
+
targetId: link.nodeId
|
|
53189
|
+
});
|
|
53190
|
+
});
|
|
53191
|
+
}
|
|
53192
|
+
}
|
|
53193
|
+
function verifyRenameOrphans(model, diagnostics) {
|
|
53194
|
+
const systemPaths = new Set(listAllSystems(model).map(({ path: path3 }) => path3));
|
|
53195
|
+
const missingRefs = /* @__PURE__ */ new Map();
|
|
53196
|
+
function addMissing(path3, source, sourceSystemPath) {
|
|
53197
|
+
if (systemPaths.has(path3)) return;
|
|
53198
|
+
const ref = missingRefs.get(path3) ?? { sources: [], sourceSystemPaths: /* @__PURE__ */ new Set() };
|
|
53199
|
+
ref.sources.push(source);
|
|
53200
|
+
if (sourceSystemPath !== void 0 && systemPaths.has(sourceSystemPath)) ref.sourceSystemPaths.add(sourceSystemPath);
|
|
53201
|
+
missingRefs.set(path3, ref);
|
|
53202
|
+
}
|
|
53203
|
+
for (const resource of Object.values(model.resources ?? {})) {
|
|
53204
|
+
addMissing(resource.systemPath, `resource:${resource.id}`);
|
|
53205
|
+
}
|
|
53206
|
+
for (const [nodeKey, node] of Object.entries(model.knowledge ?? {})) {
|
|
53207
|
+
node.links.forEach((link, index) => {
|
|
53208
|
+
if (link.target.kind === "system") addMissing(link.target.id, `knowledge:${nodeKey}.links.${index}`);
|
|
53209
|
+
});
|
|
53210
|
+
}
|
|
53211
|
+
for (const [relationshipId, relationship] of Object.entries(model.topology?.relationships ?? {})) {
|
|
53212
|
+
const fromSystem = relationship.from.kind === "system" ? relationship.from.id : void 0;
|
|
53213
|
+
const toSystem = relationship.to.kind === "system" ? relationship.to.id : void 0;
|
|
53214
|
+
if (fromSystem !== void 0) addMissing(fromSystem, `topology:${relationshipId}.from`, toSystem);
|
|
53215
|
+
if (toSystem !== void 0) addMissing(toSystem, `topology:${relationshipId}.to`, fromSystem);
|
|
53216
|
+
}
|
|
53217
|
+
for (const [missingPath, ref] of missingRefs) {
|
|
53218
|
+
const parentPath = missingPath.split(".").slice(0, -1).join(".");
|
|
53219
|
+
const looksLikeRename = parentPath.length === 0 || systemPaths.has(parentPath);
|
|
53220
|
+
const sources = ref.sources.sort();
|
|
53221
|
+
const sourceSystemPaths = [...ref.sourceSystemPaths].sort();
|
|
53222
|
+
diagnostics.push({
|
|
53223
|
+
severity: looksLikeRename ? "warn" : "error",
|
|
53224
|
+
code: "rename-orphan",
|
|
53225
|
+
message: `References point at missing system path "${missingPath}" from ${sources.length} source(s). If this followed a system rename, re-apply the rename across all references instead of patching one at a time.`,
|
|
53226
|
+
systemPath: missingPath,
|
|
53227
|
+
...sourceSystemPaths.length > 0 ? { sourceSystemPaths } : {},
|
|
53228
|
+
targetId: `system:${missingPath}`,
|
|
53229
|
+
source: sources.join(", ")
|
|
53230
|
+
});
|
|
53231
|
+
}
|
|
53232
|
+
}
|
|
53233
|
+
function runOmDoctorChecks(inputModel, options = {}) {
|
|
53234
|
+
const diagnostics = [];
|
|
53235
|
+
let model;
|
|
53236
|
+
try {
|
|
53237
|
+
model = resolveOrganizationModel(inputModel, { mergeDefaults: false });
|
|
53238
|
+
} catch (error46) {
|
|
53239
|
+
diagnostics.push({
|
|
53240
|
+
severity: "error",
|
|
53241
|
+
code: "organization-model-resolution-failed",
|
|
53242
|
+
message: error46 instanceof Error ? error46.message : String(error46)
|
|
53243
|
+
});
|
|
53244
|
+
model = inputModel;
|
|
53245
|
+
}
|
|
53246
|
+
if (model !== void 0) {
|
|
53247
|
+
try {
|
|
53248
|
+
const context = buildOmCompilationContext(model);
|
|
53249
|
+
verifyOntologyReferences(model, diagnostics, context);
|
|
53250
|
+
verifyKnowledgeLinks(model, diagnostics, context);
|
|
53251
|
+
verifyRenameOrphans(model, diagnostics);
|
|
53252
|
+
diagnostics.push({
|
|
53253
|
+
severity: "info",
|
|
53254
|
+
code: "organization-model-summary",
|
|
53255
|
+
message: `Resolved ${listAllSystems(model).length} systems, ${Object.keys(model.resources ?? {}).length} resources, ${Object.keys(model.knowledge ?? {}).length} knowledge nodes, and ${listResolvedOntologyRecords(context.ontologyCompilation.ontology).length} ontology records.`
|
|
53256
|
+
});
|
|
53257
|
+
} catch (error46) {
|
|
53258
|
+
diagnostics.push({
|
|
53259
|
+
severity: "error",
|
|
53260
|
+
code: "organization-model-verification-failed",
|
|
53261
|
+
message: error46 instanceof Error ? error46.message : String(error46)
|
|
53262
|
+
});
|
|
53263
|
+
}
|
|
53264
|
+
}
|
|
53265
|
+
const grouped = groupDiagnostics(diagnostics, options.scope);
|
|
53266
|
+
const summary = summarize(grouped);
|
|
53267
|
+
return {
|
|
53268
|
+
ok: summary.error === 0,
|
|
53269
|
+
scope: options.scope ?? null,
|
|
53270
|
+
checksRun: 3,
|
|
53271
|
+
summary,
|
|
53272
|
+
diagnostics: grouped
|
|
53273
|
+
};
|
|
53274
|
+
}
|
|
53275
|
+
function formatDiagnostic(diagnostic) {
|
|
53276
|
+
const target = diagnostic.targetId ? ` (${diagnostic.targetId})` : "";
|
|
53277
|
+
const source = diagnostic.source ? ` [${diagnostic.source}]` : "";
|
|
53278
|
+
return `- ${diagnostic.code}${target}: ${diagnostic.message}${source}`;
|
|
53279
|
+
}
|
|
53280
|
+
function formatOmDoctorReport(report) {
|
|
53281
|
+
const lines = [
|
|
53282
|
+
`om:doctor ${report.ok ? "passed" : "failed"}: ${report.summary.error} error(s), ${report.summary.warn} warning(s), ${report.summary.info} info.`,
|
|
53283
|
+
report.scope ? `Scope: ${report.scope}` : "Scope: full Organization Model",
|
|
53284
|
+
"Runs 3 of the platform doctor's checks (ontology references, knowledge links, rename orphans). UI-consistency and contract-ref checks are monorepo-only and do not run here."
|
|
53285
|
+
];
|
|
53286
|
+
for (const severity of SEVERITIES) {
|
|
53287
|
+
const items = report.diagnostics[severity];
|
|
53288
|
+
if (items.length === 0) continue;
|
|
53289
|
+
lines.push("", severity.toUpperCase());
|
|
53290
|
+
lines.push(...items.map(formatDiagnostic));
|
|
53291
|
+
}
|
|
53292
|
+
return lines.join("\n");
|
|
53293
|
+
}
|
|
53294
|
+
|
|
53295
|
+
// src/cli/commands/om/doctor.ts
|
|
53296
|
+
function registerOmDoctorCommand(program3) {
|
|
53297
|
+
program3.command("om:doctor").description(
|
|
53298
|
+
"Reduced model doctor \u2014 runs 3 of the platform's 5 checks\n Checks: ontology references, knowledge links, rename-orphan hints\n NOT run (monorepo-only): UI-manifest consistency, contract-ref resolution\n Example: elevasis-sdk om:doctor\n Example: elevasis-sdk om:doctor --scope sales.crm\n Example: elevasis-sdk om:doctor --json"
|
|
53299
|
+
).option("--json", "Output as grouped JSON envelope").option("--scope <systemPath>", "Limit diagnostics to a system path and descendants").action(
|
|
53300
|
+
wrapAction("om:doctor", async (options) => {
|
|
53301
|
+
let report;
|
|
53302
|
+
try {
|
|
53303
|
+
const projectRoot = getProjectRoot();
|
|
53304
|
+
const model = await loadOrgModel(projectRoot);
|
|
53305
|
+
report = runOmDoctorChecks(model, { scope: options.scope });
|
|
53306
|
+
} catch (error46) {
|
|
53307
|
+
const message = error46 instanceof Error ? error46.message : String(error46);
|
|
53308
|
+
report = {
|
|
53309
|
+
ok: false,
|
|
53310
|
+
scope: options.scope ?? null,
|
|
53311
|
+
checksRun: 3,
|
|
53312
|
+
summary: { error: 1, warn: 0, info: 0, total: 1 },
|
|
53313
|
+
diagnostics: {
|
|
53314
|
+
error: [
|
|
53315
|
+
{
|
|
53316
|
+
severity: "error",
|
|
53317
|
+
code: "organization-model-load-failed",
|
|
53318
|
+
message
|
|
53319
|
+
}
|
|
53320
|
+
],
|
|
53321
|
+
warn: [],
|
|
53322
|
+
info: []
|
|
53323
|
+
}
|
|
53324
|
+
};
|
|
53325
|
+
}
|
|
53326
|
+
if (options.json) {
|
|
53327
|
+
process.stdout.write(JSON.stringify(report, null, 2) + "\n");
|
|
53328
|
+
} else {
|
|
53329
|
+
process.stdout.write(formatOmDoctorReport(report) + "\n");
|
|
53330
|
+
}
|
|
53331
|
+
if (!report.ok) {
|
|
53332
|
+
process.exitCode = 1;
|
|
53333
|
+
}
|
|
53334
|
+
})
|
|
53335
|
+
);
|
|
53336
|
+
}
|
|
53337
|
+
|
|
52994
53338
|
// src/cli/commands/om/index.ts
|
|
52995
53339
|
function registerOmScaffoldCommands(program3) {
|
|
52996
53340
|
program3.command("om:scaffold:system").description("Guide creation of a new system entry in core/config/organization-model/systems.ts").option("--id <path>", "dot-notated system path, e.g. sales.crm (prompted if absent)").option("--title <title>", "display title (prompted if absent)").option("--kind <kind>", "system kind: operational | analytical | support (prompted if absent)").option("--api-backed", "emit apiInterface block and remind to add resource IDs").option("--dry-run", "print proposed TypeScript block without writing").action(async (opts) => {
|
|
@@ -53198,7 +53542,7 @@ function runPreflight() {
|
|
|
53198
53542
|
);
|
|
53199
53543
|
process.exit(1);
|
|
53200
53544
|
}
|
|
53201
|
-
if (!
|
|
53545
|
+
if (!resolveApiKey()) {
|
|
53202
53546
|
process.stderr.write(source_default.red(`\`ELEVASIS_PLATFORM_KEY\` missing from \`${envPath2}\`.
|
|
53203
53547
|
`));
|
|
53204
53548
|
process.stderr.write(source_default.gray("Remediation: add ELEVASIS_PLATFORM_KEY=sk_... to your .env file.\n"));
|
|
@@ -53224,6 +53568,8 @@ Commands:
|
|
|
53224
53568
|
elevasis-sdk exec <resourceId> -i '{}' Execute a resource
|
|
53225
53569
|
elevasis-sdk executions <resourceId> List execution history
|
|
53226
53570
|
elevasis-sdk execution <resourceId> <id> Get execution details
|
|
53571
|
+
elevasis-sdk execution:cancel <resourceId> <id> Cancel a running execution
|
|
53572
|
+
elevasis-sdk executions:delete <resourceId> Delete execution history (destructive)
|
|
53227
53573
|
elevasis-sdk deployments List deployments
|
|
53228
53574
|
elevasis-sdk project:list [--search <query>] List projects with optional search
|
|
53229
53575
|
elevasis-sdk project:resolve <query> Resolve a project ID from a name or UUID
|
|
@@ -53272,6 +53618,8 @@ registerExecCommand(program2);
|
|
|
53272
53618
|
registerResourcesCommand(program2);
|
|
53273
53619
|
registerExecutionsCommand(program2);
|
|
53274
53620
|
registerExecutionCommand(program2);
|
|
53621
|
+
registerExecutionCancelCommand(program2);
|
|
53622
|
+
registerExecutionsDeleteCommand(program2);
|
|
53275
53623
|
registerDescribeCommand(program2);
|
|
53276
53624
|
registerDeploymentsCommand(program2);
|
|
53277
53625
|
registerCredsCommand(program2);
|
|
@@ -53292,6 +53640,7 @@ registerUiCommands(program2);
|
|
|
53292
53640
|
registerDoctorCommand(program2);
|
|
53293
53641
|
registerCliCatalogCommand(program2);
|
|
53294
53642
|
registerOmScaffoldCommands(program2);
|
|
53643
|
+
registerOmDoctorCommand(program2);
|
|
53295
53644
|
registerSkillScaffoldCommand(program2);
|
|
53296
53645
|
registerSkillCheckCoverageCommand(program2);
|
|
53297
53646
|
try {
|