@elevasis/sdk 1.44.3 → 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 +991 -650
- package/dist/index.d.ts +1045 -509
- package/dist/index.js +738 -688
- package/dist/node/index.d.ts +105 -97
- package/dist/test-utils/index.d.ts +42 -28
- package/dist/test-utils/index.js +514 -783
- package/dist/worker/index.d.ts +12112 -0
- package/dist/worker/index.js +121 -182
- 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 +21 -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-agent-prose-escape-normalization.md +0 -88
- 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,
|
|
@@ -43854,465 +44234,6 @@ function buildIterationResponseSchemaUncached(tools, capabilities) {
|
|
|
43854
44234
|
};
|
|
43855
44235
|
}
|
|
43856
44236
|
|
|
43857
|
-
// ../core/src/business/acquisition/ontology-validation.ts
|
|
43858
|
-
var LEAD_GEN_API_INTERFACE = SYSTEM_INTERFACE_PROFILES[0];
|
|
43859
|
-
var CRM_API_INTERFACE = SYSTEM_INTERFACE_PROFILES[1];
|
|
43860
|
-
var LEAD_GEN_CRM_HANDOFF_INTERFACE = SYSTEM_INTERFACE_PROFILES[2];
|
|
43861
|
-
var LEAD_GEN_API_READINESS_LABEL = LEAD_GEN_API_INTERFACE.readinessProfile;
|
|
43862
|
-
var CRM_API_READINESS_LABEL = CRM_API_INTERFACE.readinessProfile;
|
|
43863
|
-
var LEAD_GEN_CRM_HANDOFF_READINESS_LABEL = LEAD_GEN_CRM_HANDOFF_INTERFACE.readinessProfile;
|
|
43864
|
-
var LEAD_GEN_LIST_OBJECT_ONTOLOGY_ID = formatOntologyId({
|
|
43865
|
-
scope: "sales.lead-gen",
|
|
43866
|
-
kind: "object",
|
|
43867
|
-
localId: "list"
|
|
43868
|
-
});
|
|
43869
|
-
var LEAD_GEN_COMPANY_OBJECT_ONTOLOGY_ID = formatOntologyId({
|
|
43870
|
-
scope: "sales.lead-gen",
|
|
43871
|
-
kind: "object",
|
|
43872
|
-
localId: "company"
|
|
43873
|
-
});
|
|
43874
|
-
var LEAD_GEN_CONTACT_OBJECT_ONTOLOGY_ID = formatOntologyId({
|
|
43875
|
-
scope: "sales.lead-gen",
|
|
43876
|
-
kind: "object",
|
|
43877
|
-
localId: "contact"
|
|
43878
|
-
});
|
|
43879
|
-
var LEAD_GEN_BUILD_TEMPLATE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
43880
|
-
scope: "sales.lead-gen",
|
|
43881
|
-
kind: "catalog",
|
|
43882
|
-
localId: "build-template"
|
|
43883
|
-
});
|
|
43884
|
-
var LEAD_GEN_COMPANY_STAGE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
43885
|
-
scope: "sales.lead-gen",
|
|
43886
|
-
kind: "catalog",
|
|
43887
|
-
localId: "company-stage"
|
|
43888
|
-
});
|
|
43889
|
-
var LEAD_GEN_CONTACT_STAGE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
43890
|
-
scope: "sales.lead-gen",
|
|
43891
|
-
kind: "catalog",
|
|
43892
|
-
localId: "contact-stage"
|
|
43893
|
-
});
|
|
43894
|
-
var CRM_PIPELINE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
43895
|
-
scope: "sales.crm",
|
|
43896
|
-
kind: "catalog",
|
|
43897
|
-
localId: "crm.pipeline"
|
|
43898
|
-
});
|
|
43899
|
-
var LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
43900
|
-
scope: "sales.lead-gen",
|
|
43901
|
-
kind: "catalog",
|
|
43902
|
-
localId: "lead-gen.stage-catalog"
|
|
43903
|
-
});
|
|
43904
|
-
function createLeadGenStageCatalog(model) {
|
|
43905
|
-
return {
|
|
43906
|
-
id: LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID,
|
|
43907
|
-
label: "Lead Gen Processing Stages",
|
|
43908
|
-
ownerSystemId: "sales.lead-gen",
|
|
43909
|
-
kind: "processing-stage-catalog",
|
|
43910
|
-
entries: Object.fromEntries(
|
|
43911
|
-
Object.entries(getLeadGenStageCatalog(model)).map(([key, entry]) => [
|
|
43912
|
-
key,
|
|
43913
|
-
{
|
|
43914
|
-
...entry
|
|
43915
|
-
}
|
|
43916
|
-
])
|
|
43917
|
-
),
|
|
43918
|
-
legacyCatalogKey: "LEAD_GEN_STAGE_CATALOG"
|
|
43919
|
-
};
|
|
43920
|
-
}
|
|
43921
|
-
function isPlainRecord(value) {
|
|
43922
|
-
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
43923
|
-
}
|
|
43924
|
-
function addReadinessIssue(issues, family, code, message, details = {}) {
|
|
43925
|
-
issues.push({
|
|
43926
|
-
family,
|
|
43927
|
-
code,
|
|
43928
|
-
message,
|
|
43929
|
-
...details
|
|
43930
|
-
});
|
|
43931
|
-
}
|
|
43932
|
-
function formatInterfaceIdentity(systemPath, interfaceKey) {
|
|
43933
|
-
return `${systemPath}/${interfaceKey}`;
|
|
43934
|
-
}
|
|
43935
|
-
function readinessMarkerPath(context) {
|
|
43936
|
-
return context.interfaceKey === "api" ? `systems.${context.systemPath}.apiInterface` : `systems.${context.systemPath}.derivedCrmHandoffReadiness`;
|
|
43937
|
-
}
|
|
43938
|
-
function formatSupportedReadinessProfiles() {
|
|
43939
|
-
return SYSTEM_INTERFACE_PROFILES.map((p) => `"${p.readinessProfile}"`).join(", ");
|
|
43940
|
-
}
|
|
43941
|
-
function getActiveScopedResources(model, resourceIds, issues, context) {
|
|
43942
|
-
const resources = [];
|
|
43943
|
-
for (const [index, resourceId] of resourceIds.entries()) {
|
|
43944
|
-
const resource = model.resources?.[resourceId];
|
|
43945
|
-
const path3 = `${readinessMarkerPath(context)}.resourceIds.${index}`;
|
|
43946
|
-
if (resource === void 0) {
|
|
43947
|
-
addReadinessIssue(
|
|
43948
|
-
issues,
|
|
43949
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
43950
|
-
"missing-resource",
|
|
43951
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" scopes missing resource "${resourceId}".`,
|
|
43952
|
-
{ path: path3, ref: resourceId }
|
|
43953
|
-
);
|
|
43954
|
-
continue;
|
|
43955
|
-
}
|
|
43956
|
-
if (resource.systemPath !== context.systemPath) {
|
|
43957
|
-
addReadinessIssue(
|
|
43958
|
-
issues,
|
|
43959
|
-
"SYSTEM_INTERFACE_INVALID",
|
|
43960
|
-
"resource-system-mismatch",
|
|
43961
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" scopes resource "${resourceId}" from system "${resource.systemPath}".`,
|
|
43962
|
-
{ path: path3, ref: resourceId }
|
|
43963
|
-
);
|
|
43964
|
-
continue;
|
|
43965
|
-
}
|
|
43966
|
-
if (resource.status !== "active") {
|
|
43967
|
-
addReadinessIssue(
|
|
43968
|
-
issues,
|
|
43969
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
43970
|
-
"inactive-resource",
|
|
43971
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" scopes inactive resource "${resourceId}".`,
|
|
43972
|
-
{ path: path3, ref: resourceId }
|
|
43973
|
-
);
|
|
43974
|
-
continue;
|
|
43975
|
-
}
|
|
43976
|
-
resources.push(resource);
|
|
43977
|
-
}
|
|
43978
|
-
return resources;
|
|
43979
|
-
}
|
|
43980
|
-
function resourceBindingIds(resources, key) {
|
|
43981
|
-
return new Set(resources.flatMap((resource) => resource.ontology?.[key] ?? []));
|
|
43982
|
-
}
|
|
43983
|
-
function requireScopedBinding(issues, boundIds, bindingKey, ontologyId, context) {
|
|
43984
|
-
if (boundIds.has(ontologyId)) return;
|
|
43985
|
-
addReadinessIssue(
|
|
43986
|
-
issues,
|
|
43987
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
43988
|
-
"missing-resource-binding",
|
|
43989
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" has no active scoped resource with ontology.${bindingKey} binding "${ontologyId}".`,
|
|
43990
|
-
{ path: `${readinessMarkerPath(context)}.resourceIds`, ref: ontologyId }
|
|
43991
|
-
);
|
|
43992
|
-
}
|
|
43993
|
-
function ontologyOwnerMatches(ontologyId, expectedSystemPath, catalog) {
|
|
43994
|
-
if (catalog?.ownerSystemId !== void 0) return catalog.ownerSystemId === expectedSystemPath;
|
|
43995
|
-
return parseOntologyId(ontologyId).scope === expectedSystemPath;
|
|
43996
|
-
}
|
|
43997
|
-
function requireObjectReadiness(issues, index, objectId, context) {
|
|
43998
|
-
const object2 = index.ontology.objectTypes[objectId];
|
|
43999
|
-
if (object2 === void 0) {
|
|
44000
|
-
addReadinessIssue(
|
|
44001
|
-
issues,
|
|
44002
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
44003
|
-
"missing-object",
|
|
44004
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" is missing required object type "${objectId}".`,
|
|
44005
|
-
{ ref: objectId }
|
|
44006
|
-
);
|
|
44007
|
-
return;
|
|
44008
|
-
}
|
|
44009
|
-
const ownerSystemId = object2.ownerSystemId ?? parseOntologyId(objectId).scope;
|
|
44010
|
-
if (ownerSystemId !== context.systemPath) {
|
|
44011
|
-
addReadinessIssue(
|
|
44012
|
-
issues,
|
|
44013
|
-
"SYSTEM_INTERFACE_INVALID",
|
|
44014
|
-
"foreign-object",
|
|
44015
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" requires object "${objectId}" owned by "${ownerSystemId}".`,
|
|
44016
|
-
{ ref: objectId }
|
|
44017
|
-
);
|
|
44018
|
-
}
|
|
44019
|
-
}
|
|
44020
|
-
function requireCatalogReadiness(issues, index, catalogId, context) {
|
|
44021
|
-
const catalog = index.ontology.catalogTypes[catalogId];
|
|
44022
|
-
if (catalog === void 0) {
|
|
44023
|
-
addReadinessIssue(
|
|
44024
|
-
issues,
|
|
44025
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
44026
|
-
"missing-catalog",
|
|
44027
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" is missing required catalog "${catalogId}".`,
|
|
44028
|
-
{ ref: catalogId }
|
|
44029
|
-
);
|
|
44030
|
-
return void 0;
|
|
44031
|
-
}
|
|
44032
|
-
if (context.allowForeignOwner !== true && !ontologyOwnerMatches(catalogId, context.systemPath, catalog)) {
|
|
44033
|
-
addReadinessIssue(
|
|
44034
|
-
issues,
|
|
44035
|
-
"SYSTEM_INTERFACE_INVALID",
|
|
44036
|
-
"foreign-catalog",
|
|
44037
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" requires catalog "${catalogId}" owned by "${catalog.ownerSystemId ?? parseOntologyId(catalogId).scope}".`,
|
|
44038
|
-
{ ref: catalogId }
|
|
44039
|
-
);
|
|
44040
|
-
}
|
|
44041
|
-
if (Object.keys(getCatalogEntries(catalog)).length === 0) {
|
|
44042
|
-
addReadinessIssue(
|
|
44043
|
-
issues,
|
|
44044
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
44045
|
-
"empty-catalog",
|
|
44046
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" requires catalog entries for "${catalogId}".`,
|
|
44047
|
-
{ ref: catalogId }
|
|
44048
|
-
);
|
|
44049
|
-
}
|
|
44050
|
-
return catalog;
|
|
44051
|
-
}
|
|
44052
|
-
function requireLeadGenInterfaceReadiness(issues, index, resources, context) {
|
|
44053
|
-
const reads = resourceBindingIds(resources, "reads");
|
|
44054
|
-
const catalogs = resourceBindingIds(resources, "usesCatalogs");
|
|
44055
|
-
for (const objectId of [
|
|
44056
|
-
LEAD_GEN_LIST_OBJECT_ONTOLOGY_ID,
|
|
44057
|
-
LEAD_GEN_COMPANY_OBJECT_ONTOLOGY_ID,
|
|
44058
|
-
LEAD_GEN_CONTACT_OBJECT_ONTOLOGY_ID
|
|
44059
|
-
]) {
|
|
44060
|
-
requireObjectReadiness(issues, index, objectId, context);
|
|
44061
|
-
requireScopedBinding(issues, reads, "reads", objectId, context);
|
|
44062
|
-
}
|
|
44063
|
-
for (const catalogId of [
|
|
44064
|
-
LEAD_GEN_BUILD_TEMPLATE_CATALOG_ONTOLOGY_ID,
|
|
44065
|
-
LEAD_GEN_COMPANY_STAGE_CATALOG_ONTOLOGY_ID,
|
|
44066
|
-
LEAD_GEN_CONTACT_STAGE_CATALOG_ONTOLOGY_ID
|
|
44067
|
-
]) {
|
|
44068
|
-
requireCatalogReadiness(issues, index, catalogId, context);
|
|
44069
|
-
requireScopedBinding(issues, catalogs, "usesCatalogs", catalogId, context);
|
|
44070
|
-
}
|
|
44071
|
-
const templateStepCatalog = findLeadGenTemplateStepCatalog(index);
|
|
44072
|
-
if (templateStepCatalog === void 0) {
|
|
44073
|
-
addReadinessIssue(
|
|
44074
|
-
issues,
|
|
44075
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
44076
|
-
"missing-template-step-catalog",
|
|
44077
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" is missing a lead-gen template-step catalog.`
|
|
44078
|
-
);
|
|
44079
|
-
} else {
|
|
44080
|
-
requireCatalogReadiness(issues, index, templateStepCatalog.id, context);
|
|
44081
|
-
requireScopedBinding(issues, catalogs, "usesCatalogs", templateStepCatalog.id, context);
|
|
44082
|
-
}
|
|
44083
|
-
const leadGenStageCatalog = requireCatalogReadiness(issues, index, LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID, context);
|
|
44084
|
-
return leadGenStageCatalog;
|
|
44085
|
-
}
|
|
44086
|
-
function requireCrmInterfaceReadiness(issues, index, resources, context) {
|
|
44087
|
-
const catalogs = resourceBindingIds(resources, "usesCatalogs");
|
|
44088
|
-
const crmPipelineCatalog = requireCatalogReadiness(issues, index, CRM_PIPELINE_CATALOG_ONTOLOGY_ID, context);
|
|
44089
|
-
requireScopedBinding(issues, catalogs, "usesCatalogs", CRM_PIPELINE_CATALOG_ONTOLOGY_ID, context);
|
|
44090
|
-
return crmPipelineCatalog;
|
|
44091
|
-
}
|
|
44092
|
-
function findSystemInterfaceGrant(model, consumer, provider) {
|
|
44093
|
-
return Object.values(model.topology?.relationships ?? {}).find((relationship) => {
|
|
44094
|
-
const grant = relationship.metadata?.["systemInterfaceGrant"];
|
|
44095
|
-
if (!isPlainRecord(grant) || !isPlainRecord(grant.consumer) || !isPlainRecord(grant.provider)) return false;
|
|
44096
|
-
return grant.consumer.systemPath === consumer.systemPath && grant.consumer.interfaceKey === consumer.interfaceKey && grant.provider.systemPath === provider.systemPath && grant.provider.interfaceKey === provider.interfaceKey;
|
|
44097
|
-
});
|
|
44098
|
-
}
|
|
44099
|
-
function requireHandoffBridgeReadiness(issues, model, context) {
|
|
44100
|
-
const crmResult = computeInterfaceReadiness(model, CRM_API_INTERFACE);
|
|
44101
|
-
if (!crmResult.ready) {
|
|
44102
|
-
for (const issue2 of crmResult.issues) {
|
|
44103
|
-
addReadinessIssue(
|
|
44104
|
-
issues,
|
|
44105
|
-
"SYSTEM_BRIDGE_NOT_READY",
|
|
44106
|
-
issue2.code,
|
|
44107
|
-
`Provider interface ${formatInterfaceIdentity(CRM_API_INTERFACE.systemPath, CRM_API_INTERFACE.interfaceKey)} is not ready: ${issue2.message}`,
|
|
44108
|
-
{ path: issue2.path, ref: issue2.ref }
|
|
44109
|
-
);
|
|
44110
|
-
}
|
|
44111
|
-
}
|
|
44112
|
-
const bridgeGrant = findSystemInterfaceGrant(model, context, CRM_API_INTERFACE);
|
|
44113
|
-
if (bridgeGrant === void 0) {
|
|
44114
|
-
addReadinessIssue(
|
|
44115
|
-
issues,
|
|
44116
|
-
"SYSTEM_BRIDGE_NOT_READY",
|
|
44117
|
-
"missing-topology-grant",
|
|
44118
|
-
`System Interface "${formatInterfaceIdentity(context.systemPath, context.interfaceKey)}" requires a scoped topology grant to "${formatInterfaceIdentity(CRM_API_INTERFACE.systemPath, CRM_API_INTERFACE.interfaceKey)}".`
|
|
44119
|
-
);
|
|
44120
|
-
}
|
|
44121
|
-
return bridgeGrant;
|
|
44122
|
-
}
|
|
44123
|
-
function getLeadGenCrmHandoffResourceIds(model) {
|
|
44124
|
-
return Object.values(model.resources ?? {}).filter(
|
|
44125
|
-
(resource) => resource.systemPath === LEAD_GEN_CRM_HANDOFF_INTERFACE.systemPath && resource.ontology?.usesCatalogs?.includes(CRM_PIPELINE_CATALOG_ONTOLOGY_ID) === true
|
|
44126
|
-
).map((resource) => resource.id);
|
|
44127
|
-
}
|
|
44128
|
-
function getSystemInterfaceReadinessMarker(model, request2) {
|
|
44129
|
-
const system = getSystem(model, request2.systemPath);
|
|
44130
|
-
if (system === void 0) return void 0;
|
|
44131
|
-
if (request2.systemPath === LEAD_GEN_CRM_HANDOFF_INTERFACE.systemPath && request2.interfaceKey === LEAD_GEN_CRM_HANDOFF_INTERFACE.interfaceKey) {
|
|
44132
|
-
return {
|
|
44133
|
-
lifecycle: "active",
|
|
44134
|
-
readinessProfile: LEAD_GEN_CRM_HANDOFF_INTERFACE.readinessProfile,
|
|
44135
|
-
resourceIds: getLeadGenCrmHandoffResourceIds(model)
|
|
44136
|
-
};
|
|
44137
|
-
}
|
|
44138
|
-
if (request2.interfaceKey === "api" && system.apiInterface !== void 0) {
|
|
44139
|
-
return system.apiInterface;
|
|
44140
|
-
}
|
|
44141
|
-
return void 0;
|
|
44142
|
-
}
|
|
44143
|
-
function mergeLeadGenDerivedCatalogs(model) {
|
|
44144
|
-
const baseCatalogTypes = model.ontology?.catalogTypes ?? {};
|
|
44145
|
-
const derivedCatalogTypes = {};
|
|
44146
|
-
if (baseCatalogTypes[LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID] === void 0) {
|
|
44147
|
-
derivedCatalogTypes[LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID] = createLeadGenStageCatalog(model);
|
|
44148
|
-
}
|
|
44149
|
-
if (Object.keys(derivedCatalogTypes).length === 0) return model;
|
|
44150
|
-
return {
|
|
44151
|
-
...model,
|
|
44152
|
-
ontology: {
|
|
44153
|
-
...model.ontology ?? {},
|
|
44154
|
-
catalogTypes: {
|
|
44155
|
-
...baseCatalogTypes,
|
|
44156
|
-
...derivedCatalogTypes
|
|
44157
|
-
}
|
|
44158
|
-
}
|
|
44159
|
-
};
|
|
44160
|
-
}
|
|
44161
|
-
function compileBusinessOntology(model, contractId) {
|
|
44162
|
-
const compilation = compileOrganizationOntology(mergeLeadGenDerivedCatalogs(model));
|
|
44163
|
-
if (compilation.diagnostics.length > 0) {
|
|
44164
|
-
const summary = compilation.diagnostics.map((diagnostic) => diagnostic.message).join("; ");
|
|
44165
|
-
throw new Error(`${contractId} ontology validation index failed to compile: ${summary}`);
|
|
44166
|
-
}
|
|
44167
|
-
return {
|
|
44168
|
-
ontology: compilation.ontology,
|
|
44169
|
-
actionTypesByLegacyId: indexActionTypesByLegacyId(compilation.ontology.actionTypes)
|
|
44170
|
-
};
|
|
44171
|
-
}
|
|
44172
|
-
function tryCompileBusinessOntology(model, readinessProfile, issues) {
|
|
44173
|
-
try {
|
|
44174
|
-
return compileBusinessOntology(model, readinessProfile);
|
|
44175
|
-
} catch (error46) {
|
|
44176
|
-
addReadinessIssue(
|
|
44177
|
-
issues,
|
|
44178
|
-
"SYSTEM_INTERFACE_INVALID",
|
|
44179
|
-
"ontology-compile-failed",
|
|
44180
|
-
error46 instanceof Error ? error46.message : String(error46)
|
|
44181
|
-
);
|
|
44182
|
-
return void 0;
|
|
44183
|
-
}
|
|
44184
|
-
}
|
|
44185
|
-
function requireContractReadiness(issues, index, resources, contract, context) {
|
|
44186
|
-
const reads = resourceBindingIds(resources, "reads");
|
|
44187
|
-
const catalogs = resourceBindingIds(resources, "usesCatalogs");
|
|
44188
|
-
for (const objectId of contract.requiredObjects) {
|
|
44189
|
-
requireObjectReadiness(issues, index, objectId, context);
|
|
44190
|
-
requireScopedBinding(issues, reads, "reads", objectId, context);
|
|
44191
|
-
}
|
|
44192
|
-
for (const catalogId of contract.requiredCatalogs) {
|
|
44193
|
-
requireCatalogReadiness(issues, index, catalogId, context);
|
|
44194
|
-
requireScopedBinding(issues, catalogs, "usesCatalogs", catalogId, context);
|
|
44195
|
-
}
|
|
44196
|
-
}
|
|
44197
|
-
function computeInterfaceReadiness(model, request2) {
|
|
44198
|
-
const issues = [];
|
|
44199
|
-
const system = getSystem(model, request2.systemPath);
|
|
44200
|
-
const systemInterface = getSystemInterfaceReadinessMarker(model, request2);
|
|
44201
|
-
const readinessProfile = systemInterface === void 0 ? void 0 : profileForInterface(request2.systemPath, request2.interfaceKey, systemInterface.readinessProfile);
|
|
44202
|
-
const scopedResourceIds = systemInterface?.resourceIds ?? [];
|
|
44203
|
-
if (system === void 0) {
|
|
44204
|
-
addReadinessIssue(
|
|
44205
|
-
issues,
|
|
44206
|
-
"SYSTEM_INTERFACE_MISSING",
|
|
44207
|
-
"missing-system",
|
|
44208
|
-
`System "${request2.systemPath}" is missing.`,
|
|
44209
|
-
{ ref: request2.systemPath }
|
|
44210
|
-
);
|
|
44211
|
-
return {
|
|
44212
|
-
ready: false,
|
|
44213
|
-
systemPath: request2.systemPath,
|
|
44214
|
-
interfaceKey: request2.interfaceKey,
|
|
44215
|
-
scopedResourceIds,
|
|
44216
|
-
issues
|
|
44217
|
-
};
|
|
44218
|
-
}
|
|
44219
|
-
if (systemInterface === void 0) {
|
|
44220
|
-
addReadinessIssue(
|
|
44221
|
-
issues,
|
|
44222
|
-
"SYSTEM_INTERFACE_MISSING",
|
|
44223
|
-
"missing-interface",
|
|
44224
|
-
`System "${request2.systemPath}" does not declare interface "${request2.interfaceKey}".`,
|
|
44225
|
-
{ path: readinessMarkerPath(request2) }
|
|
44226
|
-
);
|
|
44227
|
-
return {
|
|
44228
|
-
ready: false,
|
|
44229
|
-
systemPath: request2.systemPath,
|
|
44230
|
-
interfaceKey: request2.interfaceKey,
|
|
44231
|
-
scopedResourceIds,
|
|
44232
|
-
issues
|
|
44233
|
-
};
|
|
44234
|
-
}
|
|
44235
|
-
if (systemInterface.lifecycle !== "active") {
|
|
44236
|
-
addReadinessIssue(
|
|
44237
|
-
issues,
|
|
44238
|
-
"SYSTEM_INTERFACE_DISABLED",
|
|
44239
|
-
"inactive-interface",
|
|
44240
|
-
`System Interface "${formatInterfaceIdentity(request2.systemPath, request2.interfaceKey)}" lifecycle is "${systemInterface.lifecycle}".`,
|
|
44241
|
-
{ path: `${readinessMarkerPath(request2)}.lifecycle` }
|
|
44242
|
-
);
|
|
44243
|
-
}
|
|
44244
|
-
const checkedReadinessProfile = readinessProfile ?? profileForInterface(request2.systemPath, request2.interfaceKey);
|
|
44245
|
-
const isBuiltIn = isBuiltInReadinessProfile(checkedReadinessProfile);
|
|
44246
|
-
const readinessContract = systemInterface.readinessContract;
|
|
44247
|
-
if (!isBuiltIn && readinessContract === void 0) {
|
|
44248
|
-
addReadinessIssue(
|
|
44249
|
-
issues,
|
|
44250
|
-
"SYSTEM_INTERFACE_INVALID",
|
|
44251
|
-
"missing-readiness-contract",
|
|
44252
|
-
`System Interface "${formatInterfaceIdentity(request2.systemPath, request2.interfaceKey)}" uses custom readiness profile "${checkedReadinessProfile}" but declares no readinessContract. Built-in profiles: ${formatSupportedReadinessProfiles()}.`,
|
|
44253
|
-
{ path: `${readinessMarkerPath(request2)}.readinessContract`, ref: checkedReadinessProfile }
|
|
44254
|
-
);
|
|
44255
|
-
return {
|
|
44256
|
-
ready: false,
|
|
44257
|
-
systemPath: request2.systemPath,
|
|
44258
|
-
interfaceKey: request2.interfaceKey,
|
|
44259
|
-
readinessProfile: checkedReadinessProfile,
|
|
44260
|
-
scopedResourceIds,
|
|
44261
|
-
issues
|
|
44262
|
-
};
|
|
44263
|
-
}
|
|
44264
|
-
if (scopedResourceIds.length === 0) {
|
|
44265
|
-
addReadinessIssue(
|
|
44266
|
-
issues,
|
|
44267
|
-
"SYSTEM_INTERFACE_NOT_READY",
|
|
44268
|
-
"missing-scoped-resources",
|
|
44269
|
-
`System Interface "${formatInterfaceIdentity(request2.systemPath, request2.interfaceKey)}" must scope at least one active resource.`,
|
|
44270
|
-
{ path: `${readinessMarkerPath(request2)}.resourceIds` }
|
|
44271
|
-
);
|
|
44272
|
-
}
|
|
44273
|
-
const resources = getActiveScopedResources(model, scopedResourceIds, issues, request2);
|
|
44274
|
-
const index = tryCompileBusinessOntology(model, checkedReadinessProfile, issues);
|
|
44275
|
-
if (index !== void 0) {
|
|
44276
|
-
if (checkedReadinessProfile === LEAD_GEN_API_INTERFACE.readinessProfile) {
|
|
44277
|
-
requireLeadGenInterfaceReadiness(issues, index, resources, request2);
|
|
44278
|
-
} else if (checkedReadinessProfile === CRM_API_INTERFACE.readinessProfile) {
|
|
44279
|
-
requireCrmInterfaceReadiness(issues, index, resources, request2);
|
|
44280
|
-
} else if (checkedReadinessProfile === LEAD_GEN_CRM_HANDOFF_INTERFACE.readinessProfile) {
|
|
44281
|
-
requireLeadGenInterfaceReadiness(issues, index, resources, request2);
|
|
44282
|
-
requireCrmInterfaceReadiness(issues, index, resources, { ...request2, allowForeignOwner: true });
|
|
44283
|
-
requireHandoffBridgeReadiness(issues, model, request2);
|
|
44284
|
-
} else if (readinessContract !== void 0) {
|
|
44285
|
-
requireContractReadiness(issues, index, resources, readinessContract, request2);
|
|
44286
|
-
}
|
|
44287
|
-
}
|
|
44288
|
-
return {
|
|
44289
|
-
ready: issues.length === 0,
|
|
44290
|
-
systemPath: request2.systemPath,
|
|
44291
|
-
interfaceKey: request2.interfaceKey,
|
|
44292
|
-
readinessProfile: checkedReadinessProfile,
|
|
44293
|
-
scopedResourceIds,
|
|
44294
|
-
issues
|
|
44295
|
-
};
|
|
44296
|
-
}
|
|
44297
|
-
function findLeadGenTemplateStepCatalog(index) {
|
|
44298
|
-
return Object.values(index.ontology.catalogTypes).find(
|
|
44299
|
-
(catalog) => catalog.ownerSystemId === "sales.lead-gen" && catalog.kind === "template-step" && catalog.appliesTo === LEAD_GEN_LIST_OBJECT_ONTOLOGY_ID
|
|
44300
|
-
);
|
|
44301
|
-
}
|
|
44302
|
-
function indexActionTypesByLegacyId(actionTypes) {
|
|
44303
|
-
const byLegacyId = {};
|
|
44304
|
-
for (const actionType of Object.values(actionTypes)) {
|
|
44305
|
-
const legacyActionId = actionType["legacyActionId"];
|
|
44306
|
-
if (typeof legacyActionId === "string") {
|
|
44307
|
-
byLegacyId[legacyActionId] = actionType;
|
|
44308
|
-
}
|
|
44309
|
-
}
|
|
44310
|
-
return byLegacyId;
|
|
44311
|
-
}
|
|
44312
|
-
function getCatalogEntries(catalog) {
|
|
44313
|
-
return isPlainRecord(catalog.entries) ? catalog.entries : {};
|
|
44314
|
-
}
|
|
44315
|
-
|
|
44316
44237
|
// ../core/src/platform/registry/validation.ts
|
|
44317
44238
|
var RegistryValidationError = class extends Error {
|
|
44318
44239
|
constructor(orgName, resourceId, field2, message) {
|
|
@@ -44712,7 +44633,6 @@ function validateDeclaredSystemInterfaceReadiness(orgName, organizationModel) {
|
|
|
44712
44633
|
message: `System Interface "${path3}/${interfaceKey}" references unknown readiness profile "${readinessProfile}".`
|
|
44713
44634
|
});
|
|
44714
44635
|
}
|
|
44715
|
-
continue;
|
|
44716
44636
|
}
|
|
44717
44637
|
const result = computeInterfaceReadiness(model, { systemPath: path3, interfaceKey });
|
|
44718
44638
|
for (const issue2 of result.issues) {
|
|
@@ -46273,7 +46193,7 @@ function wrapAction(commandName, fn) {
|
|
|
46273
46193
|
// package.json
|
|
46274
46194
|
var package_default = {
|
|
46275
46195
|
name: "@elevasis/sdk",
|
|
46276
|
-
version: "1.
|
|
46196
|
+
version: "1.45.0",
|
|
46277
46197
|
description: "SDK for building Elevasis organization resources",
|
|
46278
46198
|
type: "module",
|
|
46279
46199
|
bin: {
|
|
@@ -46285,7 +46205,7 @@ var package_default = {
|
|
|
46285
46205
|
import: "./dist/index.js"
|
|
46286
46206
|
},
|
|
46287
46207
|
"./worker": {
|
|
46288
|
-
types: "./dist/
|
|
46208
|
+
types: "./dist/worker/index.d.ts",
|
|
46289
46209
|
import: "./dist/worker/index.js"
|
|
46290
46210
|
},
|
|
46291
46211
|
"./test-utils": {
|
|
@@ -46301,10 +46221,7 @@ var package_default = {
|
|
|
46301
46221
|
"dist/index.js",
|
|
46302
46222
|
"dist/index.d.ts",
|
|
46303
46223
|
"dist/worker/index.js",
|
|
46304
|
-
"dist/
|
|
46305
|
-
"dist/types/worker/platform.d.ts",
|
|
46306
|
-
"dist/types/worker/utils.d.ts",
|
|
46307
|
-
"dist/types/worker/adapters/",
|
|
46224
|
+
"dist/worker/index.d.ts",
|
|
46308
46225
|
"dist/test-utils/index.js",
|
|
46309
46226
|
"dist/test-utils/index.d.ts",
|
|
46310
46227
|
"dist/node/",
|
|
@@ -47162,7 +47079,7 @@ function registerExecCommand(program3) {
|
|
|
47162
47079
|
Example: elevasis-sdk exec my-workflow -i '{"key":"value"}'`).option("-i, --input <json>", "Input data as JSON string").option(
|
|
47163
47080
|
"-f, --input-file <path>",
|
|
47164
47081
|
"Read input from a JSON file (avoids shell escaping issues). Relative paths resolve against the project root."
|
|
47165
|
-
).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(
|
|
47166
47083
|
"--cleanup-input",
|
|
47167
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)"
|
|
47168
47085
|
).action(
|
|
@@ -47171,7 +47088,7 @@ function registerExecCommand(program3) {
|
|
|
47171
47088
|
async (resourceId, options) => {
|
|
47172
47089
|
const resolvedInputFile = options.inputFile ? resolveProjectRelative(options.inputFile) : void 0;
|
|
47173
47090
|
const input = resolvedInputFile ? JSON.parse((0, import_node_fs2.readFileSync)(resolvedInputFile, "utf8")) : options.input ? JSON.parse(options.input) : {};
|
|
47174
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
47091
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
47175
47092
|
const maybeCleanupInput = () => {
|
|
47176
47093
|
if (!options.cleanupInput || !resolvedInputFile) return;
|
|
47177
47094
|
const tmpDir = (0, import_node_path3.join)(getProjectRoot(), "tmp");
|
|
@@ -47257,8 +47174,8 @@ function getResourceType(resource) {
|
|
|
47257
47174
|
return resource.type ?? resource.resourceType;
|
|
47258
47175
|
}
|
|
47259
47176
|
function registerResourcesCommand(program3) {
|
|
47260
|
-
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) => {
|
|
47261
|
-
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);
|
|
47262
47179
|
const spinner = ora("Fetching resources...").start();
|
|
47263
47180
|
const data = await apiGet(
|
|
47264
47181
|
"/api/external/resources",
|
|
@@ -47305,8 +47222,8 @@ function registerResourcesCommand(program3) {
|
|
|
47305
47222
|
init_source();
|
|
47306
47223
|
init_config();
|
|
47307
47224
|
function registerExecutionsCommand(program3) {
|
|
47308
|
-
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) => {
|
|
47309
|
-
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);
|
|
47310
47227
|
const spinner = ora(`Fetching executions for ${resourceId}...`).start();
|
|
47311
47228
|
const params = new URLSearchParams();
|
|
47312
47229
|
if (options.limit) params.set("limit", options.limit);
|
|
@@ -47365,8 +47282,8 @@ function registerExecutionsCommand(program3) {
|
|
|
47365
47282
|
init_source();
|
|
47366
47283
|
init_config();
|
|
47367
47284
|
function registerExecutionCommand(program3) {
|
|
47368
|
-
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) => {
|
|
47369
|
-
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);
|
|
47370
47287
|
const spinner = ora("Fetching execution details...").start();
|
|
47371
47288
|
const execution = await apiGet(
|
|
47372
47289
|
`/api/external/executions/${resourceId}/${executionId}`,
|
|
@@ -47465,12 +47382,99 @@ function displayLog(log) {
|
|
|
47465
47382
|
}
|
|
47466
47383
|
}
|
|
47467
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
|
+
|
|
47468
47472
|
// src/cli/commands/deployments.ts
|
|
47469
47473
|
init_source();
|
|
47470
47474
|
init_config();
|
|
47471
47475
|
function registerDeploymentsCommand(program3) {
|
|
47472
|
-
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) => {
|
|
47473
|
-
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);
|
|
47474
47478
|
const spinner = ora("Fetching deployments...").start();
|
|
47475
47479
|
const data = await apiGet(
|
|
47476
47480
|
"/api/external/deployments",
|
|
@@ -47550,9 +47554,9 @@ function formatJsonSchema(schema, indent = 2) {
|
|
|
47550
47554
|
return JSON.stringify(schema, null, 2);
|
|
47551
47555
|
}
|
|
47552
47556
|
function registerDescribeCommand(program3) {
|
|
47553
|
-
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(
|
|
47554
47558
|
wrapAction("describe", async (resourceId, options) => {
|
|
47555
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
47559
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
47556
47560
|
const spinner = ora("Fetching resource definition...").start();
|
|
47557
47561
|
const definition = await apiGet(
|
|
47558
47562
|
`/api/external/resources/${resourceId}/definition`,
|
|
@@ -47803,20 +47807,20 @@ Credential '${name}' deleted successfully.`));
|
|
|
47803
47807
|
// src/cli/commands/creds/creds.ts
|
|
47804
47808
|
function registerCredsCommand(program3) {
|
|
47805
47809
|
const creds = program3.command("creds").description("Manage organization credentials");
|
|
47806
|
-
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) => {
|
|
47807
|
-
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);
|
|
47808
47812
|
}));
|
|
47809
|
-
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) => {
|
|
47810
|
-
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);
|
|
47811
47815
|
}));
|
|
47812
|
-
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) => {
|
|
47813
|
-
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);
|
|
47814
47818
|
}));
|
|
47815
|
-
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) => {
|
|
47816
|
-
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);
|
|
47817
47821
|
}));
|
|
47818
|
-
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) => {
|
|
47819
|
-
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);
|
|
47820
47824
|
}));
|
|
47821
47825
|
}
|
|
47822
47826
|
|
|
@@ -47847,14 +47851,14 @@ ${result.count} error(s) resolved for execution '${executionId}'.`));
|
|
|
47847
47851
|
// src/cli/commands/error/error.ts
|
|
47848
47852
|
function registerErrorCommand(program3) {
|
|
47849
47853
|
const error46 = program3.command("error").description("Manage execution errors");
|
|
47850
|
-
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(
|
|
47851
47855
|
wrapAction("error resolve", async (errorId, options) => {
|
|
47852
|
-
await resolveError(resolveApiUrl(options.apiUrl), errorId);
|
|
47856
|
+
await resolveError(resolveApiUrl(options.apiUrl, options.prod), errorId);
|
|
47853
47857
|
})
|
|
47854
47858
|
);
|
|
47855
|
-
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(
|
|
47856
47860
|
wrapAction("error resolve-execution", async (executionId, options) => {
|
|
47857
|
-
await resolveErrorsByExecution(resolveApiUrl(options.apiUrl), executionId);
|
|
47861
|
+
await resolveErrorsByExecution(resolveApiUrl(options.apiUrl, options.prod), executionId);
|
|
47858
47862
|
})
|
|
47859
47863
|
);
|
|
47860
47864
|
}
|
|
@@ -47904,7 +47908,6 @@ init_source();
|
|
|
47904
47908
|
init_config();
|
|
47905
47909
|
|
|
47906
47910
|
// src/cli/commands/project/resolve-project.ts
|
|
47907
|
-
init_config();
|
|
47908
47911
|
function isUuid(value) {
|
|
47909
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);
|
|
47910
47913
|
}
|
|
@@ -47914,12 +47917,11 @@ function normalize(value) {
|
|
|
47914
47917
|
function formatCandidates(projects) {
|
|
47915
47918
|
return projects.slice(0, 5).map((project) => `${project.name} (${project.id})`).join(", ");
|
|
47916
47919
|
}
|
|
47917
|
-
async function resolveProject(query,
|
|
47920
|
+
async function resolveProject(query, apiUrl) {
|
|
47918
47921
|
const trimmedQuery = query.trim();
|
|
47919
47922
|
if (!trimmedQuery) {
|
|
47920
47923
|
throw new Error("Project query is required");
|
|
47921
47924
|
}
|
|
47922
|
-
const apiUrl = resolveApiUrl(apiUrlOverride);
|
|
47923
47925
|
if (isUuid(trimmedQuery)) {
|
|
47924
47926
|
try {
|
|
47925
47927
|
const result2 = await apiGet(`/api/external/projects/${trimmedQuery}`, apiUrl);
|
|
@@ -48152,12 +48154,11 @@ function normalizeStr(value) {
|
|
|
48152
48154
|
function formatClientCandidates(clients) {
|
|
48153
48155
|
return clients.slice(0, 5).map((c) => `${c.name} (${c.id})`).join(", ");
|
|
48154
48156
|
}
|
|
48155
|
-
async function resolveClient(query,
|
|
48157
|
+
async function resolveClient(query, apiUrl) {
|
|
48156
48158
|
const trimmedQuery = query.trim();
|
|
48157
48159
|
if (!trimmedQuery) {
|
|
48158
48160
|
throw new Error("Client query is required");
|
|
48159
48161
|
}
|
|
48160
|
-
const apiUrl = resolveApiUrl(apiUrlOverride);
|
|
48161
48162
|
if (isUuid2(trimmedQuery)) {
|
|
48162
48163
|
try {
|
|
48163
48164
|
const result2 = await apiGet(`/api/external/clients/${trimmedQuery}`, apiUrl);
|
|
@@ -48203,11 +48204,11 @@ function endpointWithQuery(endpoint, params) {
|
|
|
48203
48204
|
return query ? `${endpoint}?${query}` : endpoint;
|
|
48204
48205
|
}
|
|
48205
48206
|
function registerClientList(program3) {
|
|
48206
|
-
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(
|
|
48207
48208
|
wrapAction(
|
|
48208
48209
|
"client:list",
|
|
48209
48210
|
async (options) => {
|
|
48210
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48211
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48211
48212
|
const params = new URLSearchParams();
|
|
48212
48213
|
appendQuery(params, "status", options.status);
|
|
48213
48214
|
appendQuery(params, "search", options.search);
|
|
@@ -48236,9 +48237,9 @@ Clients (${result.data.length} of ${result.total}):
|
|
|
48236
48237
|
);
|
|
48237
48238
|
}
|
|
48238
48239
|
function registerClientGet(program3) {
|
|
48239
|
-
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(
|
|
48240
48241
|
wrapAction("client:get", async (id, options) => {
|
|
48241
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48242
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48242
48243
|
const result = await apiGet(`/api/external/clients/${id}`, apiUrl);
|
|
48243
48244
|
if (!options.pretty) {
|
|
48244
48245
|
printJson(result);
|
|
@@ -48255,9 +48256,9 @@ Client: ${result.name}`));
|
|
|
48255
48256
|
);
|
|
48256
48257
|
}
|
|
48257
48258
|
function registerClientStatus(program3) {
|
|
48258
|
-
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(
|
|
48259
48260
|
wrapAction("client:status", async (options) => {
|
|
48260
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48261
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48261
48262
|
const result = await apiGet("/api/external/clients/status", apiUrl);
|
|
48262
48263
|
if (!options.pretty) {
|
|
48263
48264
|
printJson(result);
|
|
@@ -48282,9 +48283,9 @@ function registerClientStatus(program3) {
|
|
|
48282
48283
|
function registerClientResolve(program3) {
|
|
48283
48284
|
program3.command("client:resolve <query>").description(
|
|
48284
48285
|
'Resolve a client ID from a name, UUID, or search query\n Example: elevasis-sdk client:resolve "Acme"'
|
|
48285
|
-
).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(
|
|
48286
48287
|
wrapAction("client:resolve", async (query, options) => {
|
|
48287
|
-
const client = await resolveClient(query, options.apiUrl);
|
|
48288
|
+
const client = await resolveClient(query, resolveApiUrl(options.apiUrl, options.prod));
|
|
48288
48289
|
if (options.pretty) {
|
|
48289
48290
|
console.log(source_default.cyan(`
|
|
48290
48291
|
Resolved client: ${client.name}`));
|
|
@@ -48303,14 +48304,14 @@ function printJson2(value) {
|
|
|
48303
48304
|
console.log(JSON.stringify(value, null, 2));
|
|
48304
48305
|
}
|
|
48305
48306
|
function registerProjectList(program3) {
|
|
48306
|
-
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(
|
|
48307
48308
|
wrapAction(
|
|
48308
48309
|
"project:list",
|
|
48309
48310
|
async (options) => {
|
|
48310
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48311
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48311
48312
|
let clientId;
|
|
48312
48313
|
if (options.client) {
|
|
48313
|
-
const resolved = await resolveClient(options.client,
|
|
48314
|
+
const resolved = await resolveClient(options.client, apiUrl);
|
|
48314
48315
|
clientId = resolved.id;
|
|
48315
48316
|
}
|
|
48316
48317
|
const params = new URLSearchParams();
|
|
@@ -48350,9 +48351,9 @@ Projects (${projects.length}):
|
|
|
48350
48351
|
function registerProjectResolve(program3) {
|
|
48351
48352
|
program3.command("project:resolve <query>").description(
|
|
48352
48353
|
'Resolve a project ID from a name, UUID, or search query\n Example: elevasis-sdk project:resolve "Alpha"'
|
|
48353
|
-
).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(
|
|
48354
48355
|
wrapAction("project:resolve", async (query, options) => {
|
|
48355
|
-
const project = await resolveProject(query, options.apiUrl);
|
|
48356
|
+
const project = await resolveProject(query, resolveApiUrl(options.apiUrl, options.prod));
|
|
48356
48357
|
if (options.json) {
|
|
48357
48358
|
printJson2(project);
|
|
48358
48359
|
return;
|
|
@@ -48374,10 +48375,10 @@ Resolved project: ${project.name}`));
|
|
|
48374
48375
|
function registerProjectWork(program3) {
|
|
48375
48376
|
program3.command("project:work <query>").alias("project:open").description(
|
|
48376
48377
|
'Resolve a project and print a lifecycle-aware work brief\n Example: elevasis-sdk project:work "Alpha"'
|
|
48377
|
-
).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(
|
|
48378
48379
|
wrapAction("project:work", async (query, options) => {
|
|
48379
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48380
|
-
const resolved = await resolveProject(query,
|
|
48380
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48381
|
+
const resolved = await resolveProject(query, apiUrl);
|
|
48381
48382
|
const [projectResult, notesResult] = await Promise.all([
|
|
48382
48383
|
apiGet(`/api/external/projects/${resolved.id}`, apiUrl),
|
|
48383
48384
|
apiGet(`/api/external/projects/${resolved.id}/notes`, apiUrl)
|
|
@@ -48394,9 +48395,9 @@ ${renderProjectWorkBrief(brief)}
|
|
|
48394
48395
|
);
|
|
48395
48396
|
}
|
|
48396
48397
|
function registerProjectGet(program3) {
|
|
48397
|
-
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(
|
|
48398
48399
|
wrapAction("project:get", async (id, options) => {
|
|
48399
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48400
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48400
48401
|
const result = await apiGet(`/api/external/projects/${id}`, apiUrl);
|
|
48401
48402
|
if (options.json) {
|
|
48402
48403
|
printJson2(result);
|
|
@@ -48418,14 +48419,14 @@ Project: ${p.name}`));
|
|
|
48418
48419
|
);
|
|
48419
48420
|
}
|
|
48420
48421
|
function registerProjectCreate(program3) {
|
|
48421
|
-
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(
|
|
48422
48423
|
wrapAction(
|
|
48423
48424
|
"project:create",
|
|
48424
48425
|
async (options) => {
|
|
48425
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48426
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48426
48427
|
let clientId;
|
|
48427
48428
|
if (options.client) {
|
|
48428
|
-
const resolved = await resolveClient(options.client,
|
|
48429
|
+
const resolved = await resolveClient(options.client, apiUrl);
|
|
48429
48430
|
clientId = resolved.id;
|
|
48430
48431
|
}
|
|
48431
48432
|
const body = {
|
|
@@ -48462,7 +48463,7 @@ Project created: ${p.name}`));
|
|
|
48462
48463
|
);
|
|
48463
48464
|
}
|
|
48464
48465
|
function registerProjectUpdate(program3) {
|
|
48465
|
-
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(
|
|
48466
48467
|
wrapAction(
|
|
48467
48468
|
"project:update",
|
|
48468
48469
|
async (id, options) => {
|
|
@@ -48475,11 +48476,12 @@ function registerProjectUpdate(program3) {
|
|
|
48475
48476
|
);
|
|
48476
48477
|
process.exit(1);
|
|
48477
48478
|
}
|
|
48479
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48478
48480
|
let clientId;
|
|
48479
48481
|
if (options.clearClient) {
|
|
48480
48482
|
clientId = null;
|
|
48481
48483
|
} else if (options.client) {
|
|
48482
|
-
const resolved = await resolveClient(options.client,
|
|
48484
|
+
const resolved = await resolveClient(options.client, apiUrl);
|
|
48483
48485
|
clientId = resolved.id;
|
|
48484
48486
|
}
|
|
48485
48487
|
const body = {};
|
|
@@ -48503,7 +48505,6 @@ function registerProjectUpdate(program3) {
|
|
|
48503
48505
|
);
|
|
48504
48506
|
process.exit(1);
|
|
48505
48507
|
}
|
|
48506
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48507
48508
|
const result = await apiPatch(`/api/external/projects/${id}`, body, apiUrl);
|
|
48508
48509
|
if (options.json) {
|
|
48509
48510
|
printJson2(result);
|
|
@@ -48523,9 +48524,9 @@ Project updated: ${p.name}`));
|
|
|
48523
48524
|
);
|
|
48524
48525
|
}
|
|
48525
48526
|
function registerProjectDelete(program3) {
|
|
48526
|
-
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(
|
|
48527
48528
|
wrapAction("project:delete", async (id, options) => {
|
|
48528
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48529
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48529
48530
|
const result = await apiDelete(`/api/external/projects/${id}`, apiUrl);
|
|
48530
48531
|
if (options.json) {
|
|
48531
48532
|
printJson2(result);
|
|
@@ -48569,9 +48570,9 @@ function parseChecklistOption(options) {
|
|
|
48569
48570
|
}
|
|
48570
48571
|
}
|
|
48571
48572
|
function registerMilestoneList(program3) {
|
|
48572
|
-
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(
|
|
48573
48574
|
wrapAction("project:milestone:list", async (options) => {
|
|
48574
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48575
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48575
48576
|
const result = await apiGet(`/api/external/projects/${options.project}/milestones`, apiUrl);
|
|
48576
48577
|
if (options.json) {
|
|
48577
48578
|
printJson3(result);
|
|
@@ -48601,7 +48602,7 @@ Milestones (${milestones.length}):
|
|
|
48601
48602
|
function registerMilestoneCreate(program3) {
|
|
48602
48603
|
program3.command("project:milestone:create").description(
|
|
48603
48604
|
'Create a milestone\n Example: elevasis-sdk project:milestone:create --project <uuid> --name "Phase 1"'
|
|
48604
|
-
).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(
|
|
48605
48606
|
wrapAction(
|
|
48606
48607
|
"project:milestone:create",
|
|
48607
48608
|
async (options) => {
|
|
@@ -48609,7 +48610,7 @@ function registerMilestoneCreate(program3) {
|
|
|
48609
48610
|
if (options.status) body.status = options.status;
|
|
48610
48611
|
if (options.dueDate) body.due_date = options.dueDate;
|
|
48611
48612
|
if (options.description) body.description = options.description;
|
|
48612
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48613
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48613
48614
|
const result = await apiPost(
|
|
48614
48615
|
`/api/external/projects/${options.project}/milestones`,
|
|
48615
48616
|
body,
|
|
@@ -48638,7 +48639,7 @@ function registerMilestoneUpdate(program3) {
|
|
|
48638
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(
|
|
48639
48640
|
"--checklist-file <path>",
|
|
48640
48641
|
"Read replacement checklist from a JSON file. Relative paths resolve against the project root."
|
|
48641
|
-
).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(
|
|
48642
48643
|
wrapAction(
|
|
48643
48644
|
"project:milestone:update",
|
|
48644
48645
|
async (id, options) => {
|
|
@@ -48658,7 +48659,7 @@ function registerMilestoneUpdate(program3) {
|
|
|
48658
48659
|
);
|
|
48659
48660
|
process.exit(1);
|
|
48660
48661
|
}
|
|
48661
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48662
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48662
48663
|
const result = await apiPatch(`/api/external/milestones/${id}`, body, apiUrl);
|
|
48663
48664
|
if (options.json) {
|
|
48664
48665
|
printJson3(result);
|
|
@@ -48678,9 +48679,9 @@ Milestone updated: ${m.name}`));
|
|
|
48678
48679
|
);
|
|
48679
48680
|
}
|
|
48680
48681
|
function registerMilestoneDelete(program3) {
|
|
48681
|
-
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(
|
|
48682
48683
|
wrapAction("project:milestone:delete", async (id, options) => {
|
|
48683
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48684
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48684
48685
|
const result = await apiDelete(`/api/external/milestones/${id}`, apiUrl);
|
|
48685
48686
|
if (options.json) {
|
|
48686
48687
|
printJson3(result);
|
|
@@ -48729,11 +48730,11 @@ function registerTaskList(program3) {
|
|
|
48729
48730
|
).requiredOption("--project <project-id>", "Project ID (UUID)").option(
|
|
48730
48731
|
"--status <status>",
|
|
48731
48732
|
"Filter by status: planned | in_progress | blocked | completed | cancelled | submitted | approved | rejected | revision_requested"
|
|
48732
|
-
).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(
|
|
48733
48734
|
wrapAction(
|
|
48734
48735
|
"project:task:list",
|
|
48735
48736
|
async (options) => {
|
|
48736
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48737
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48737
48738
|
const params = new URLSearchParams();
|
|
48738
48739
|
if (options.status) params.set("status", options.status);
|
|
48739
48740
|
if (options.milestone) params.set("milestone_id", options.milestone);
|
|
@@ -48768,9 +48769,9 @@ Tasks (${tasks.length}):
|
|
|
48768
48769
|
);
|
|
48769
48770
|
}
|
|
48770
48771
|
function registerTaskGet(program3) {
|
|
48771
|
-
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(
|
|
48772
48773
|
wrapAction("project:task:get", async (id, options) => {
|
|
48773
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48774
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48774
48775
|
const result = await apiGet(`/api/external/project-tasks/${id}`, apiUrl);
|
|
48775
48776
|
if (options.json) {
|
|
48776
48777
|
printJson4(result);
|
|
@@ -48801,7 +48802,7 @@ function registerTaskCreate(program3) {
|
|
|
48801
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(
|
|
48802
48803
|
"--checklist-file <path>",
|
|
48803
48804
|
"Read checklist items from a JSON file. Relative paths resolve against the project root."
|
|
48804
|
-
).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(
|
|
48805
48806
|
wrapAction(
|
|
48806
48807
|
"project:task:create",
|
|
48807
48808
|
async (options) => {
|
|
@@ -48816,7 +48817,7 @@ function registerTaskCreate(program3) {
|
|
|
48816
48817
|
if (options.description) body.description = options.description;
|
|
48817
48818
|
const checklist = parseChecklistOption2(options);
|
|
48818
48819
|
if (checklist !== void 0) body.checklist = checklist;
|
|
48819
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48820
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48820
48821
|
const result = await apiPost("/api/external/project-tasks", body, apiUrl);
|
|
48821
48822
|
if (!options.milestone) {
|
|
48822
48823
|
process.stderr.write(
|
|
@@ -48850,7 +48851,7 @@ function registerTaskUpdate(program3) {
|
|
|
48850
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(
|
|
48851
48852
|
"--checklist-file <path>",
|
|
48852
48853
|
"Read replacement checklist from a JSON file. Relative paths resolve against the project root."
|
|
48853
|
-
).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(
|
|
48854
48855
|
wrapAction(
|
|
48855
48856
|
"project:task:update",
|
|
48856
48857
|
async (id, options) => {
|
|
@@ -48870,7 +48871,7 @@ function registerTaskUpdate(program3) {
|
|
|
48870
48871
|
);
|
|
48871
48872
|
process.exit(1);
|
|
48872
48873
|
}
|
|
48873
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48874
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48874
48875
|
const result = await apiPatch(`/api/external/project-tasks/${id}`, body, apiUrl);
|
|
48875
48876
|
if (options.json) {
|
|
48876
48877
|
printJson4(result);
|
|
@@ -48890,9 +48891,9 @@ Task updated: ${t.name}`));
|
|
|
48890
48891
|
);
|
|
48891
48892
|
}
|
|
48892
48893
|
function registerTaskDelete(program3) {
|
|
48893
|
-
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(
|
|
48894
48895
|
wrapAction("project:task:delete", async (id, options) => {
|
|
48895
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48896
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48896
48897
|
const result = await apiDelete(`/api/external/project-tasks/${id}`, apiUrl);
|
|
48897
48898
|
if (options.json) {
|
|
48898
48899
|
printJson4(result);
|
|
@@ -48911,9 +48912,9 @@ Task ${id} deleted.`));
|
|
|
48911
48912
|
function registerTaskResume(program3) {
|
|
48912
48913
|
program3.command("project:task:resume <id>").description(
|
|
48913
48914
|
"Fetch the resume_context JSONB for a task (used by /work resume)\n Example: elevasis-sdk project:task:resume <uuid>"
|
|
48914
|
-
).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(
|
|
48915
48916
|
wrapAction("project:task:resume", async (id, options) => {
|
|
48916
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
48917
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
48917
48918
|
const result = await apiGet(`/api/external/project-tasks/${id}`, apiUrl);
|
|
48918
48919
|
const task = result.task;
|
|
48919
48920
|
const ctx = task.resume_context ?? {};
|
|
@@ -48964,7 +48965,7 @@ function registerTaskSave(program3) {
|
|
|
48964
48965
|
program3.command("project:task:save <id>").description(
|
|
48965
48966
|
`Merge fields into resume_context for a task (used by /work save)
|
|
48966
48967
|
Example: elevasis-sdk project:task:save <uuid> --current-state "Implemented X" --files-modified '["src/foo.ts"]'`
|
|
48967
|
-
).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(
|
|
48968
48969
|
wrapAction(
|
|
48969
48970
|
"project:task:save",
|
|
48970
48971
|
async (id, options) => {
|
|
@@ -49004,7 +49005,7 @@ function registerTaskSave(program3) {
|
|
|
49004
49005
|
process.exit(1);
|
|
49005
49006
|
}
|
|
49006
49007
|
}
|
|
49007
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
49008
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
49008
49009
|
const result = await apiPatch(`/api/external/project-tasks/${id}/resume-context`, body, apiUrl);
|
|
49009
49010
|
if (options.json) {
|
|
49010
49011
|
printJson4(result);
|
|
@@ -49193,9 +49194,9 @@ function printJson5(value) {
|
|
|
49193
49194
|
}
|
|
49194
49195
|
var NOTE_TYPE_HELP = NoteTypeSchema.options.join(" | ");
|
|
49195
49196
|
function registerNoteList(program3) {
|
|
49196
|
-
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(
|
|
49197
49198
|
wrapAction("project:note:list", async (options) => {
|
|
49198
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
49199
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
49199
49200
|
const result = await apiGet(`/api/external/projects/${options.project}/notes`, apiUrl);
|
|
49200
49201
|
if (options.json) {
|
|
49201
49202
|
printJson5(result);
|
|
@@ -49225,7 +49226,7 @@ Notes (${notes.length}):
|
|
|
49225
49226
|
function registerNoteCreate(program3) {
|
|
49226
49227
|
program3.command("project:note:create").description(
|
|
49227
49228
|
'Create a note\n Example: elevasis-sdk project:note:create --project <uuid> --content "Status update"'
|
|
49228
|
-
).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(
|
|
49229
49230
|
wrapAction(
|
|
49230
49231
|
"project:note:create",
|
|
49231
49232
|
async (options) => {
|
|
@@ -49236,7 +49237,7 @@ function registerNoteCreate(program3) {
|
|
|
49236
49237
|
if (options.task) body.task_id = options.task;
|
|
49237
49238
|
if (options.milestone) body.milestone_id = options.milestone;
|
|
49238
49239
|
if (options.type) body.type = options.type;
|
|
49239
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
49240
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
49240
49241
|
const result = await apiPost("/api/external/project-notes", body, apiUrl);
|
|
49241
49242
|
if (options.json) {
|
|
49242
49243
|
printJson5(result);
|
|
@@ -49257,9 +49258,9 @@ Note created`));
|
|
|
49257
49258
|
);
|
|
49258
49259
|
}
|
|
49259
49260
|
function registerNoteUpdate(program3) {
|
|
49260
|
-
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(
|
|
49261
49262
|
wrapAction("project:note:update", async (id, options) => {
|
|
49262
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
49263
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
49263
49264
|
const result = await apiPatch(
|
|
49264
49265
|
`/api/external/project-notes/${id}`,
|
|
49265
49266
|
{ content: options.content },
|
|
@@ -49280,9 +49281,9 @@ Note ${id} updated.`));
|
|
|
49280
49281
|
);
|
|
49281
49282
|
}
|
|
49282
49283
|
function registerNoteDelete(program3) {
|
|
49283
|
-
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(
|
|
49284
49285
|
wrapAction("project:note:delete", async (id, options) => {
|
|
49285
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
49286
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
49286
49287
|
const result = await apiDelete(`/api/external/project-notes/${id}`, apiUrl);
|
|
49287
49288
|
if (options.json) {
|
|
49288
49289
|
printJson5(result);
|
|
@@ -51214,7 +51215,7 @@ function registerRequestCommands(program3) {
|
|
|
51214
51215
|
).option("-i, --input <json>", "Request body as JSON string").option(
|
|
51215
51216
|
"-f, --input-file <path>",
|
|
51216
51217
|
"Read request body from a JSON file (e.g. request-report.json, avoids shell escaping). Relative paths resolve against the project root."
|
|
51217
|
-
).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(
|
|
51218
51219
|
"--cleanup-input",
|
|
51219
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)"
|
|
51220
51221
|
).action(
|
|
@@ -51230,7 +51231,7 @@ function registerRequestCommands(program3) {
|
|
|
51230
51231
|
throw new Error(`Invalid request body:
|
|
51231
51232
|
${issues}`);
|
|
51232
51233
|
}
|
|
51233
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51234
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51234
51235
|
const result = await apiPost("/api/external/requests", parsed.data, apiUrl);
|
|
51235
51236
|
if (options.pretty) {
|
|
51236
51237
|
const r = result.request;
|
|
@@ -51264,7 +51265,7 @@ ${issues}`);
|
|
|
51264
51265
|
Example: elevasis-sdk request:list --status open --severity critical
|
|
51265
51266
|
status: ${REQUEST_STATUS_HELP}
|
|
51266
51267
|
severity: ${REQUEST_SEVERITY_HELP}`
|
|
51267
|
-
).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(
|
|
51268
51269
|
wrapAction("request:list", async (options) => {
|
|
51269
51270
|
const params = new URLSearchParams();
|
|
51270
51271
|
if (options.status) params.set("status", options.status);
|
|
@@ -51272,7 +51273,7 @@ ${issues}`);
|
|
|
51272
51273
|
if (options.projectId) params.set("project_id", options.projectId);
|
|
51273
51274
|
if (options.limit) params.set("limit", options.limit);
|
|
51274
51275
|
const qs = params.toString();
|
|
51275
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51276
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51276
51277
|
const result = await apiGet(`/api/external/requests${qs ? `?${qs}` : ""}`, apiUrl);
|
|
51277
51278
|
if (options.pretty) {
|
|
51278
51279
|
const rows = result.requests;
|
|
@@ -51293,9 +51294,9 @@ ${rows.length} request${rows.length === 1 ? "" : "s"}`));
|
|
|
51293
51294
|
);
|
|
51294
51295
|
program3.command("request:get <id>").description(
|
|
51295
51296
|
"Get a reported request by id via GET /api/external/requests/:id\n Example: elevasis-sdk request:get 1a2b3c4d-5e6f-7890-abcd-ef1234567890"
|
|
51296
|
-
).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(
|
|
51297
51298
|
wrapAction("request:get", async (id, options) => {
|
|
51298
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51299
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51299
51300
|
const result = await apiGet(`/api/external/requests/${encodeURIComponent(id)}`, apiUrl);
|
|
51300
51301
|
if (options.pretty) {
|
|
51301
51302
|
const r = result.request;
|
|
@@ -51475,7 +51476,7 @@ function verbose(detail) {
|
|
|
51475
51476
|
console.log(source_default.gray(` ${detail}`));
|
|
51476
51477
|
}
|
|
51477
51478
|
function registerDoctorCommand(program3) {
|
|
51478
|
-
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) => {
|
|
51479
51480
|
const isVerbose = Boolean(options.verbose);
|
|
51480
51481
|
let failCount = 0;
|
|
51481
51482
|
console.log(source_default.cyan("Running Elevasis SDK doctor checks\u2026\n"));
|
|
@@ -51508,7 +51509,7 @@ function registerDoctorCommand(program3) {
|
|
|
51508
51509
|
}
|
|
51509
51510
|
ok(".env", `Found at ${envPath2}`);
|
|
51510
51511
|
if (isVerbose) verbose(`Path: ${envPath2}`);
|
|
51511
|
-
const apiKey = resolveApiKey();
|
|
51512
|
+
const apiKey = resolveApiKey(options.prod);
|
|
51512
51513
|
if (!apiKey) {
|
|
51513
51514
|
fail("API key", "ELEVASIS_PLATFORM_KEY not set or empty.");
|
|
51514
51515
|
if (isVerbose) verbose("Checked process.env.ELEVASIS_PLATFORM_KEY \u2014 not set or empty string");
|
|
@@ -51518,7 +51519,7 @@ function registerDoctorCommand(program3) {
|
|
|
51518
51519
|
}
|
|
51519
51520
|
ok("API key", `Set (length: ${apiKey.length})`);
|
|
51520
51521
|
if (isVerbose) verbose(`Key prefix: ${apiKey.slice(0, 6)}\u2026`);
|
|
51521
|
-
const apiUrl = resolveApiUrl();
|
|
51522
|
+
const apiUrl = resolveApiUrl(void 0, options.prod);
|
|
51522
51523
|
const healthUrl = `${apiUrl}/api/external/health`;
|
|
51523
51524
|
let healthBody;
|
|
51524
51525
|
let healthStatus;
|
|
@@ -51632,11 +51633,11 @@ function dealListId(deal) {
|
|
|
51632
51633
|
return deal.sourceListId ?? deal.source_list_id ?? null;
|
|
51633
51634
|
}
|
|
51634
51635
|
function registerAcquisitionDealList(program3) {
|
|
51635
|
-
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(
|
|
51636
51637
|
wrapAction(
|
|
51637
51638
|
"acquisition:deal:list",
|
|
51638
51639
|
async (options) => {
|
|
51639
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51640
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51640
51641
|
const params = new URLSearchParams();
|
|
51641
51642
|
appendQuery2(params, "stage", options.stage);
|
|
51642
51643
|
appendQuery2(params, "list", options.list);
|
|
@@ -51670,9 +51671,9 @@ Acquisition deals (${result.data.length} of ${result.total}):
|
|
|
51670
51671
|
);
|
|
51671
51672
|
}
|
|
51672
51673
|
function registerAcquisitionDealGet(program3) {
|
|
51673
|
-
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(
|
|
51674
51675
|
wrapAction("acquisition:deal:get", async (id, options) => {
|
|
51675
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51676
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51676
51677
|
const result = await apiGet("/api/external/deals/" + id, apiUrl);
|
|
51677
51678
|
if (!options.pretty) {
|
|
51678
51679
|
printJson6(result);
|
|
@@ -51692,9 +51693,9 @@ Acquisition deal: ${dealEmail(result)}`));
|
|
|
51692
51693
|
);
|
|
51693
51694
|
}
|
|
51694
51695
|
function registerAcquisitionDealStatus(program3) {
|
|
51695
|
-
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(
|
|
51696
51697
|
wrapAction("acquisition:deal:status", async (options) => {
|
|
51697
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51698
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51698
51699
|
const result = await apiGet("/api/external/deals/summary", apiUrl);
|
|
51699
51700
|
if (!options.pretty) {
|
|
51700
51701
|
printJson6(result);
|
|
@@ -51739,11 +51740,11 @@ function renderListSummary(list) {
|
|
|
51739
51740
|
if (list.description) console.log(source_default.gray(` ${list.description}`));
|
|
51740
51741
|
}
|
|
51741
51742
|
function registerAcquisitionListList(program3) {
|
|
51742
|
-
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(
|
|
51743
51744
|
wrapAction(
|
|
51744
51745
|
"acquisition:list:list",
|
|
51745
51746
|
async (options) => {
|
|
51746
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51747
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51747
51748
|
const params = new URLSearchParams();
|
|
51748
51749
|
appendQuery3(params, "status", options.status);
|
|
51749
51750
|
appendQuery3(params, "batch", options.batch);
|
|
@@ -51772,11 +51773,11 @@ Acquisition lists (${result.length}):
|
|
|
51772
51773
|
);
|
|
51773
51774
|
}
|
|
51774
51775
|
function registerAcquisitionListGet(program3) {
|
|
51775
|
-
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(
|
|
51776
51777
|
wrapAction(
|
|
51777
51778
|
"acquisition:list:get",
|
|
51778
51779
|
async (id, options) => {
|
|
51779
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51780
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51780
51781
|
const params = new URLSearchParams();
|
|
51781
51782
|
if (options.includeDeals === false) appendQuery3(params, "includeDeals", false);
|
|
51782
51783
|
appendQuery3(params, "dealLimit", options.dealLimit);
|
|
@@ -51803,9 +51804,9 @@ Acquisition list: ${result.name}`));
|
|
|
51803
51804
|
);
|
|
51804
51805
|
}
|
|
51805
51806
|
function registerAcquisitionListStatus(program3) {
|
|
51806
|
-
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(
|
|
51807
51808
|
wrapAction("acquisition:list:status", async (options) => {
|
|
51808
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51809
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51809
51810
|
const result = await apiGet("/api/external/acquisition/lists/status", apiUrl);
|
|
51810
51811
|
if (!options.pretty) {
|
|
51811
51812
|
printJson7(result);
|
|
@@ -51839,11 +51840,11 @@ function registerAcquisitionCommands(program3) {
|
|
|
51839
51840
|
init_source();
|
|
51840
51841
|
init_config();
|
|
51841
51842
|
function registerClientCreate(program3) {
|
|
51842
|
-
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(
|
|
51843
51844
|
wrapAction(
|
|
51844
51845
|
"client:create",
|
|
51845
51846
|
async (options) => {
|
|
51846
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51847
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51847
51848
|
const body = { name: options.name };
|
|
51848
51849
|
if (options.status !== void 0) body.status = options.status;
|
|
51849
51850
|
if (options.source !== void 0) body.source = options.source;
|
|
@@ -51866,7 +51867,7 @@ Client created: ${result.name}`));
|
|
|
51866
51867
|
);
|
|
51867
51868
|
}
|
|
51868
51869
|
function registerClientUpdate(program3) {
|
|
51869
|
-
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(
|
|
51870
51871
|
wrapAction(
|
|
51871
51872
|
"client:update",
|
|
51872
51873
|
async (id, options) => {
|
|
@@ -51897,7 +51898,8 @@ function registerClientUpdate(program3) {
|
|
|
51897
51898
|
);
|
|
51898
51899
|
process.exit(1);
|
|
51899
51900
|
}
|
|
51900
|
-
const
|
|
51901
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51902
|
+
const client = await resolveClient(id, apiUrl);
|
|
51901
51903
|
const body = {};
|
|
51902
51904
|
if (options.name !== void 0) body.name = options.name;
|
|
51903
51905
|
if (options.status !== void 0) body.status = options.status;
|
|
@@ -51927,7 +51929,6 @@ function registerClientUpdate(program3) {
|
|
|
51927
51929
|
);
|
|
51928
51930
|
process.exit(1);
|
|
51929
51931
|
}
|
|
51930
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
51931
51932
|
const result = await apiPatch(`/api/external/clients/${client.id}`, body, apiUrl);
|
|
51932
51933
|
if (options.pretty) {
|
|
51933
51934
|
console.log(source_default.green(`
|
|
@@ -51943,10 +51944,10 @@ Client updated: ${result.name}`));
|
|
|
51943
51944
|
);
|
|
51944
51945
|
}
|
|
51945
51946
|
function registerClientDelete(program3) {
|
|
51946
|
-
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(
|
|
51947
51948
|
wrapAction("client:delete", async (id, options) => {
|
|
51948
|
-
const
|
|
51949
|
-
const
|
|
51949
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
51950
|
+
const client = await resolveClient(id, apiUrl);
|
|
51950
51951
|
await apiDelete(`/api/external/clients/${client.id}`, apiUrl);
|
|
51951
51952
|
if (options.pretty) {
|
|
51952
51953
|
console.log(source_default.green(`
|
|
@@ -51996,11 +51997,11 @@ function taskTitle(task) {
|
|
|
51996
51997
|
return task.description || task.humanCheckpoint || task.id;
|
|
51997
51998
|
}
|
|
51998
51999
|
function registerQueueList(program3) {
|
|
51999
|
-
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(
|
|
52000
52001
|
wrapAction(
|
|
52001
52002
|
"queue:list",
|
|
52002
52003
|
async (options) => {
|
|
52003
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52004
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52004
52005
|
const params = new URLSearchParams();
|
|
52005
52006
|
appendQuery4(params, "status", options.status);
|
|
52006
52007
|
appendQuery4(params, "humanCheckpoint", options.humanCheckpoint);
|
|
@@ -52037,9 +52038,9 @@ Queue tasks (${result.tasks.length} of ${result.total}):
|
|
|
52037
52038
|
);
|
|
52038
52039
|
}
|
|
52039
52040
|
function registerQueueGet(program3) {
|
|
52040
|
-
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(
|
|
52041
52042
|
wrapAction("queue:get", async (id, options) => {
|
|
52042
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52043
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52043
52044
|
const result = await apiGet(`/api/external/command-queue/${id}`, apiUrl);
|
|
52044
52045
|
if (!options.pretty) {
|
|
52045
52046
|
printJson8(result);
|
|
@@ -52060,11 +52061,11 @@ Queue task: ${taskTitle(task)}`));
|
|
|
52060
52061
|
function registerQueueSelect(program3) {
|
|
52061
52062
|
program3.command("queue:select <id>").description(
|
|
52062
52063
|
"Select and execute a HITL queue action\n Example: elevasis-sdk queue:select <uuid> --action-id approve"
|
|
52063
|
-
).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(
|
|
52064
52065
|
wrapAction(
|
|
52065
52066
|
"queue:select",
|
|
52066
52067
|
async (id, options) => {
|
|
52067
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52068
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52068
52069
|
const body = { actionId: options.actionId };
|
|
52069
52070
|
const payload = parseJsonOption(options.payload, "--payload");
|
|
52070
52071
|
if (payload !== void 0) body.payload = payload;
|
|
@@ -52087,9 +52088,9 @@ Selected action ${options.actionId} for queue task ${id}.`));
|
|
|
52087
52088
|
);
|
|
52088
52089
|
}
|
|
52089
52090
|
function registerQueueExpire(program3) {
|
|
52090
|
-
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(
|
|
52091
52092
|
wrapAction("queue:expire", async (id, options) => {
|
|
52092
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52093
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52093
52094
|
const result = await apiPatch(
|
|
52094
52095
|
`/api/external/command-queue/${id}`,
|
|
52095
52096
|
{ status: "expired" },
|
|
@@ -52107,11 +52108,11 @@ Expired queue task ${id}.`));
|
|
|
52107
52108
|
);
|
|
52108
52109
|
}
|
|
52109
52110
|
function registerQueueStatus(program3) {
|
|
52110
|
-
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(
|
|
52111
52112
|
wrapAction(
|
|
52112
52113
|
"queue:status",
|
|
52113
52114
|
async (options) => {
|
|
52114
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52115
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52115
52116
|
const params = new URLSearchParams();
|
|
52116
52117
|
appendQuery4(params, "timeRange", options.timeRange);
|
|
52117
52118
|
appendQuery4(params, "priorityMin", options.priorityMin);
|
|
@@ -52186,11 +52187,11 @@ function printSchedule(schedule) {
|
|
|
52186
52187
|
if (schedule.nextRunAt) console.log(source_default.gray(` Next: ${new Date(schedule.nextRunAt).toLocaleString()}`));
|
|
52187
52188
|
}
|
|
52188
52189
|
function registerScheduleList(program3) {
|
|
52189
|
-
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(
|
|
52190
52191
|
wrapAction(
|
|
52191
52192
|
"schedule:list",
|
|
52192
52193
|
async (options) => {
|
|
52193
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52194
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52194
52195
|
const params = new URLSearchParams();
|
|
52195
52196
|
appendQuery5(params, "status", options.status);
|
|
52196
52197
|
appendQuery5(params, "targetResourceType", options.targetResourceType);
|
|
@@ -52221,9 +52222,9 @@ Schedules (${result.schedules.length} of ${result.total}):
|
|
|
52221
52222
|
);
|
|
52222
52223
|
}
|
|
52223
52224
|
function registerScheduleGet(program3) {
|
|
52224
|
-
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(
|
|
52225
52226
|
wrapAction("schedule:get", async (id, options) => {
|
|
52226
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52227
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52227
52228
|
const result = await apiGet(
|
|
52228
52229
|
`/api/external/task-scheduler/schedules/${id}`,
|
|
52229
52230
|
apiUrl
|
|
@@ -52250,11 +52251,11 @@ function registerScheduleCreate(program3) {
|
|
|
52250
52251
|
program3.command("schedule:create").description(
|
|
52251
52252
|
`Create a task schedule
|
|
52252
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":{}}'`
|
|
52253
|
-
).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(
|
|
52254
52255
|
wrapAction(
|
|
52255
52256
|
"schedule:create",
|
|
52256
52257
|
async (options) => {
|
|
52257
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52258
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52258
52259
|
const scheduleConfig = parseJsonOption2(options.scheduleConfig, "--schedule-config");
|
|
52259
52260
|
if (scheduleConfig === void 0) throw new Error("--schedule-config is required");
|
|
52260
52261
|
const body = {
|
|
@@ -52292,7 +52293,7 @@ Schedule created: ${result.schedule.name}`));
|
|
|
52292
52293
|
);
|
|
52293
52294
|
}
|
|
52294
52295
|
function registerScheduleUpdate(program3) {
|
|
52295
|
-
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(
|
|
52296
52297
|
wrapAction(
|
|
52297
52298
|
"schedule:update",
|
|
52298
52299
|
async (id, options) => {
|
|
@@ -52324,7 +52325,7 @@ function registerScheduleUpdate(program3) {
|
|
|
52324
52325
|
);
|
|
52325
52326
|
process.exit(1);
|
|
52326
52327
|
}
|
|
52327
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52328
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52328
52329
|
const result = await apiPatch(
|
|
52329
52330
|
`/api/external/task-scheduler/schedules/${id}`,
|
|
52330
52331
|
body,
|
|
@@ -52345,9 +52346,9 @@ Schedule updated: ${result.schedule.name}`));
|
|
|
52345
52346
|
}
|
|
52346
52347
|
function registerScheduleStatusMutation(program3, commandName, description) {
|
|
52347
52348
|
program3.command(`schedule:${commandName} <id>`).description(`${description}
|
|
52348
|
-
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(
|
|
52349
52350
|
wrapAction(`schedule:${commandName}`, async (id, options) => {
|
|
52350
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52351
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52351
52352
|
const result = await apiPost(
|
|
52352
52353
|
`/api/external/task-scheduler/schedules/${id}/${commandName}`,
|
|
52353
52354
|
{},
|
|
@@ -52394,7 +52395,7 @@ var PRIORITY_HELP = "low | normal | high | urgent";
|
|
|
52394
52395
|
function registerNoteCreate2(program3) {
|
|
52395
52396
|
program3.command("note:create").description(
|
|
52396
52397
|
'Create a personal note for a user\n Example: elevasis-sdk note:create --content "Deal X stalled" --user agent@example.com'
|
|
52397
|
-
).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(
|
|
52398
52399
|
wrapAction(
|
|
52399
52400
|
"note:create",
|
|
52400
52401
|
async (options) => {
|
|
@@ -52406,7 +52407,7 @@ function registerNoteCreate2(program3) {
|
|
|
52406
52407
|
if (options.priority) body.priority = options.priority;
|
|
52407
52408
|
if (options.pinned) body.pinned = true;
|
|
52408
52409
|
if (options.source) body.source = options.source;
|
|
52409
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52410
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52410
52411
|
const result = await apiPost("/api/external/user-notes", body, apiUrl);
|
|
52411
52412
|
if (options.pretty) {
|
|
52412
52413
|
const n = result.note;
|
|
@@ -52424,7 +52425,7 @@ Note created`));
|
|
|
52424
52425
|
);
|
|
52425
52426
|
}
|
|
52426
52427
|
function registerNoteList2(program3) {
|
|
52427
|
-
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(
|
|
52428
52429
|
wrapAction(
|
|
52429
52430
|
"note:list",
|
|
52430
52431
|
async (options) => {
|
|
@@ -52434,7 +52435,7 @@ function registerNoteList2(program3) {
|
|
|
52434
52435
|
if (options.pinned) params.set("pinned", "true");
|
|
52435
52436
|
if (options.limit) params.set("limit", options.limit);
|
|
52436
52437
|
if (options.offset) params.set("offset", options.offset);
|
|
52437
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52438
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52438
52439
|
const result = await apiGet(`/api/external/user-notes?${params.toString()}`, apiUrl);
|
|
52439
52440
|
if (options.pretty) {
|
|
52440
52441
|
const notes = result.notes;
|
|
@@ -52475,9 +52476,9 @@ function printJson10(value) {
|
|
|
52475
52476
|
console.log(JSON.stringify(value, null, 2));
|
|
52476
52477
|
}
|
|
52477
52478
|
function registerAgentList(program3) {
|
|
52478
|
-
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(
|
|
52479
52480
|
wrapAction("agent:list", async (options) => {
|
|
52480
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52481
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52481
52482
|
const result = await apiGet("/api/external/resources", apiUrl);
|
|
52482
52483
|
const agents = result.resources.filter((resource) => getResourceType2(resource) === "agent");
|
|
52483
52484
|
if (options.json) {
|
|
@@ -52504,9 +52505,9 @@ function registerAgentList(program3) {
|
|
|
52504
52505
|
);
|
|
52505
52506
|
}
|
|
52506
52507
|
function registerAgentGet(program3) {
|
|
52507
|
-
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(
|
|
52508
52509
|
wrapAction("agent:get", async (id, options) => {
|
|
52509
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52510
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52510
52511
|
const definition = await apiGet(`/api/external/resources/${id}/definition`, apiUrl);
|
|
52511
52512
|
if (options.json) {
|
|
52512
52513
|
printJson10(definition);
|
|
@@ -52643,9 +52644,9 @@ function printMessage(message) {
|
|
|
52643
52644
|
}
|
|
52644
52645
|
}
|
|
52645
52646
|
function registerSessionCreate(program3) {
|
|
52646
|
-
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(
|
|
52647
52648
|
wrapAction("session:create", async (resourceId, options) => {
|
|
52648
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52649
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52649
52650
|
const body = { resourceId };
|
|
52650
52651
|
if (options.userId) body.userId = options.userId;
|
|
52651
52652
|
if (options.metadata) body.metadata = parseJson(options.metadata, "--metadata");
|
|
@@ -52662,9 +52663,9 @@ function registerSessionCreate(program3) {
|
|
|
52662
52663
|
);
|
|
52663
52664
|
}
|
|
52664
52665
|
function registerSessionList(program3) {
|
|
52665
|
-
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(
|
|
52666
52667
|
wrapAction("session:list", async (options) => {
|
|
52667
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52668
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52668
52669
|
const params = new URLSearchParams();
|
|
52669
52670
|
appendQuery6(params, "resourceId", options.resourceId);
|
|
52670
52671
|
appendQuery6(params, "userId", options.userId);
|
|
@@ -52692,9 +52693,9 @@ function registerSessionList(program3) {
|
|
|
52692
52693
|
);
|
|
52693
52694
|
}
|
|
52694
52695
|
function registerSessionGet(program3) {
|
|
52695
|
-
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(
|
|
52696
52697
|
wrapAction("session:get", async (id, options) => {
|
|
52697
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52698
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52698
52699
|
const session = await apiGet(`/api/external/sessions/${id}`, apiUrl);
|
|
52699
52700
|
if (options.json) {
|
|
52700
52701
|
printJson11(session);
|
|
@@ -52713,9 +52714,9 @@ function registerSessionGet(program3) {
|
|
|
52713
52714
|
);
|
|
52714
52715
|
}
|
|
52715
52716
|
function registerSessionTurn(program3) {
|
|
52716
|
-
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(
|
|
52717
52718
|
wrapAction("session:turn", async (id, options) => {
|
|
52718
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52719
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52719
52720
|
const input = resolveTurnInput(options);
|
|
52720
52721
|
const result = await apiPost(`/api/external/sessions/${id}/turns`, { input }, apiUrl);
|
|
52721
52722
|
if (options.json) {
|
|
@@ -52746,9 +52747,9 @@ function registerSessionTurn(program3) {
|
|
|
52746
52747
|
);
|
|
52747
52748
|
}
|
|
52748
52749
|
function registerSessionMessages(program3) {
|
|
52749
|
-
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(
|
|
52750
52751
|
wrapAction("session:messages", async (id, options) => {
|
|
52751
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52752
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52752
52753
|
const result = await fetchSessionMessages(id, apiUrl, options);
|
|
52753
52754
|
if (options.json) {
|
|
52754
52755
|
printJson11(result);
|
|
@@ -52768,9 +52769,9 @@ function registerSessionMessages(program3) {
|
|
|
52768
52769
|
);
|
|
52769
52770
|
}
|
|
52770
52771
|
function registerSessionEnd(program3) {
|
|
52771
|
-
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(
|
|
52772
52773
|
wrapAction("session:end", async (id, options) => {
|
|
52773
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52774
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52774
52775
|
const result = await apiPost(
|
|
52775
52776
|
`/api/external/sessions/${id}/end`,
|
|
52776
52777
|
{},
|
|
@@ -52862,9 +52863,9 @@ function printGrant(grant) {
|
|
|
52862
52863
|
if (grant.disabledAt) console.log(source_default.gray(` Disabled: ${new Date(grant.disabledAt).toLocaleString()}`));
|
|
52863
52864
|
}
|
|
52864
52865
|
function registerGrantList(program3) {
|
|
52865
|
-
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(
|
|
52866
52867
|
wrapAction("grant:list", async (options) => {
|
|
52867
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52868
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52868
52869
|
const params = new URLSearchParams();
|
|
52869
52870
|
appendQuery7(params, "resourceId", options.resourceId);
|
|
52870
52871
|
appendQuery7(params, "includeDisabled", options.includeDisabled ? "true" : void 0);
|
|
@@ -52889,7 +52890,7 @@ function registerGrantList(program3) {
|
|
|
52889
52890
|
);
|
|
52890
52891
|
}
|
|
52891
52892
|
function registerGrantCreate(program3) {
|
|
52892
|
-
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(
|
|
52893
52894
|
wrapAction("grant:create", async (options) => {
|
|
52894
52895
|
const mode = options.mode ?? "public";
|
|
52895
52896
|
if (mode !== "public" && mode !== "code") {
|
|
@@ -52918,7 +52919,7 @@ function registerGrantCreate(program3) {
|
|
|
52918
52919
|
if (captureFields !== void 0) body.captureFields = captureFields;
|
|
52919
52920
|
const toolPolicy = parseJson2(options.toolPolicy, "--tool-policy");
|
|
52920
52921
|
if (toolPolicy !== void 0) body.toolPolicy = toolPolicy;
|
|
52921
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52922
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52922
52923
|
const result = await apiPost("/api/external/agent-access-grants", body, apiUrl);
|
|
52923
52924
|
if (options.json) {
|
|
52924
52925
|
printJson12(result.grant);
|
|
@@ -52931,7 +52932,7 @@ function registerGrantCreate(program3) {
|
|
|
52931
52932
|
);
|
|
52932
52933
|
}
|
|
52933
52934
|
function registerGrantUpdate(program3) {
|
|
52934
|
-
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(
|
|
52935
52936
|
wrapAction("grant:update", async (slug, options) => {
|
|
52936
52937
|
const body = {};
|
|
52937
52938
|
if (options.mode !== void 0) {
|
|
@@ -52957,7 +52958,7 @@ function registerGrantUpdate(program3) {
|
|
|
52957
52958
|
if (Object.keys(body).length === 0) {
|
|
52958
52959
|
throw new Error("Provide at least one field to update (e.g. --branding, --mode, --max-turns)");
|
|
52959
52960
|
}
|
|
52960
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52961
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52961
52962
|
const result = await apiPatch(
|
|
52962
52963
|
`/api/external/agent-access-grants/${encodeURIComponent(slug)}`,
|
|
52963
52964
|
body,
|
|
@@ -52974,9 +52975,9 @@ function registerGrantUpdate(program3) {
|
|
|
52974
52975
|
);
|
|
52975
52976
|
}
|
|
52976
52977
|
function registerGrantDisable(program3) {
|
|
52977
|
-
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(
|
|
52978
52979
|
wrapAction("grant:disable", async (slug, options) => {
|
|
52979
|
-
const apiUrl = resolveApiUrl(options.apiUrl);
|
|
52980
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
52980
52981
|
const result = await apiPost(
|
|
52981
52982
|
`/api/external/agent-access-grants/${encodeURIComponent(slug)}/disable`,
|
|
52982
52983
|
{},
|
|
@@ -52999,6 +53000,341 @@ function registerGrantCommands(program3) {
|
|
|
52999
53000
|
registerGrantDisable(program3);
|
|
53000
53001
|
}
|
|
53001
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
|
+
|
|
53002
53338
|
// src/cli/commands/om/index.ts
|
|
53003
53339
|
function registerOmScaffoldCommands(program3) {
|
|
53004
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) => {
|
|
@@ -53206,7 +53542,7 @@ function runPreflight() {
|
|
|
53206
53542
|
);
|
|
53207
53543
|
process.exit(1);
|
|
53208
53544
|
}
|
|
53209
|
-
if (!
|
|
53545
|
+
if (!resolveApiKey()) {
|
|
53210
53546
|
process.stderr.write(source_default.red(`\`ELEVASIS_PLATFORM_KEY\` missing from \`${envPath2}\`.
|
|
53211
53547
|
`));
|
|
53212
53548
|
process.stderr.write(source_default.gray("Remediation: add ELEVASIS_PLATFORM_KEY=sk_... to your .env file.\n"));
|
|
@@ -53232,6 +53568,8 @@ Commands:
|
|
|
53232
53568
|
elevasis-sdk exec <resourceId> -i '{}' Execute a resource
|
|
53233
53569
|
elevasis-sdk executions <resourceId> List execution history
|
|
53234
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)
|
|
53235
53573
|
elevasis-sdk deployments List deployments
|
|
53236
53574
|
elevasis-sdk project:list [--search <query>] List projects with optional search
|
|
53237
53575
|
elevasis-sdk project:resolve <query> Resolve a project ID from a name or UUID
|
|
@@ -53280,6 +53618,8 @@ registerExecCommand(program2);
|
|
|
53280
53618
|
registerResourcesCommand(program2);
|
|
53281
53619
|
registerExecutionsCommand(program2);
|
|
53282
53620
|
registerExecutionCommand(program2);
|
|
53621
|
+
registerExecutionCancelCommand(program2);
|
|
53622
|
+
registerExecutionsDeleteCommand(program2);
|
|
53283
53623
|
registerDescribeCommand(program2);
|
|
53284
53624
|
registerDeploymentsCommand(program2);
|
|
53285
53625
|
registerCredsCommand(program2);
|
|
@@ -53300,6 +53640,7 @@ registerUiCommands(program2);
|
|
|
53300
53640
|
registerDoctorCommand(program2);
|
|
53301
53641
|
registerCliCatalogCommand(program2);
|
|
53302
53642
|
registerOmScaffoldCommands(program2);
|
|
53643
|
+
registerOmDoctorCommand(program2);
|
|
53303
53644
|
registerSkillScaffoldCommand(program2);
|
|
53304
53645
|
registerSkillCheckCoverageCommand(program2);
|
|
53305
53646
|
try {
|