@elevasis/sdk 1.47.0 → 1.48.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 +297 -93
- package/dist/index.d.ts +2 -2
- package/dist/index.js +23 -7
- package/dist/node/index.d.ts +2 -2
- package/dist/test-utils/index.d.ts +2 -2
- package/dist/test-utils/index.js +35 -7
- package/dist/worker/index.d.ts +24 -14
- package/dist/worker/index.js +6 -0
- package/package.json +4 -4
- package/reference/_navigation.md +3 -2
- package/reference/_reference-manifest.json +11 -1
- package/reference/packages/core/src/organization-model/README.md +9 -6
- package/reference/rules/content.md +27 -0
- package/reference/rules/organization-model.md +9 -3
- package/reference/rules/organization-os.md +2 -2
- package/reference/rules/vibe-intents.md +18 -15
- package/reference/rules/vibe.md +12 -12
- package/reference/scaffold/recipes/add-a-feature.md +1 -1
- package/reference/scaffold/recipes/customize-organization-model.md +2 -2
- package/reference/scaffold/recipes/extend-content.md +91 -28
- package/reference/scaffold/reference/glossary.md +2 -2
- package/reference/scaffold/reference/system-interface-capabilities.md +26 -6
- package/reference/sdk/cli-management.mdx +85 -23
- package/reference/sdk/platform-tools/adapters-platform.mdx +5 -5
package/dist/cli.cjs
CHANGED
|
@@ -22703,7 +22703,7 @@ var init_ontology = __esm({
|
|
|
22703
22703
|
sharedProperties: external_exports.record(OntologyIdSchema, OntologySharedPropertySchema).default({}).optional(),
|
|
22704
22704
|
groups: external_exports.record(OntologyIdSchema, OntologyGroupSchema).default({}).optional(),
|
|
22705
22705
|
endpoints: external_exports.record(OntologyIdSchema, OntologyEndpointTypeSchema).default({}).optional()
|
|
22706
|
-
}).default({});
|
|
22706
|
+
}).strict().default({});
|
|
22707
22707
|
DEFAULT_ONTOLOGY_SCOPE = {
|
|
22708
22708
|
valueTypes: {
|
|
22709
22709
|
"global:value-type/uuid": {
|
|
@@ -23551,12 +23551,12 @@ var init_profile_registry = __esm({
|
|
|
23551
23551
|
|
|
23552
23552
|
// ../core/src/organization-model/domains/systems.ts
|
|
23553
23553
|
function isReservedPlatformProfileId(profileId) {
|
|
23554
|
-
return
|
|
23554
|
+
return BUILT_IN_VALIDATED_PROFILE_IDS.includes(profileId);
|
|
23555
23555
|
}
|
|
23556
23556
|
function isBuiltInReadinessProfile(profileId) {
|
|
23557
23557
|
return isReservedPlatformProfileId(profileId) || getBuiltInReadinessProfile(profileId) !== void 0;
|
|
23558
23558
|
}
|
|
23559
|
-
var SystemKindSchema, SystemLifecycleSchema, SystemIdSchema, SystemPathSchema, UiPositionSchema, NodeIdStringSchema, SystemUiSchema, SystemInterfaceKeySchema, SystemInterfaceLifecycleSchema, SYSTEM_INTERFACE_PROFILES, SYSTEM_INTERFACE_READINESS_PROFILES, SystemInterfaceReadinessProfileSchema, SystemInterfaceResourceScopeSchema, SystemApiInterfaceReadinessContractSchema, SystemApiInterfaceSchema, SystemInterfaceRefSchema, JsonValueSchema, SystemConfigSchema, SystemEntrySchema, SystemsDomainSchema, DEFAULT_ORGANIZATION_MODEL_SYSTEMS;
|
|
23559
|
+
var SystemKindSchema, SystemLifecycleSchema, SystemIdSchema, SystemPathSchema, UiPositionSchema, NodeIdStringSchema, SystemUiSchema, SystemInterfaceKeySchema, SystemInterfaceLifecycleSchema, SYSTEM_INTERFACE_PROFILES, SYSTEM_INTERFACE_READINESS_PROFILES, BUILT_IN_VALIDATED_PROFILE_IDS, SystemInterfaceReadinessProfileSchema, SystemInterfaceResourceScopeSchema, SystemApiInterfaceReadinessContractSchema, SystemApiInterfaceSchema, SystemInterfaceRefSchema, JsonValueSchema, SystemConfigSchema, SystemEntrySchema, SystemsDomainSchema, DEFAULT_ORGANIZATION_MODEL_SYSTEMS;
|
|
23560
23560
|
var init_systems = __esm({
|
|
23561
23561
|
"../core/src/organization-model/domains/systems.ts"() {
|
|
23562
23562
|
"use strict";
|
|
@@ -23581,29 +23581,45 @@ var init_systems = __esm({
|
|
|
23581
23581
|
path: PathSchema,
|
|
23582
23582
|
surfaces: ReferenceIdsSchema,
|
|
23583
23583
|
icon: IconNameSchema.optional()
|
|
23584
|
-
});
|
|
23584
|
+
}).strict();
|
|
23585
23585
|
SystemInterfaceKeySchema = ModelIdSchema;
|
|
23586
23586
|
SystemInterfaceLifecycleSchema = external_exports.enum(["draft", "active", "disabled", "deprecated", "archived"]).meta({ label: "System interface lifecycle", color: "teal" });
|
|
23587
23587
|
SYSTEM_INTERFACE_PROFILES = [
|
|
23588
23588
|
{
|
|
23589
23589
|
systemPath: "sales.lead-gen",
|
|
23590
23590
|
interfaceKey: "api",
|
|
23591
|
-
readinessProfile: "sales.lead-gen.api"
|
|
23591
|
+
readinessProfile: "sales.lead-gen.api",
|
|
23592
|
+
validation: "built-in"
|
|
23592
23593
|
},
|
|
23593
23594
|
{
|
|
23594
23595
|
systemPath: "sales.crm",
|
|
23595
23596
|
interfaceKey: "api",
|
|
23596
|
-
readinessProfile: "sales.crm.api"
|
|
23597
|
+
readinessProfile: "sales.crm.api",
|
|
23598
|
+
validation: "built-in"
|
|
23597
23599
|
},
|
|
23598
23600
|
{
|
|
23599
23601
|
systemPath: "sales.lead-gen",
|
|
23600
23602
|
interfaceKey: "crm-handoff",
|
|
23601
|
-
readinessProfile: "sales.lead-gen.crm-handoff"
|
|
23603
|
+
readinessProfile: "sales.lead-gen.crm-handoff",
|
|
23604
|
+
validation: "built-in"
|
|
23605
|
+
},
|
|
23606
|
+
{
|
|
23607
|
+
// Gated by `CONTENT_API_INTERFACE` in `apps/api/src/business/content/organization-model.ts`,
|
|
23608
|
+
// which every `/api/content/*` and `/api/external/content/*` route asserts. Contract-validated
|
|
23609
|
+
// rather than built-in because the required step catalog is per-adopter: Elevasis declares
|
|
23610
|
+
// `content:catalog/long-form-to-shorts-steps`, a tenant declares its own.
|
|
23611
|
+
systemPath: "content",
|
|
23612
|
+
interfaceKey: "api",
|
|
23613
|
+
readinessProfile: "content.api",
|
|
23614
|
+
validation: "contract"
|
|
23602
23615
|
}
|
|
23603
23616
|
];
|
|
23604
23617
|
SYSTEM_INTERFACE_READINESS_PROFILES = SYSTEM_INTERFACE_PROFILES.map(
|
|
23605
23618
|
(profile) => profile.readinessProfile
|
|
23606
23619
|
);
|
|
23620
|
+
BUILT_IN_VALIDATED_PROFILE_IDS = SYSTEM_INTERFACE_PROFILES.filter(
|
|
23621
|
+
(profile) => profile.validation === "built-in"
|
|
23622
|
+
).map((profile) => profile.readinessProfile);
|
|
23607
23623
|
SystemInterfaceReadinessProfileSchema = external_exports.string().trim().min(1);
|
|
23608
23624
|
SystemInterfaceResourceScopeSchema = external_exports.array(ModelIdSchema).default([]);
|
|
23609
23625
|
SystemApiInterfaceReadinessContractSchema = external_exports.object({
|
|
@@ -25013,7 +25029,7 @@ var init_foundation = __esm({
|
|
|
25013
25029
|
});
|
|
25014
25030
|
|
|
25015
25031
|
// ../core/src/organization-model/catalogs/content.ts
|
|
25016
|
-
var ContentPipelineStepActorSchema, ContentPipelineStepReviewModeSchema, ContentPayloadFieldTypeSchema, ContentPayloadFieldDeclarationSchema, ContentPipelineStepDeclarationSchema, ContentSourceAssetKindDeclarationSchema;
|
|
25032
|
+
var ContentPipelineStepActorSchema, ContentPipelineStepReviewModeSchema, ContentPayloadFieldTypeSchema, ContentPayloadFieldDeclarationSchema, ContentWorkspaceRouteSchema, ContentPipelineStepDeclarationSchema, ContentSourceAssetKindDeclarationSchema;
|
|
25017
25033
|
var init_content = __esm({
|
|
25018
25034
|
"../core/src/organization-model/catalogs/content.ts"() {
|
|
25019
25035
|
"use strict";
|
|
@@ -25027,6 +25043,7 @@ var init_content = __esm({
|
|
|
25027
25043
|
type: ContentPayloadFieldTypeSchema,
|
|
25028
25044
|
required: external_exports.boolean().optional()
|
|
25029
25045
|
});
|
|
25046
|
+
ContentWorkspaceRouteSchema = external_exports.string().trim().min(1).max(400).regex(/^\//, 'workspaceRoute must be an app-relative path beginning with "/"');
|
|
25030
25047
|
ContentPipelineStepDeclarationSchema = external_exports.object({
|
|
25031
25048
|
label: external_exports.string().trim().min(1).max(160).optional(),
|
|
25032
25049
|
description: external_exports.string().trim().min(1).max(2e3).optional(),
|
|
@@ -25052,6 +25069,16 @@ var init_content = __esm({
|
|
|
25052
25069
|
* Resource at all.
|
|
25053
25070
|
*/
|
|
25054
25071
|
actionId: external_exports.string().trim().min(1).max(200).optional(),
|
|
25072
|
+
/**
|
|
25073
|
+
* Per-step override of the pipeline's `workspaceRoute`. Absent on almost every
|
|
25074
|
+
* step -- the pipeline-level route is the common case, and this exists for the
|
|
25075
|
+
* chains whose gates are genuinely different screens (the video pipeline
|
|
25076
|
+
* reviews text candidates, then rendered video, then copy plus a schedule).
|
|
25077
|
+
*
|
|
25078
|
+
* Resolution is override-then-fallback: a display surface takes this when the
|
|
25079
|
+
* step declares one and the pipeline's otherwise. See `ContentWorkspaceRouteSchema`.
|
|
25080
|
+
*/
|
|
25081
|
+
workspaceRoute: ContentWorkspaceRouteSchema.optional(),
|
|
25055
25082
|
payloadFields: external_exports.array(ContentPayloadFieldDeclarationSchema).default([])
|
|
25056
25083
|
});
|
|
25057
25084
|
ContentSourceAssetKindDeclarationSchema = external_exports.object({
|
|
@@ -48837,7 +48864,7 @@ var init_package = __esm({
|
|
|
48837
48864
|
"package.json"() {
|
|
48838
48865
|
package_default = {
|
|
48839
48866
|
name: "@elevasis/sdk",
|
|
48840
|
-
version: "1.
|
|
48867
|
+
version: "1.48.0",
|
|
48841
48868
|
description: "SDK for building Elevasis organization resources",
|
|
48842
48869
|
type: "module",
|
|
48843
48870
|
bin: {
|
|
@@ -49441,18 +49468,18 @@ function getOrganizationModelDir(projectDir) {
|
|
|
49441
49468
|
}
|
|
49442
49469
|
function assertSplitLayout(projectDir) {
|
|
49443
49470
|
const omDir = getOrganizationModelDir(projectDir);
|
|
49444
|
-
const missing = REQUIRED_FILES.filter((f) => !(0,
|
|
49471
|
+
const missing = REQUIRED_FILES.filter((f) => !(0, import_node_fs14.existsSync)((0, import_node_path11.join)(omDir, f)));
|
|
49445
49472
|
if (missing.length > 0) {
|
|
49446
49473
|
throw new Error(
|
|
49447
49474
|
"Legacy single-file OM layout detected. Split into `core/config/organization-model/{profile.ts, systems.ts, navigation.ts}` before scaffolding."
|
|
49448
49475
|
);
|
|
49449
49476
|
}
|
|
49450
49477
|
}
|
|
49451
|
-
var
|
|
49478
|
+
var import_node_fs14, import_node_path11, REQUIRED_FILES;
|
|
49452
49479
|
var init_project_layout = __esm({
|
|
49453
49480
|
"src/cli/commands/om/project-layout.ts"() {
|
|
49454
49481
|
"use strict";
|
|
49455
|
-
|
|
49482
|
+
import_node_fs14 = require("node:fs");
|
|
49456
49483
|
import_node_path11 = require("node:path");
|
|
49457
49484
|
REQUIRED_FILES = ["profile.ts", "systems.ts", "navigation.ts"];
|
|
49458
49485
|
}
|
|
@@ -49552,8 +49579,9 @@ function emitSystemEntry(opts) {
|
|
|
49552
49579
|
lifecycle: 'active',${apiInterfaceBlock}
|
|
49553
49580
|
},
|
|
49554
49581
|
`;
|
|
49582
|
+
const startAnchor = /^(?!\s*(?:\/\/|\*|\/\*)).*\bexport const templateSystems\s*=/m;
|
|
49555
49583
|
const anchor = /^\] as const\s*$/m;
|
|
49556
|
-
return { code, anchor, apiInterfaceNote };
|
|
49584
|
+
return { code, startAnchor, anchor, apiInterfaceNote };
|
|
49557
49585
|
}
|
|
49558
49586
|
var init_emit_system = __esm({
|
|
49559
49587
|
"src/cli/commands/om/emit-system.ts"() {
|
|
@@ -49567,7 +49595,7 @@ async function withSnapshotRollback(filePaths, op) {
|
|
|
49567
49595
|
const snapshots = /* @__PURE__ */ new Map();
|
|
49568
49596
|
for (const filePath of filePaths) {
|
|
49569
49597
|
try {
|
|
49570
|
-
snapshots.set(filePath, (0,
|
|
49598
|
+
snapshots.set(filePath, (0, import_node_fs15.readFileSync)(filePath, "utf8"));
|
|
49571
49599
|
} catch {
|
|
49572
49600
|
snapshots.set(filePath, null);
|
|
49573
49601
|
}
|
|
@@ -49578,7 +49606,7 @@ async function withSnapshotRollback(filePaths, op) {
|
|
|
49578
49606
|
for (const [filePath, snapshot] of snapshots) {
|
|
49579
49607
|
if (snapshot !== null) {
|
|
49580
49608
|
try {
|
|
49581
|
-
(0,
|
|
49609
|
+
(0, import_node_fs15.writeFileSync)(filePath, snapshot, "utf8");
|
|
49582
49610
|
} catch {
|
|
49583
49611
|
}
|
|
49584
49612
|
}
|
|
@@ -49615,9 +49643,9 @@ function reindent(code, baseIndent, extraIndent) {
|
|
|
49615
49643
|
return lines.map((line) => line.trim() === "" ? line : baseIndent + extraIndent + line.slice(firstIndent.length)).join("\n");
|
|
49616
49644
|
}
|
|
49617
49645
|
async function appendBeforeAnchor(filePath, code, anchor, startAnchor) {
|
|
49618
|
-
const content = (0,
|
|
49646
|
+
const content = (0, import_node_fs15.readFileSync)(filePath, "utf8");
|
|
49619
49647
|
if (startAnchor === void 0) {
|
|
49620
|
-
(0,
|
|
49648
|
+
(0, import_node_fs15.writeFileSync)(filePath, insertBeforeAnchorInContent(content, code, anchor), "utf8");
|
|
49621
49649
|
return;
|
|
49622
49650
|
}
|
|
49623
49651
|
const lines = content.split("\n");
|
|
@@ -49647,12 +49675,12 @@ async function appendBeforeAnchor(filePath, code, anchor, startAnchor) {
|
|
|
49647
49675
|
lines[previousIndex] = previous.trimEnd() + ",";
|
|
49648
49676
|
}
|
|
49649
49677
|
lines.splice(anchorIndex, 0, ...indented.split("\n"));
|
|
49650
|
-
(0,
|
|
49678
|
+
(0, import_node_fs15.writeFileSync)(filePath, lines.join("\n"), "utf8");
|
|
49651
49679
|
}
|
|
49652
49680
|
async function applyConstImport(systemsFilePath, importLine, fieldLine, importAnchor, fieldAnchor, newConstFilePath, newConstFileCode) {
|
|
49653
|
-
(0,
|
|
49654
|
-
(0,
|
|
49655
|
-
const systemsContent = (0,
|
|
49681
|
+
(0, import_node_fs15.mkdirSync)((0, import_node_path12.dirname)(newConstFilePath), { recursive: true });
|
|
49682
|
+
(0, import_node_fs15.writeFileSync)(newConstFilePath, newConstFileCode, "utf8");
|
|
49683
|
+
const systemsContent = (0, import_node_fs15.readFileSync)(systemsFilePath, "utf8");
|
|
49656
49684
|
const afterImport = insertBeforeAnchorInContent(systemsContent, importLine + "\n", importAnchor);
|
|
49657
49685
|
const lines = afterImport.split("\n");
|
|
49658
49686
|
const fieldAnchorIndex = findAnchorLineIndex(lines, afterImport, fieldAnchor);
|
|
@@ -49662,13 +49690,13 @@ async function applyConstImport(systemsFilePath, importLine, fieldLine, importAn
|
|
|
49662
49690
|
);
|
|
49663
49691
|
}
|
|
49664
49692
|
lines.splice(fieldAnchorIndex + 1, 0, fieldLine);
|
|
49665
|
-
(0,
|
|
49693
|
+
(0, import_node_fs15.writeFileSync)(systemsFilePath, lines.join("\n"), "utf8");
|
|
49666
49694
|
}
|
|
49667
|
-
var
|
|
49695
|
+
var import_node_fs15, import_node_path12;
|
|
49668
49696
|
var init_splice = __esm({
|
|
49669
49697
|
"src/cli/commands/om/splice.ts"() {
|
|
49670
49698
|
"use strict";
|
|
49671
|
-
|
|
49699
|
+
import_node_fs15 = require("node:fs");
|
|
49672
49700
|
import_node_path12 = require("node:path");
|
|
49673
49701
|
}
|
|
49674
49702
|
});
|
|
@@ -49720,7 +49748,7 @@ async function scaffoldSystem(opts) {
|
|
|
49720
49748
|
});
|
|
49721
49749
|
apiBacked = answer.trim().toLowerCase() === "y";
|
|
49722
49750
|
}
|
|
49723
|
-
const { code, anchor, apiInterfaceNote } = emitSystemEntry({ id, title, kind, apiBacked });
|
|
49751
|
+
const { code, anchor, startAnchor, apiInterfaceNote } = emitSystemEntry({ id, title, kind, apiBacked });
|
|
49724
49752
|
const shouldWrite = options.write === true || options.dryRun === false;
|
|
49725
49753
|
if (!shouldWrite) {
|
|
49726
49754
|
console.log(source_default.cyan("Dry-run mode (default) \u2014 no files written. Pass --write to apply.\n"));
|
|
@@ -49734,7 +49762,7 @@ async function scaffoldSystem(opts) {
|
|
|
49734
49762
|
const systemsFilePath = (0, import_node_path13.join)(getOrganizationModelDir(projectDir), "systems.ts");
|
|
49735
49763
|
try {
|
|
49736
49764
|
await withSnapshotRollback([systemsFilePath], async () => {
|
|
49737
|
-
await appendBeforeAnchor(systemsFilePath, code, anchor);
|
|
49765
|
+
await appendBeforeAnchor(systemsFilePath, code, anchor, startAnchor);
|
|
49738
49766
|
const validationError = runValidation(projectDir);
|
|
49739
49767
|
if (validationError !== null) {
|
|
49740
49768
|
throw new Error(validationError);
|
|
@@ -49786,8 +49814,9 @@ function emitResourceEntry(opts) {
|
|
|
49786
49814
|
${ontologyBlock} codeRefs: []
|
|
49787
49815
|
},
|
|
49788
49816
|
`;
|
|
49789
|
-
const
|
|
49790
|
-
|
|
49817
|
+
const startAnchor = /^(?!\s*(?:\/\/|\*|\/\*)).*\btemplateResourceDescriptors\s*=/m;
|
|
49818
|
+
const anchor = /^\}/m;
|
|
49819
|
+
return { code, startAnchor, anchor };
|
|
49791
49820
|
}
|
|
49792
49821
|
var init_emit_resource = __esm({
|
|
49793
49822
|
"src/cli/commands/om/emit-resource.ts"() {
|
|
@@ -49841,7 +49870,7 @@ async function scaffoldResource(opts) {
|
|
|
49841
49870
|
{ default: "" }
|
|
49842
49871
|
);
|
|
49843
49872
|
const primaryAction = rawPrimaryAction || void 0;
|
|
49844
|
-
const { code, anchor } = emitResourceEntry({ id, systemPath, title, primaryAction });
|
|
49873
|
+
const { code, anchor, startAnchor } = emitResourceEntry({ id, systemPath, title, primaryAction });
|
|
49845
49874
|
const shouldWrite = options.write === true || options.dryRun === false;
|
|
49846
49875
|
if (!shouldWrite) {
|
|
49847
49876
|
console.log(source_default.cyan("Dry-run mode (default) \u2014 no files written. Pass --write to apply.\n"));
|
|
@@ -49852,7 +49881,7 @@ async function scaffoldResource(opts) {
|
|
|
49852
49881
|
const systemsFilePath = (0, import_node_path14.join)(getOrganizationModelDir(projectDir), "systems.ts");
|
|
49853
49882
|
try {
|
|
49854
49883
|
await withSnapshotRollback([systemsFilePath], async () => {
|
|
49855
|
-
await appendBeforeAnchor(systemsFilePath, code, anchor);
|
|
49884
|
+
await appendBeforeAnchor(systemsFilePath, code, anchor, startAnchor);
|
|
49856
49885
|
const validationError = runValidation2(projectDir);
|
|
49857
49886
|
if (validationError !== null) {
|
|
49858
49887
|
const systemPathHint = /systemPath.*not assignable/i.test(validationError) ? `
|
|
@@ -50123,7 +50152,7 @@ async function scaffoldKnowledge(opts) {
|
|
|
50123
50152
|
}
|
|
50124
50153
|
const rawKind = await promptIfAbsent(
|
|
50125
50154
|
options.kind,
|
|
50126
|
-
"Node kind (playbook / strategy / reference
|
|
50155
|
+
"Node kind (playbook / strategy / reference)",
|
|
50127
50156
|
{ default: "reference" }
|
|
50128
50157
|
);
|
|
50129
50158
|
const kind = rawKind || "reference";
|
|
@@ -50148,30 +50177,30 @@ async function scaffoldKnowledge(opts) {
|
|
|
50148
50177
|
return;
|
|
50149
50178
|
}
|
|
50150
50179
|
const absoluteFilePath = (0, import_node_path16.join)(projectDir, relativeFilePath);
|
|
50151
|
-
if ((0,
|
|
50180
|
+
if ((0, import_node_fs16.existsSync)(absoluteFilePath)) {
|
|
50152
50181
|
process.stderr.write(
|
|
50153
50182
|
source_default.red(`Knowledge node file already exists at \`${relativeFilePath}\`. Choose a different id.
|
|
50154
50183
|
`)
|
|
50155
50184
|
);
|
|
50156
50185
|
process.exit(1);
|
|
50157
50186
|
}
|
|
50158
|
-
(0,
|
|
50159
|
-
(0,
|
|
50187
|
+
(0, import_node_fs16.mkdirSync)((0, import_node_path16.join)(projectDir, "core", "config", "knowledge", "nodes"), { recursive: true });
|
|
50188
|
+
(0, import_node_fs16.writeFileSync)(absoluteFilePath, content, "utf8");
|
|
50160
50189
|
console.log(source_default.green(`Knowledge node \`${id}\` written to \`${relativeFilePath}\``));
|
|
50161
50190
|
console.log(source_default.yellow("Run `elevasis-sdk knowledge:generate` to register this node."));
|
|
50162
50191
|
}
|
|
50163
|
-
var import_node_path16,
|
|
50192
|
+
var import_node_path16, import_node_fs16, VALID_KINDS;
|
|
50164
50193
|
var init_scaffold_knowledge = __esm({
|
|
50165
50194
|
"src/cli/commands/om/scaffold-knowledge.ts"() {
|
|
50166
50195
|
"use strict";
|
|
50167
50196
|
import_node_path16 = require("node:path");
|
|
50168
|
-
|
|
50197
|
+
import_node_fs16 = require("node:fs");
|
|
50169
50198
|
init_source();
|
|
50170
50199
|
init_config2();
|
|
50171
50200
|
init_project_layout();
|
|
50172
50201
|
init_prompt_helpers();
|
|
50173
50202
|
init_emit_knowledge();
|
|
50174
|
-
VALID_KINDS = ["playbook", "strategy", "reference"
|
|
50203
|
+
VALID_KINDS = ["playbook", "strategy", "reference"];
|
|
50175
50204
|
}
|
|
50176
50205
|
});
|
|
50177
50206
|
|
|
@@ -50184,7 +50213,13 @@ function emitApiInterfaceBlock(gap) {
|
|
|
50184
50213
|
const cataloged = SYSTEM_INTERFACE_PROFILES.find(
|
|
50185
50214
|
(profile) => profile.systemPath === gap.systemPath && profile.interfaceKey === "api"
|
|
50186
50215
|
);
|
|
50187
|
-
|
|
50216
|
+
if (cataloged === void 0) {
|
|
50217
|
+
const adoptable = SYSTEM_INTERFACE_PROFILES.filter((profile) => profile.interfaceKey === "api").map((profile) => `"${profile.systemPath}"`).join(", ");
|
|
50218
|
+
throw new Error(
|
|
50219
|
+
`Cannot emit an apiInterface for system path "${gap.systemPath}": it adopts no cataloged platform API capability, so any readinessProfile emitted for it would name a route the API does not serve. Adoptable system paths are ${adoptable}. A custom System extends behavior through workflows/operations plus ontology, resources, and topology \u2014 omitting apiInterface entirely is the designed opt-out.`
|
|
50220
|
+
);
|
|
50221
|
+
}
|
|
50222
|
+
const readinessProfile = cataloged.readinessProfile;
|
|
50188
50223
|
const resourceIdsField = gap.resourceIds.length === 0 ? "" : `,
|
|
50189
50224
|
resourceIds: [
|
|
50190
50225
|
${gap.resourceIds.map((id) => `'${id}'`).join(",\n ")}
|
|
@@ -50247,7 +50282,7 @@ async function scaffoldFill(opts) {
|
|
|
50247
50282
|
process.stderr.write(source_default.red("Missing gaps file. Pass --gaps <path> pointing to a conformance gap JSON file.\n"));
|
|
50248
50283
|
process.exit(1);
|
|
50249
50284
|
}
|
|
50250
|
-
if (!(0,
|
|
50285
|
+
if (!(0, import_node_fs17.existsSync)(options.gaps)) {
|
|
50251
50286
|
process.stderr.write(
|
|
50252
50287
|
source_default.red(
|
|
50253
50288
|
`Missing gaps file. Pass --gaps <path> pointing to a conformance gap JSON file.
|
|
@@ -50259,7 +50294,7 @@ async function scaffoldFill(opts) {
|
|
|
50259
50294
|
}
|
|
50260
50295
|
let payload;
|
|
50261
50296
|
try {
|
|
50262
|
-
const raw = (0,
|
|
50297
|
+
const raw = (0, import_node_fs17.readFileSync)(options.gaps, "utf8");
|
|
50263
50298
|
payload = JSON.parse(raw);
|
|
50264
50299
|
} catch {
|
|
50265
50300
|
process.stderr.write(
|
|
@@ -50367,7 +50402,7 @@ async function scaffoldFill(opts) {
|
|
|
50367
50402
|
}
|
|
50368
50403
|
if (skippedGaps.length > 0) {
|
|
50369
50404
|
const skippedPath = options.skipped ?? (0, import_node_path17.join)(os2.tmpdir(), `elevasis-fill-skipped-${systemPath}-${Date.now()}.json`);
|
|
50370
|
-
(0,
|
|
50405
|
+
(0, import_node_fs17.writeFileSync)(skippedPath, JSON.stringify({ systemPath, skipped: skippedGaps }, null, 2), "utf8");
|
|
50371
50406
|
console.log(
|
|
50372
50407
|
source_default.yellow(
|
|
50373
50408
|
`Partial fill: ${appliedGaps.length} gap(s) applied, ${skippedGaps.length} skipped \u2014 see \`${skippedPath}\` for fields requiring manual input.`
|
|
@@ -50381,13 +50416,13 @@ async function scaffoldFill(opts) {
|
|
|
50381
50416
|
)
|
|
50382
50417
|
);
|
|
50383
50418
|
}
|
|
50384
|
-
var import_node_path17, os2,
|
|
50419
|
+
var import_node_path17, os2, import_node_fs17, import_node_child_process5;
|
|
50385
50420
|
var init_scaffold_fill = __esm({
|
|
50386
50421
|
"src/cli/commands/om/scaffold-fill.ts"() {
|
|
50387
50422
|
"use strict";
|
|
50388
50423
|
import_node_path17 = require("node:path");
|
|
50389
50424
|
os2 = __toESM(require("node:os"), 1);
|
|
50390
|
-
|
|
50425
|
+
import_node_fs17 = require("node:fs");
|
|
50391
50426
|
import_node_child_process5 = require("node:child_process");
|
|
50392
50427
|
init_source();
|
|
50393
50428
|
init_config2();
|
|
@@ -55890,7 +55925,8 @@ function sortPipelineSteps(steps) {
|
|
|
55890
55925
|
return a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
|
|
55891
55926
|
});
|
|
55892
55927
|
}
|
|
55893
|
-
function deriveItemPlacement(
|
|
55928
|
+
function deriveItemPlacement(item, sortedSteps) {
|
|
55929
|
+
const processingState = item.processingState;
|
|
55894
55930
|
const stateKeys = Object.keys(processingState);
|
|
55895
55931
|
if (stateKeys.length > 0) {
|
|
55896
55932
|
const catalogKeys = new Set(sortedSteps.map((step) => step.key));
|
|
@@ -55904,6 +55940,10 @@ function deriveItemPlacement(processingState, sortedSteps) {
|
|
|
55904
55940
|
return !entry || entry.status !== "success";
|
|
55905
55941
|
});
|
|
55906
55942
|
if (!currentStep) {
|
|
55943
|
+
const lastStep = sortedSteps[sortedSteps.length - 1];
|
|
55944
|
+
if (lastStep !== void 0 && lastStep.reviewMode !== "none" && item.reviewedAt === null) {
|
|
55945
|
+
return { bucket: "column", stepKey: lastStep.key };
|
|
55946
|
+
}
|
|
55907
55947
|
return { bucket: "done", stepKey: null };
|
|
55908
55948
|
}
|
|
55909
55949
|
return { bucket: "column", stepKey: currentStep.key };
|
|
@@ -55919,7 +55959,7 @@ function deriveContentBoard(items, pipeline, now) {
|
|
|
55919
55959
|
const done = [];
|
|
55920
55960
|
const unplaced = [];
|
|
55921
55961
|
for (const item of items) {
|
|
55922
|
-
const placement = deriveItemPlacement(item
|
|
55962
|
+
const placement = deriveItemPlacement(item, sortedSteps);
|
|
55923
55963
|
const step = placement.stepKey ? stepsByKey.get(placement.stepKey) : void 0;
|
|
55924
55964
|
const card = {
|
|
55925
55965
|
item,
|
|
@@ -56267,6 +56307,165 @@ Content item ${itemId} ${verb} at step ${options.step}`));
|
|
|
56267
56307
|
);
|
|
56268
56308
|
}
|
|
56269
56309
|
|
|
56310
|
+
// src/cli/commands/content/source-assets.ts
|
|
56311
|
+
init_source();
|
|
56312
|
+
init_api_client();
|
|
56313
|
+
init_config2();
|
|
56314
|
+
init_wrap_action();
|
|
56315
|
+
function appendQuery6(params, key, value) {
|
|
56316
|
+
if (value === void 0 || value === null || value === "") return;
|
|
56317
|
+
params.set(key, String(value));
|
|
56318
|
+
}
|
|
56319
|
+
function registerContentSourceAssets(program3) {
|
|
56320
|
+
program3.command("content:source-assets").description(
|
|
56321
|
+
"List content source assets (raw material)\n Example: elevasis-sdk content:source-assets --kind transcript --limit 10"
|
|
56322
|
+
).option("--kind <kind>", "Filter by source asset kind (e.g. transcript)").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(
|
|
56323
|
+
wrapAction("content:source-assets", async (options) => {
|
|
56324
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
56325
|
+
const params = new URLSearchParams();
|
|
56326
|
+
appendQuery6(params, "kind", options.kind);
|
|
56327
|
+
appendQuery6(params, "limit", options.limit);
|
|
56328
|
+
appendQuery6(params, "offset", options.offset);
|
|
56329
|
+
const query = params.toString();
|
|
56330
|
+
const endpoint = query ? `/api/external/content/source-assets?${query}` : "/api/external/content/source-assets";
|
|
56331
|
+
const result = await apiGet(endpoint, apiUrl);
|
|
56332
|
+
if (!options.pretty) {
|
|
56333
|
+
console.log(JSON.stringify(result, null, 2));
|
|
56334
|
+
return;
|
|
56335
|
+
}
|
|
56336
|
+
if (result.data.length === 0) {
|
|
56337
|
+
console.log(source_default.yellow("No content source assets found."));
|
|
56338
|
+
return;
|
|
56339
|
+
}
|
|
56340
|
+
console.log(source_default.cyan(`
|
|
56341
|
+
Content source assets (${result.data.length} of ${result.total}):
|
|
56342
|
+
`));
|
|
56343
|
+
for (const asset of result.data) {
|
|
56344
|
+
console.log(` ${source_default.bold(asset.title)} ${source_default.gray(asset.kind)}`);
|
|
56345
|
+
console.log(source_default.gray(` ID: ${asset.id}`));
|
|
56346
|
+
if (asset.externalUrl) console.log(source_default.gray(` URL: ${asset.externalUrl}`));
|
|
56347
|
+
if (asset.durationSeconds) console.log(source_default.gray(` Duration: ${asset.durationSeconds}s`));
|
|
56348
|
+
}
|
|
56349
|
+
console.log();
|
|
56350
|
+
})
|
|
56351
|
+
);
|
|
56352
|
+
}
|
|
56353
|
+
|
|
56354
|
+
// src/cli/commands/content/source-asset.ts
|
|
56355
|
+
init_source();
|
|
56356
|
+
init_api_client();
|
|
56357
|
+
init_config2();
|
|
56358
|
+
init_wrap_action();
|
|
56359
|
+
function registerContentSourceAsset(program3) {
|
|
56360
|
+
program3.command("content:source-asset <sourceAssetId>").description(
|
|
56361
|
+
"Get one content source asset, including its payload\n Example: elevasis-sdk content:source-asset <uuid>"
|
|
56362
|
+
).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(
|
|
56363
|
+
wrapAction("content:source-asset", async (sourceAssetId, options) => {
|
|
56364
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
56365
|
+
const asset = await apiGet(`/api/external/content/source-assets/${sourceAssetId}`, apiUrl);
|
|
56366
|
+
if (!options.pretty) {
|
|
56367
|
+
console.log(JSON.stringify(asset, null, 2));
|
|
56368
|
+
return;
|
|
56369
|
+
}
|
|
56370
|
+
console.log(source_default.cyan(`
|
|
56371
|
+
${asset.title}`));
|
|
56372
|
+
console.log(source_default.gray(` ID: ${asset.id}`));
|
|
56373
|
+
console.log(source_default.gray(` Kind: ${asset.kind}`));
|
|
56374
|
+
if (asset.externalUrl) console.log(source_default.gray(` URL: ${asset.externalUrl}`));
|
|
56375
|
+
if (asset.durationSeconds) console.log(source_default.gray(` Duration: ${asset.durationSeconds}s`));
|
|
56376
|
+
const payloadKeys = Object.keys(asset.payload ?? {});
|
|
56377
|
+
if (payloadKeys.length > 0) {
|
|
56378
|
+
console.log(source_default.cyan("\n Payload:"));
|
|
56379
|
+
for (const key of payloadKeys) {
|
|
56380
|
+
const value = asset.payload[key];
|
|
56381
|
+
const rendered = typeof value === "string" ? value : JSON.stringify(value);
|
|
56382
|
+
console.log(source_default.gray(` ${key}:`));
|
|
56383
|
+
console.log(` ${rendered.split("\n").join("\n ")}`);
|
|
56384
|
+
}
|
|
56385
|
+
}
|
|
56386
|
+
console.log();
|
|
56387
|
+
})
|
|
56388
|
+
);
|
|
56389
|
+
}
|
|
56390
|
+
|
|
56391
|
+
// src/cli/commands/content/source-asset-create.ts
|
|
56392
|
+
var import_node_fs10 = require("node:fs");
|
|
56393
|
+
init_source();
|
|
56394
|
+
init_api_client();
|
|
56395
|
+
init_config2();
|
|
56396
|
+
init_wrap_action();
|
|
56397
|
+
var PAYLOAD_MAX_BYTES = 5e5;
|
|
56398
|
+
function resolveTextArgument(value) {
|
|
56399
|
+
if (!value.startsWith("@")) return value;
|
|
56400
|
+
const path3 = value.slice(1);
|
|
56401
|
+
try {
|
|
56402
|
+
return (0, import_node_fs10.readFileSync)(path3, "utf8");
|
|
56403
|
+
} catch (error46) {
|
|
56404
|
+
throw new Error(`Could not read --text file "${path3}": ${error46 instanceof Error ? error46.message : String(error46)}`);
|
|
56405
|
+
}
|
|
56406
|
+
}
|
|
56407
|
+
function registerContentSourceAssetCreate(program3) {
|
|
56408
|
+
program3.command("content:source-asset:create").description(
|
|
56409
|
+
'Create a content source asset from inline text or a URL, optionally linking it to an item\n Example: elevasis-sdk content:source-asset:create --kind transcript --title "Episode 12" --text @transcript.txt --item <uuid>'
|
|
56410
|
+
).requiredOption("--kind <kind>", "Source asset kind (e.g. transcript) -- validated against the org model catalog").requiredOption("--title <title>", "Human-readable title (1..500 chars)").option("--text <value>", "Inline text, or @path to read a local file. Mutually exclusive with --url").option(
|
|
56411
|
+
"--field <key>",
|
|
56412
|
+
"Payload field the --text content is written to. Defaults to the --kind value, matching the catalog declaration"
|
|
56413
|
+
).option("--url <url>", "External URL the asset references. Mutually exclusive with --text").option("--duration <seconds>", "Duration in seconds, for time-based referenced media").option("--item <itemId>", "Link the new asset to this content item after creating it").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(
|
|
56414
|
+
wrapAction("content:source-asset:create", async (options) => {
|
|
56415
|
+
if (options.text !== void 0 && options.url !== void 0) {
|
|
56416
|
+
throw new Error("Pass exactly one of --text or --url, not both");
|
|
56417
|
+
}
|
|
56418
|
+
if (options.text === void 0 && options.url === void 0) {
|
|
56419
|
+
throw new Error("Pass one of --text (inline content) or --url (a reference)");
|
|
56420
|
+
}
|
|
56421
|
+
if (options.field !== void 0 && options.text === void 0) {
|
|
56422
|
+
throw new Error("--field only applies to --text");
|
|
56423
|
+
}
|
|
56424
|
+
const body = { kind: options.kind, title: options.title };
|
|
56425
|
+
if (options.text !== void 0) {
|
|
56426
|
+
const text = resolveTextArgument(options.text);
|
|
56427
|
+
const field2 = options.field ?? options.kind;
|
|
56428
|
+
const size = Buffer.byteLength(text, "utf8");
|
|
56429
|
+
if (size > PAYLOAD_MAX_BYTES) {
|
|
56430
|
+
throw new Error(
|
|
56431
|
+
`--text content is ${size} bytes, over the ${PAYLOAD_MAX_BYTES}-byte payload limit. Split it or store it as a reference with --url`
|
|
56432
|
+
);
|
|
56433
|
+
}
|
|
56434
|
+
body.payload = { [field2]: text };
|
|
56435
|
+
}
|
|
56436
|
+
if (options.url !== void 0) body.externalUrl = options.url;
|
|
56437
|
+
if (options.duration !== void 0) {
|
|
56438
|
+
const duration3 = Number(options.duration);
|
|
56439
|
+
if (!Number.isInteger(duration3) || duration3 < 0) {
|
|
56440
|
+
throw new Error("--duration must be a non-negative integer number of seconds");
|
|
56441
|
+
}
|
|
56442
|
+
body.durationSeconds = duration3;
|
|
56443
|
+
}
|
|
56444
|
+
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
56445
|
+
const asset = await apiPost("/api/external/content/source-assets", body, apiUrl);
|
|
56446
|
+
let linkedItem;
|
|
56447
|
+
if (options.item !== void 0) {
|
|
56448
|
+
linkedItem = await apiPatch(
|
|
56449
|
+
`/api/external/content/items/${options.item}`,
|
|
56450
|
+
{ sourceAssetId: asset.id },
|
|
56451
|
+
apiUrl
|
|
56452
|
+
);
|
|
56453
|
+
}
|
|
56454
|
+
if (!options.pretty) {
|
|
56455
|
+
console.log(JSON.stringify(linkedItem ? { sourceAsset: asset, item: linkedItem } : asset, null, 2));
|
|
56456
|
+
return;
|
|
56457
|
+
}
|
|
56458
|
+
console.log(source_default.green(`
|
|
56459
|
+
Created source asset ${asset.id}`));
|
|
56460
|
+
console.log(source_default.gray(` Title: ${asset.title}`));
|
|
56461
|
+
console.log(source_default.gray(` Kind: ${asset.kind}`));
|
|
56462
|
+
if (asset.externalUrl) console.log(source_default.gray(` URL: ${asset.externalUrl}`));
|
|
56463
|
+
if (linkedItem) console.log(source_default.cyan(` Linked to item ${linkedItem.id} (${linkedItem.title})`));
|
|
56464
|
+
console.log();
|
|
56465
|
+
})
|
|
56466
|
+
);
|
|
56467
|
+
}
|
|
56468
|
+
|
|
56270
56469
|
// src/cli/commands/content/index.ts
|
|
56271
56470
|
function registerContentCommands(program3) {
|
|
56272
56471
|
registerContentList(program3);
|
|
@@ -56276,6 +56475,9 @@ function registerContentCommands(program3) {
|
|
|
56276
56475
|
registerContentPipeline(program3);
|
|
56277
56476
|
registerContentDistributions(program3);
|
|
56278
56477
|
registerContentReview(program3);
|
|
56478
|
+
registerContentSourceAssets(program3);
|
|
56479
|
+
registerContentSourceAsset(program3);
|
|
56480
|
+
registerContentSourceAssetCreate(program3);
|
|
56279
56481
|
}
|
|
56280
56482
|
|
|
56281
56483
|
// src/cli/commands/queue/queue.ts
|
|
@@ -56286,7 +56488,7 @@ init_wrap_action();
|
|
|
56286
56488
|
function printJson8(value) {
|
|
56287
56489
|
console.log(JSON.stringify(value, null, 2));
|
|
56288
56490
|
}
|
|
56289
|
-
function
|
|
56491
|
+
function appendQuery7(params, key, value) {
|
|
56290
56492
|
if (value === void 0 || value === null || value === "") return;
|
|
56291
56493
|
params.set(key, String(value));
|
|
56292
56494
|
}
|
|
@@ -56312,13 +56514,13 @@ function registerQueueList(program3) {
|
|
|
56312
56514
|
async (options) => {
|
|
56313
56515
|
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
56314
56516
|
const params = new URLSearchParams();
|
|
56315
|
-
|
|
56316
|
-
|
|
56317
|
-
|
|
56318
|
-
|
|
56319
|
-
|
|
56320
|
-
|
|
56321
|
-
|
|
56517
|
+
appendQuery7(params, "status", options.status);
|
|
56518
|
+
appendQuery7(params, "humanCheckpoint", options.humanCheckpoint);
|
|
56519
|
+
appendQuery7(params, "timeRange", options.timeRange);
|
|
56520
|
+
appendQuery7(params, "priorityMin", options.priorityMin);
|
|
56521
|
+
appendQuery7(params, "priorityMax", options.priorityMax);
|
|
56522
|
+
appendQuery7(params, "limit", options.limit);
|
|
56523
|
+
appendQuery7(params, "offset", options.offset);
|
|
56322
56524
|
const result = await apiGet(
|
|
56323
56525
|
endpointWithQuery4("/api/external/command-queue", params),
|
|
56324
56526
|
apiUrl
|
|
@@ -56423,10 +56625,10 @@ function registerQueueStatus(program3) {
|
|
|
56423
56625
|
async (options) => {
|
|
56424
56626
|
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
56425
56627
|
const params = new URLSearchParams();
|
|
56426
|
-
|
|
56427
|
-
|
|
56428
|
-
|
|
56429
|
-
|
|
56628
|
+
appendQuery7(params, "timeRange", options.timeRange);
|
|
56629
|
+
appendQuery7(params, "priorityMin", options.priorityMin);
|
|
56630
|
+
appendQuery7(params, "priorityMax", options.priorityMax);
|
|
56631
|
+
appendQuery7(params, "status", options.status);
|
|
56430
56632
|
const result = await apiGet(
|
|
56431
56633
|
endpointWithQuery4("/api/external/command-queue/checkpoints", params),
|
|
56432
56634
|
apiUrl
|
|
@@ -56475,7 +56677,7 @@ init_wrap_action();
|
|
|
56475
56677
|
function printJson9(value) {
|
|
56476
56678
|
console.log(JSON.stringify(value, null, 2));
|
|
56477
56679
|
}
|
|
56478
|
-
function
|
|
56680
|
+
function appendQuery8(params, key, value) {
|
|
56479
56681
|
if (value === void 0 || value === null || value === "") return;
|
|
56480
56682
|
params.set(key, String(value));
|
|
56481
56683
|
}
|
|
@@ -56504,11 +56706,11 @@ function registerScheduleList(program3) {
|
|
|
56504
56706
|
async (options) => {
|
|
56505
56707
|
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
56506
56708
|
const params = new URLSearchParams();
|
|
56507
|
-
|
|
56508
|
-
|
|
56509
|
-
|
|
56510
|
-
|
|
56511
|
-
|
|
56709
|
+
appendQuery8(params, "status", options.status);
|
|
56710
|
+
appendQuery8(params, "targetResourceType", options.targetResourceType);
|
|
56711
|
+
appendQuery8(params, "targetResourceId", options.targetResourceId);
|
|
56712
|
+
appendQuery8(params, "limit", options.limit);
|
|
56713
|
+
appendQuery8(params, "offset", options.offset);
|
|
56512
56714
|
const result = await apiGet(
|
|
56513
56715
|
endpointWithQuery5("/api/external/task-scheduler/schedules", params),
|
|
56514
56716
|
apiUrl
|
|
@@ -56856,7 +57058,7 @@ function registerAgentCommands(program3) {
|
|
|
56856
57058
|
}
|
|
56857
57059
|
|
|
56858
57060
|
// src/cli/commands/session/session.ts
|
|
56859
|
-
var
|
|
57061
|
+
var import_node_fs11 = require("node:fs");
|
|
56860
57062
|
init_source();
|
|
56861
57063
|
init_api_client();
|
|
56862
57064
|
init_config2();
|
|
@@ -56864,7 +57066,7 @@ init_wrap_action();
|
|
|
56864
57066
|
function printJson11(value) {
|
|
56865
57067
|
console.log(JSON.stringify(value, null, 2));
|
|
56866
57068
|
}
|
|
56867
|
-
function
|
|
57069
|
+
function appendQuery9(params, key, value) {
|
|
56868
57070
|
if (value === void 0 || value === null || value === "") return;
|
|
56869
57071
|
params.set(key, String(value));
|
|
56870
57072
|
}
|
|
@@ -56882,7 +57084,7 @@ function parseJson(value, label) {
|
|
|
56882
57084
|
}
|
|
56883
57085
|
function readJsonFile(path3, label) {
|
|
56884
57086
|
const resolved = resolveProjectRelative(path3);
|
|
56885
|
-
return parseJson((0,
|
|
57087
|
+
return parseJson((0, import_node_fs11.readFileSync)(resolved, "utf8"), label);
|
|
56886
57088
|
}
|
|
56887
57089
|
function resolveTurnInput(options) {
|
|
56888
57090
|
if (options.input && options.inputFile) {
|
|
@@ -56898,8 +57100,8 @@ function resolveTurnInput(options) {
|
|
|
56898
57100
|
}
|
|
56899
57101
|
function messagesEndpoint(sessionId, limit, cursor) {
|
|
56900
57102
|
const params = new URLSearchParams();
|
|
56901
|
-
|
|
56902
|
-
|
|
57103
|
+
appendQuery9(params, "limit", limit);
|
|
57104
|
+
appendQuery9(params, "cursor", cursor);
|
|
56903
57105
|
return endpointWithQuery6(`/api/external/sessions/${sessionId}/messages`, params);
|
|
56904
57106
|
}
|
|
56905
57107
|
async function fetchSessionMessages(sessionId, apiUrl, options) {
|
|
@@ -56984,9 +57186,9 @@ function registerSessionList(program3) {
|
|
|
56984
57186
|
wrapAction("session:list", async (options) => {
|
|
56985
57187
|
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
56986
57188
|
const params = new URLSearchParams();
|
|
56987
|
-
|
|
56988
|
-
|
|
56989
|
-
|
|
57189
|
+
appendQuery9(params, "resourceId", options.resourceId);
|
|
57190
|
+
appendQuery9(params, "userId", options.userId);
|
|
57191
|
+
appendQuery9(params, "limit", options.limit);
|
|
56990
57192
|
const result = await apiGet(endpointWithQuery6("/api/external/sessions", params), apiUrl);
|
|
56991
57193
|
if (options.json) {
|
|
56992
57194
|
printJson11(result);
|
|
@@ -57121,7 +57323,7 @@ init_wrap_action();
|
|
|
57121
57323
|
function printJson12(value) {
|
|
57122
57324
|
console.log(JSON.stringify(value, null, 2));
|
|
57123
57325
|
}
|
|
57124
|
-
function
|
|
57326
|
+
function appendQuery10(params, key, value) {
|
|
57125
57327
|
if (value === void 0 || value === null || value === "" || value === false) return;
|
|
57126
57328
|
params.set(key, String(value));
|
|
57127
57329
|
}
|
|
@@ -57186,8 +57388,8 @@ function registerGrantList(program3) {
|
|
|
57186
57388
|
wrapAction("grant:list", async (options) => {
|
|
57187
57389
|
const apiUrl = resolveApiUrl(options.apiUrl, options.prod);
|
|
57188
57390
|
const params = new URLSearchParams();
|
|
57189
|
-
|
|
57190
|
-
|
|
57391
|
+
appendQuery10(params, "resourceId", options.resourceId);
|
|
57392
|
+
appendQuery10(params, "includeDisabled", options.includeDisabled ? "true" : void 0);
|
|
57191
57393
|
const result = await apiGet(
|
|
57192
57394
|
endpointWithQuery7("/api/external/agent-access-grants", params),
|
|
57193
57395
|
apiUrl
|
|
@@ -57762,7 +57964,7 @@ function registerOmDoctorCommand(program3) {
|
|
|
57762
57964
|
}
|
|
57763
57965
|
|
|
57764
57966
|
// src/cli/commands/om/rename.ts
|
|
57765
|
-
var
|
|
57967
|
+
var import_node_fs12 = require("node:fs");
|
|
57766
57968
|
var import_node_path9 = require("node:path");
|
|
57767
57969
|
init_config2();
|
|
57768
57970
|
init_wrap_action();
|
|
@@ -57800,10 +58002,10 @@ function absolutePath(sourceRoot, relativePath) {
|
|
|
57800
58002
|
}
|
|
57801
58003
|
function walkFiles(sourceRoot, relativeRoot, extension) {
|
|
57802
58004
|
const root = absolutePath(sourceRoot, relativeRoot);
|
|
57803
|
-
if (!(0,
|
|
58005
|
+
if (!(0, import_node_fs12.existsSync)(root)) return [];
|
|
57804
58006
|
const targets = [];
|
|
57805
58007
|
function visit(directory) {
|
|
57806
|
-
for (const entry of (0,
|
|
58008
|
+
for (const entry of (0, import_node_fs12.readdirSync)(directory, { withFileTypes: true })) {
|
|
57807
58009
|
const fullPath = (0, import_node_path9.join)(directory, entry.name);
|
|
57808
58010
|
if (entry.isDirectory()) {
|
|
57809
58011
|
visit(fullPath);
|
|
@@ -57885,8 +58087,8 @@ function createOmRenamePlan(oldPathArg, newPathArg, options = {}) {
|
|
|
57885
58087
|
const edits = [];
|
|
57886
58088
|
for (const target of buildTargets(sourceRoot)) {
|
|
57887
58089
|
const path3 = absolutePath(sourceRoot, target.path);
|
|
57888
|
-
if (!(0,
|
|
57889
|
-
const source = (0,
|
|
58090
|
+
if (!(0, import_node_fs12.existsSync)(path3)) continue;
|
|
58091
|
+
const source = (0, import_node_fs12.readFileSync)(path3, "utf8");
|
|
57890
58092
|
const transformed = transformContent(source, target.path, oldPath, newPath);
|
|
57891
58093
|
if (transformed.count === 0) continue;
|
|
57892
58094
|
edits.push({
|
|
@@ -57913,20 +58115,20 @@ function createOmRenamePlan(oldPathArg, newPathArg, options = {}) {
|
|
|
57913
58115
|
function snapshotEdits(sourceRoot, edits) {
|
|
57914
58116
|
return edits.map((edit) => {
|
|
57915
58117
|
const path3 = absolutePath(sourceRoot, edit.path);
|
|
57916
|
-
return { path: path3, content: (0,
|
|
58118
|
+
return { path: path3, content: (0, import_node_fs12.readFileSync)(path3, "utf8") };
|
|
57917
58119
|
});
|
|
57918
58120
|
}
|
|
57919
58121
|
function restoreSnapshot(snapshot) {
|
|
57920
58122
|
for (const entry of snapshot) {
|
|
57921
|
-
(0,
|
|
58123
|
+
(0, import_node_fs12.writeFileSync)(entry.path, entry.content);
|
|
57922
58124
|
}
|
|
57923
58125
|
}
|
|
57924
58126
|
function applyPlan(sourceRoot, plan) {
|
|
57925
58127
|
for (const edit of plan.edits) {
|
|
57926
58128
|
const path3 = absolutePath(sourceRoot, edit.path);
|
|
57927
|
-
const source = (0,
|
|
58129
|
+
const source = (0, import_node_fs12.readFileSync)(path3, "utf8");
|
|
57928
58130
|
const transformed = transformContent(source, edit.path, plan.oldPath, plan.newPath);
|
|
57929
|
-
(0,
|
|
58131
|
+
(0, import_node_fs12.writeFileSync)(path3, transformed.output);
|
|
57930
58132
|
}
|
|
57931
58133
|
}
|
|
57932
58134
|
async function defaultOmRenameValidator(plan, sourceRoot) {
|
|
@@ -57934,7 +58136,7 @@ async function defaultOmRenameValidator(plan, sourceRoot) {
|
|
|
57934
58136
|
try {
|
|
57935
58137
|
if (plan.edits.some((edit) => edit.path.endsWith(".mdx"))) {
|
|
57936
58138
|
const sourceDir = absolutePath(sourceRoot, KNOWLEDGE_ROOT);
|
|
57937
|
-
if ((0,
|
|
58139
|
+
if ((0, import_node_fs12.existsSync)(sourceDir)) {
|
|
57938
58140
|
const generated = generateKnowledgeNodes({
|
|
57939
58141
|
sourceDir,
|
|
57940
58142
|
outputPath: absolutePath(sourceRoot, KNOWLEDGE_GENERATED_OUTPUT),
|
|
@@ -58022,7 +58224,7 @@ function registerOmRenameCommand(program3) {
|
|
|
58022
58224
|
}
|
|
58023
58225
|
|
|
58024
58226
|
// src/cli/commands/om/deprecate.ts
|
|
58025
|
-
var
|
|
58227
|
+
var import_node_fs13 = require("node:fs");
|
|
58026
58228
|
var import_node_path10 = require("node:path");
|
|
58027
58229
|
init_src();
|
|
58028
58230
|
init_config2();
|
|
@@ -58131,8 +58333,8 @@ function createOmDeprecatePlan(model, systemPathArg, options = {}) {
|
|
|
58131
58333
|
const warnings = hasDependents && to === "deprecated" ? ["Live dependents were found. Deprecation is allowed, but plan the dependent wind-down before archiving."] : [];
|
|
58132
58334
|
const blocked = to === "archived" && hasDependents && !confirmed;
|
|
58133
58335
|
let edit = null;
|
|
58134
|
-
if ((0,
|
|
58135
|
-
const source = (0,
|
|
58336
|
+
if ((0, import_node_fs13.existsSync)(systemsPath)) {
|
|
58337
|
+
const source = (0, import_node_fs13.readFileSync)(systemsPath, "utf8");
|
|
58136
58338
|
edit = {
|
|
58137
58339
|
path: SYSTEMS_FILE2,
|
|
58138
58340
|
replacements: transformSystemLifecycle(source, systemPath, to).replacements
|
|
@@ -58177,13 +58379,13 @@ async function executeOmDeprecatePlan(plan, options = {}) {
|
|
|
58177
58379
|
return { plan, wrote: false, validation: { ok: true, output: "no lifecycle change needed" }, rolledBack: false };
|
|
58178
58380
|
}
|
|
58179
58381
|
const systemsPath = absolutePath2(sourceRoot, SYSTEMS_FILE2);
|
|
58180
|
-
const before = (0,
|
|
58382
|
+
const before = (0, import_node_fs13.readFileSync)(systemsPath, "utf8");
|
|
58181
58383
|
const transformed = transformSystemLifecycle(before, plan.systemPath, plan.to);
|
|
58182
|
-
(0,
|
|
58384
|
+
(0, import_node_fs13.writeFileSync)(systemsPath, transformed.output);
|
|
58183
58385
|
const validator = options.validator ?? defaultOmDeprecateValidator;
|
|
58184
58386
|
const validation = await validator(plan, sourceRoot);
|
|
58185
58387
|
if (!validation.ok) {
|
|
58186
|
-
(0,
|
|
58388
|
+
(0, import_node_fs13.writeFileSync)(systemsPath, before);
|
|
58187
58389
|
return { plan, wrote: true, validation, rolledBack: true };
|
|
58188
58390
|
}
|
|
58189
58391
|
return { plan, wrote: true, validation, rolledBack: false };
|
|
@@ -58278,7 +58480,7 @@ function registerOmScaffoldCommands(program3) {
|
|
|
58278
58480
|
const mod = await Promise.resolve().then(() => (init_scaffold_ontology(), scaffold_ontology_exports));
|
|
58279
58481
|
await mod.default(opts);
|
|
58280
58482
|
});
|
|
58281
|
-
program3.command("om:scaffold:knowledge").description("Create a new MDX knowledge node file in core/config/knowledge/nodes/").option("--id <id>", "knowledge node id, e.g. outreach-playbook (prompted if absent)").option("--kind <kind>", "node kind: playbook | strategy | reference
|
|
58483
|
+
program3.command("om:scaffold:knowledge").description("Create a new MDX knowledge node file in core/config/knowledge/nodes/").option("--id <id>", "knowledge node id, e.g. outreach-playbook (prompted if absent)").option("--kind <kind>", "node kind: playbook | strategy | reference (prompted if absent)").option("--system-path <path>", "governing system path for mount (prompted; can be blank for global)").option("--write", "apply the change (default is a dry-run preview \u2014 no files written)").action(async (opts) => {
|
|
58282
58484
|
const mod = await Promise.resolve().then(() => (init_scaffold_knowledge(), scaffold_knowledge_exports));
|
|
58283
58485
|
await mod.default(opts);
|
|
58284
58486
|
});
|
|
@@ -58373,7 +58575,7 @@ function registerSkillScaffoldCommand(program3) {
|
|
|
58373
58575
|
}
|
|
58374
58576
|
|
|
58375
58577
|
// src/cli/json-file-argv.ts
|
|
58376
|
-
var
|
|
58578
|
+
var import_node_fs18 = require("node:fs");
|
|
58377
58579
|
var import_node_path18 = require("node:path");
|
|
58378
58580
|
init_config2();
|
|
58379
58581
|
var JSON_FILE_PREFIX = "@json:";
|
|
@@ -58404,7 +58606,7 @@ function resolveJsonFilePath(path3, options) {
|
|
|
58404
58606
|
function readJsonFileReference(ref, options) {
|
|
58405
58607
|
const relativeOrAbsolutePath = ref.slice(JSON_FILE_PREFIX.length);
|
|
58406
58608
|
const resolvedPath = resolveJsonFilePath(relativeOrAbsolutePath, options);
|
|
58407
|
-
const raw = (options.readFile ?? ((path3) => (0,
|
|
58609
|
+
const raw = (options.readFile ?? ((path3) => (0, import_node_fs18.readFileSync)(path3, "utf8")))(resolvedPath);
|
|
58408
58610
|
try {
|
|
58409
58611
|
JSON.parse(raw);
|
|
58410
58612
|
} catch {
|
|
@@ -58562,6 +58764,8 @@ Commands:
|
|
|
58562
58764
|
elevasis-sdk request:submit -f <path> Submit a structured request report
|
|
58563
58765
|
elevasis-sdk request:list [--status open] List reported requests
|
|
58564
58766
|
elevasis-sdk request:get <id> Get a reported request by id
|
|
58767
|
+
elevasis-sdk request:update <id> -i <json> Amend a request you filed
|
|
58768
|
+
elevasis-sdk request:delete <id> Withdraw a request you filed
|
|
58565
58769
|
elevasis-sdk ui:use-local Use a local @elevasis/ui tarball
|
|
58566
58770
|
elevasis-sdk ui:use-published Restore published @elevasis/ui
|
|
58567
58771
|
elevasis-sdk cli [domain] Generate a registered command catalog
|