@elevasis/sdk 0.6.1 → 0.6.3
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 +112 -144
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -3
- package/dist/worker/index.js +14 -3
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -40260,11 +40260,10 @@ var GoogleOptionsSchema = external_exports.object({
|
|
|
40260
40260
|
thinkingLevel: external_exports.enum(["minimal", "low", "medium", "high"]).optional()
|
|
40261
40261
|
});
|
|
40262
40262
|
var GoogleConfigSchema = external_exports.object({
|
|
40263
|
-
model: external_exports.enum(["gemini-3-flash-preview"]),
|
|
40263
|
+
model: external_exports.enum(["gemini-3-flash-preview", "gemini-3.1-flash-lite-preview"]),
|
|
40264
40264
|
provider: external_exports.literal("google"),
|
|
40265
40265
|
apiKey: external_exports.string(),
|
|
40266
|
-
temperature: external_exports.
|
|
40267
|
-
// Must be 1 for Gemini 3 (changing degrades performance)
|
|
40266
|
+
temperature: external_exports.number().min(0).max(2).optional(),
|
|
40268
40267
|
maxOutputTokens: external_exports.number().min(500).optional(),
|
|
40269
40268
|
topP: external_exports.number().min(0).max(1).optional(),
|
|
40270
40269
|
modelOptions: GoogleOptionsSchema.optional()
|
|
@@ -40372,6 +40371,18 @@ var MODEL_INFO = {
|
|
|
40372
40371
|
category: "standard",
|
|
40373
40372
|
configSchema: GoogleConfigSchema
|
|
40374
40373
|
},
|
|
40374
|
+
"gemini-3.1-flash-lite-preview": {
|
|
40375
|
+
inputCostPer1M: 25,
|
|
40376
|
+
// $0.25 per 1M tokens
|
|
40377
|
+
outputCostPer1M: 150,
|
|
40378
|
+
// $1.50 per 1M tokens
|
|
40379
|
+
minTokens: 4e3,
|
|
40380
|
+
recommendedTokens: 8e3,
|
|
40381
|
+
maxTokens: 1e6,
|
|
40382
|
+
// 1M context window
|
|
40383
|
+
category: "standard",
|
|
40384
|
+
configSchema: GoogleConfigSchema
|
|
40385
|
+
},
|
|
40375
40386
|
// Anthropic Claude Models (direct SDK access via @anthropic-ai/sdk)
|
|
40376
40387
|
// Using aliases - automatically points to latest versions
|
|
40377
40388
|
"claude-opus-4-5": {
|
|
@@ -43873,7 +43884,7 @@ async function apiDelete(endpoint, apiUrl = resolveApiUrl()) {
|
|
|
43873
43884
|
// package.json
|
|
43874
43885
|
var package_default = {
|
|
43875
43886
|
name: "@elevasis/sdk",
|
|
43876
|
-
version: "0.6.
|
|
43887
|
+
version: "0.6.3",
|
|
43877
43888
|
description: "SDK for building Elevasis organization resources",
|
|
43878
43889
|
type: "module",
|
|
43879
43890
|
bin: {
|
|
@@ -43939,6 +43950,31 @@ var SDK_VERSION = package_default.version;
|
|
|
43939
43950
|
|
|
43940
43951
|
// src/cli/commands/deploy.ts
|
|
43941
43952
|
var import_meta = {};
|
|
43953
|
+
function extractResourceMetadata(resource, schemaWarnings) {
|
|
43954
|
+
const meta = {
|
|
43955
|
+
resourceId: resource.config.resourceId,
|
|
43956
|
+
name: resource.config.name,
|
|
43957
|
+
version: resource.config.version,
|
|
43958
|
+
status: resource.config.status,
|
|
43959
|
+
description: resource.config.description,
|
|
43960
|
+
domains: resource.config.domains
|
|
43961
|
+
};
|
|
43962
|
+
if (resource.contract.inputSchema) {
|
|
43963
|
+
try {
|
|
43964
|
+
meta.inputSchema = external_exports.toJSONSchema(resource.contract.inputSchema);
|
|
43965
|
+
} catch {
|
|
43966
|
+
schemaWarnings.push(`${resource.config.resourceId}: inputSchema could not be serialized`);
|
|
43967
|
+
}
|
|
43968
|
+
}
|
|
43969
|
+
if (resource.contract.outputSchema) {
|
|
43970
|
+
try {
|
|
43971
|
+
meta.outputSchema = external_exports.toJSONSchema(resource.contract.outputSchema);
|
|
43972
|
+
} catch {
|
|
43973
|
+
schemaWarnings.push(`${resource.config.resourceId}: outputSchema could not be serialized`);
|
|
43974
|
+
}
|
|
43975
|
+
}
|
|
43976
|
+
return meta;
|
|
43977
|
+
}
|
|
43942
43978
|
var IGNORED_DOC_DIRS = /* @__PURE__ */ new Set([".archive"]);
|
|
43943
43979
|
async function scanDocumentation() {
|
|
43944
43980
|
const docsDir = (0, import_path.resolve)("docs");
|
|
@@ -44520,56 +44556,8 @@ function registerDeployCommand(program3) {
|
|
|
44520
44556
|
);
|
|
44521
44557
|
}
|
|
44522
44558
|
const schemaWarnings = [];
|
|
44523
|
-
const workflows = activeWorkflows.map((w) =>
|
|
44524
|
-
|
|
44525
|
-
resourceId: w.config.resourceId,
|
|
44526
|
-
name: w.config.name,
|
|
44527
|
-
version: w.config.version,
|
|
44528
|
-
status: w.config.status,
|
|
44529
|
-
description: w.config.description,
|
|
44530
|
-
domains: w.config.domains
|
|
44531
|
-
};
|
|
44532
|
-
if (w.contract.inputSchema) {
|
|
44533
|
-
try {
|
|
44534
|
-
meta.inputSchema = external_exports.toJSONSchema(w.contract.inputSchema);
|
|
44535
|
-
} catch {
|
|
44536
|
-
schemaWarnings.push(`${w.config.resourceId}: inputSchema could not be serialized`);
|
|
44537
|
-
}
|
|
44538
|
-
}
|
|
44539
|
-
if (w.contract.outputSchema) {
|
|
44540
|
-
try {
|
|
44541
|
-
meta.outputSchema = external_exports.toJSONSchema(w.contract.outputSchema);
|
|
44542
|
-
} catch {
|
|
44543
|
-
schemaWarnings.push(`${w.config.resourceId}: outputSchema could not be serialized`);
|
|
44544
|
-
}
|
|
44545
|
-
}
|
|
44546
|
-
return meta;
|
|
44547
|
-
});
|
|
44548
|
-
const agents = activeAgents.map((a) => {
|
|
44549
|
-
const meta = {
|
|
44550
|
-
resourceId: a.config.resourceId,
|
|
44551
|
-
name: a.config.name,
|
|
44552
|
-
version: a.config.version,
|
|
44553
|
-
status: a.config.status,
|
|
44554
|
-
description: a.config.description,
|
|
44555
|
-
domains: a.config.domains
|
|
44556
|
-
};
|
|
44557
|
-
if (a.contract.inputSchema) {
|
|
44558
|
-
try {
|
|
44559
|
-
meta.inputSchema = external_exports.toJSONSchema(a.contract.inputSchema);
|
|
44560
|
-
} catch {
|
|
44561
|
-
schemaWarnings.push(`${a.config.resourceId}: inputSchema could not be serialized`);
|
|
44562
|
-
}
|
|
44563
|
-
}
|
|
44564
|
-
if (a.contract.outputSchema) {
|
|
44565
|
-
try {
|
|
44566
|
-
meta.outputSchema = external_exports.toJSONSchema(a.contract.outputSchema);
|
|
44567
|
-
} catch {
|
|
44568
|
-
schemaWarnings.push(`${a.config.resourceId}: outputSchema could not be serialized`);
|
|
44569
|
-
}
|
|
44570
|
-
}
|
|
44571
|
-
return meta;
|
|
44572
|
-
});
|
|
44559
|
+
const workflows = activeWorkflows.map((w) => extractResourceMetadata(w, schemaWarnings));
|
|
44560
|
+
const agents = activeAgents.map((a) => extractResourceMetadata(a, schemaWarnings));
|
|
44573
44561
|
if (schemaWarnings.length > 0) {
|
|
44574
44562
|
for (const warning of schemaWarnings) {
|
|
44575
44563
|
console.log(source_default.yellow(` warn ${warning}`));
|
|
@@ -44684,103 +44672,83 @@ startWorker(org)
|
|
|
44684
44672
|
// src/cli/commands/check.ts
|
|
44685
44673
|
var import_meta2 = {};
|
|
44686
44674
|
function registerCheckCommand(program3) {
|
|
44687
|
-
program3.command("check").description(
|
|
44688
|
-
|
|
44689
|
-
|
|
44690
|
-
|
|
44691
|
-
const
|
|
44692
|
-
const
|
|
44693
|
-
|
|
44694
|
-
|
|
44695
|
-
|
|
44696
|
-
|
|
44697
|
-
|
|
44698
|
-
|
|
44699
|
-
|
|
44700
|
-
|
|
44701
|
-
|
|
44702
|
-
|
|
44703
|
-
|
|
44704
|
-
|
|
44705
|
-
|
|
44706
|
-
|
|
44707
|
-
|
|
44708
|
-
|
|
44709
|
-
|
|
44710
|
-
|
|
44711
|
-
|
|
44712
|
-
|
|
44713
|
-
|
|
44714
|
-
|
|
44715
|
-
|
|
44716
|
-
|
|
44717
|
-
|
|
44718
|
-
|
|
44719
|
-
|
|
44720
|
-
|
|
44721
|
-
console.log(source_default.gray(`
|
|
44722
|
-
|
|
44723
|
-
|
|
44724
|
-
|
|
44725
|
-
|
|
44726
|
-
|
|
44727
|
-
|
|
44728
|
-
|
|
44729
|
-
|
|
44730
|
-
|
|
44731
|
-
external_exports.toJSONSchema(w.contract.inputSchema);
|
|
44732
|
-
} catch {
|
|
44733
|
-
schemaWarnings.push(`${w.config.resourceId}: inputSchema could not be serialized`);
|
|
44734
|
-
}
|
|
44675
|
+
program3.command("check").description(
|
|
44676
|
+
"Validate project resources against the ResourceRegistry\n Example: elevasis-sdk check --entry ./src/index.ts"
|
|
44677
|
+
).option("--entry <path>", "Path to entry file (default: ./src/index.ts)").action(
|
|
44678
|
+
wrapAction("check", async (options2) => {
|
|
44679
|
+
const entryPath = options2.entry ?? "./src/index.ts";
|
|
44680
|
+
const spinner = ora("Validating resources...").start();
|
|
44681
|
+
try {
|
|
44682
|
+
const jiti = (0, import_jiti2.createJiti)(import_meta2.url);
|
|
44683
|
+
const entryModule = await jiti.import((0, import_path2.resolve)(entryPath));
|
|
44684
|
+
const org = entryModule.default;
|
|
44685
|
+
if (!org) {
|
|
44686
|
+
spinner.fail("Invalid entry: no default export found");
|
|
44687
|
+
console.error(source_default.gray(` Entry file: ${(0, import_path2.resolve)(entryPath)}`));
|
|
44688
|
+
console.error(source_default.gray(" Expected: export default { workflows: [...], agents: [...] }"));
|
|
44689
|
+
throw new Error("Invalid entry");
|
|
44690
|
+
}
|
|
44691
|
+
new ResourceRegistry({ _check: org });
|
|
44692
|
+
const workflowCount = org.workflows?.length ?? 0;
|
|
44693
|
+
const agentCount = org.agents?.length ?? 0;
|
|
44694
|
+
const totalCount = workflowCount + agentCount;
|
|
44695
|
+
spinner.succeed(
|
|
44696
|
+
source_default.green("Validation passed") + source_default.gray(` (${totalCount} resource${totalCount !== 1 ? "s" : ""}, 0 errors)`)
|
|
44697
|
+
);
|
|
44698
|
+
if (workflowCount > 0) {
|
|
44699
|
+
console.log(source_default.gray(` Workflows: ${workflowCount}`));
|
|
44700
|
+
}
|
|
44701
|
+
if (agentCount > 0) {
|
|
44702
|
+
console.log(source_default.gray(` Agents: ${agentCount}`));
|
|
44703
|
+
}
|
|
44704
|
+
const triggerCount = org.triggers?.length ?? 0;
|
|
44705
|
+
const integrationCount = org.integrations?.length ?? 0;
|
|
44706
|
+
const checkpointCount = org.humanCheckpoints?.length ?? 0;
|
|
44707
|
+
if (triggerCount > 0) console.log(source_default.gray(` Triggers: ${triggerCount}`));
|
|
44708
|
+
if (integrationCount > 0) console.log(source_default.gray(` Integrations: ${integrationCount}`));
|
|
44709
|
+
if (checkpointCount > 0) console.log(source_default.gray(` Checkpoints: ${checkpointCount}`));
|
|
44710
|
+
const relationshipCount = org.relationships ? Object.keys(org.relationships).length : 0;
|
|
44711
|
+
if (relationshipCount > 0) {
|
|
44712
|
+
console.log(source_default.gray(` Relationships: ${relationshipCount}`));
|
|
44713
|
+
}
|
|
44714
|
+
const documentation = await scanDocumentation();
|
|
44715
|
+
if (documentation) {
|
|
44716
|
+
console.log(
|
|
44717
|
+
source_default.gray(` Docs: ${documentation.length} file${documentation.length !== 1 ? "s" : ""}`)
|
|
44718
|
+
);
|
|
44735
44719
|
}
|
|
44736
|
-
|
|
44737
|
-
|
|
44738
|
-
|
|
44739
|
-
} catch {
|
|
44740
|
-
schemaWarnings.push(`${w.config.resourceId}: outputSchema could not be serialized`);
|
|
44741
|
-
}
|
|
44720
|
+
const schemaWarnings = [];
|
|
44721
|
+
for (const w of org.workflows ?? []) {
|
|
44722
|
+
extractResourceMetadata(w, schemaWarnings);
|
|
44742
44723
|
}
|
|
44743
|
-
|
|
44744
|
-
|
|
44745
|
-
if (a.contract.inputSchema) {
|
|
44746
|
-
try {
|
|
44747
|
-
external_exports.toJSONSchema(a.contract.inputSchema);
|
|
44748
|
-
} catch {
|
|
44749
|
-
schemaWarnings.push(`${a.config.resourceId}: inputSchema could not be serialized`);
|
|
44750
|
-
}
|
|
44724
|
+
for (const a of org.agents ?? []) {
|
|
44725
|
+
extractResourceMetadata(a, schemaWarnings);
|
|
44751
44726
|
}
|
|
44752
|
-
if (
|
|
44753
|
-
|
|
44754
|
-
|
|
44755
|
-
|
|
44756
|
-
schemaWarnings.push(`${a.config.resourceId}: outputSchema could not be serialized`);
|
|
44727
|
+
if (schemaWarnings.length > 0) {
|
|
44728
|
+
console.log("");
|
|
44729
|
+
for (const warning of schemaWarnings) {
|
|
44730
|
+
console.log(source_default.yellow(` warn ${warning}`));
|
|
44757
44731
|
}
|
|
44732
|
+
console.log(source_default.gray(" Schemas will be unavailable on the platform for these resources."));
|
|
44758
44733
|
}
|
|
44759
|
-
}
|
|
44760
|
-
|
|
44761
|
-
|
|
44762
|
-
|
|
44763
|
-
console.
|
|
44764
|
-
|
|
44765
|
-
|
|
44766
|
-
|
|
44767
|
-
|
|
44768
|
-
|
|
44769
|
-
|
|
44770
|
-
|
|
44771
|
-
|
|
44772
|
-
if (error46.resourceId) {
|
|
44773
|
-
console.error(source_default.gray(` Resource: ${error46.resourceId}`));
|
|
44774
|
-
}
|
|
44775
|
-
if (error46.field) {
|
|
44776
|
-
console.error(source_default.gray(` Field: ${error46.field}`));
|
|
44734
|
+
} catch (error46) {
|
|
44735
|
+
if (error46 instanceof RegistryValidationError) {
|
|
44736
|
+
spinner.fail(source_default.red("Validation failed"));
|
|
44737
|
+
console.error("");
|
|
44738
|
+
console.error(source_default.red(` ERROR ${error46.message}`));
|
|
44739
|
+
if (error46.resourceId) {
|
|
44740
|
+
console.error(source_default.gray(` Resource: ${error46.resourceId}`));
|
|
44741
|
+
}
|
|
44742
|
+
if (error46.field) {
|
|
44743
|
+
console.error(source_default.gray(` Field: ${error46.field}`));
|
|
44744
|
+
}
|
|
44745
|
+
console.error("");
|
|
44746
|
+
console.error(source_default.gray(" 1 error. Fix the issue and run again."));
|
|
44777
44747
|
}
|
|
44778
|
-
|
|
44779
|
-
console.error(source_default.gray(" 1 error. Fix the issue and run again."));
|
|
44748
|
+
throw error46;
|
|
44780
44749
|
}
|
|
44781
|
-
|
|
44782
|
-
|
|
44783
|
-
}));
|
|
44750
|
+
})
|
|
44751
|
+
);
|
|
44784
44752
|
}
|
|
44785
44753
|
|
|
44786
44754
|
// src/cli/commands/exec.ts
|
package/dist/index.d.ts
CHANGED
|
@@ -588,7 +588,7 @@ type OpenRouterModel = 'openrouter/anthropic/claude-sonnet-4.5' | 'openrouter/de
|
|
|
588
588
|
/**
|
|
589
589
|
* Supported Google models (direct SDK access)
|
|
590
590
|
*/
|
|
591
|
-
type GoogleModel = 'gemini-3-flash-preview';
|
|
591
|
+
type GoogleModel = 'gemini-3-flash-preview' | 'gemini-3.1-flash-lite-preview';
|
|
592
592
|
/**
|
|
593
593
|
* Supported Anthropic models (direct SDK access via @anthropic-ai/sdk)
|
|
594
594
|
* Using aliases for automatic updates to latest versions
|
package/dist/index.js
CHANGED
|
@@ -236,11 +236,10 @@ var GoogleOptionsSchema = z.object({
|
|
|
236
236
|
thinkingLevel: z.enum(["minimal", "low", "medium", "high"]).optional()
|
|
237
237
|
});
|
|
238
238
|
var GoogleConfigSchema = z.object({
|
|
239
|
-
model: z.enum(["gemini-3-flash-preview"]),
|
|
239
|
+
model: z.enum(["gemini-3-flash-preview", "gemini-3.1-flash-lite-preview"]),
|
|
240
240
|
provider: z.literal("google"),
|
|
241
241
|
apiKey: z.string(),
|
|
242
|
-
temperature: z.
|
|
243
|
-
// Must be 1 for Gemini 3 (changing degrades performance)
|
|
242
|
+
temperature: z.number().min(0).max(2).optional(),
|
|
244
243
|
maxOutputTokens: z.number().min(500).optional(),
|
|
245
244
|
topP: z.number().min(0).max(1).optional(),
|
|
246
245
|
modelOptions: GoogleOptionsSchema.optional()
|
|
@@ -348,6 +347,18 @@ var MODEL_INFO = {
|
|
|
348
347
|
category: "standard",
|
|
349
348
|
configSchema: GoogleConfigSchema
|
|
350
349
|
},
|
|
350
|
+
"gemini-3.1-flash-lite-preview": {
|
|
351
|
+
inputCostPer1M: 25,
|
|
352
|
+
// $0.25 per 1M tokens
|
|
353
|
+
outputCostPer1M: 150,
|
|
354
|
+
// $1.50 per 1M tokens
|
|
355
|
+
minTokens: 4e3,
|
|
356
|
+
recommendedTokens: 8e3,
|
|
357
|
+
maxTokens: 1e6,
|
|
358
|
+
// 1M context window
|
|
359
|
+
category: "standard",
|
|
360
|
+
configSchema: GoogleConfigSchema
|
|
361
|
+
},
|
|
351
362
|
// Anthropic Claude Models (direct SDK access via @anthropic-ai/sdk)
|
|
352
363
|
// Using aliases - automatically points to latest versions
|
|
353
364
|
"claude-opus-4-5": {
|
package/dist/worker/index.js
CHANGED
|
@@ -2638,11 +2638,10 @@ var GoogleOptionsSchema = z.object({
|
|
|
2638
2638
|
thinkingLevel: z.enum(["minimal", "low", "medium", "high"]).optional()
|
|
2639
2639
|
});
|
|
2640
2640
|
var GoogleConfigSchema = z.object({
|
|
2641
|
-
model: z.enum(["gemini-3-flash-preview"]),
|
|
2641
|
+
model: z.enum(["gemini-3-flash-preview", "gemini-3.1-flash-lite-preview"]),
|
|
2642
2642
|
provider: z.literal("google"),
|
|
2643
2643
|
apiKey: z.string(),
|
|
2644
|
-
temperature: z.
|
|
2645
|
-
// Must be 1 for Gemini 3 (changing degrades performance)
|
|
2644
|
+
temperature: z.number().min(0).max(2).optional(),
|
|
2646
2645
|
maxOutputTokens: z.number().min(500).optional(),
|
|
2647
2646
|
topP: z.number().min(0).max(1).optional(),
|
|
2648
2647
|
modelOptions: GoogleOptionsSchema.optional()
|
|
@@ -2750,6 +2749,18 @@ var MODEL_INFO = {
|
|
|
2750
2749
|
category: "standard",
|
|
2751
2750
|
configSchema: GoogleConfigSchema
|
|
2752
2751
|
},
|
|
2752
|
+
"gemini-3.1-flash-lite-preview": {
|
|
2753
|
+
inputCostPer1M: 25,
|
|
2754
|
+
// $0.25 per 1M tokens
|
|
2755
|
+
outputCostPer1M: 150,
|
|
2756
|
+
// $1.50 per 1M tokens
|
|
2757
|
+
minTokens: 4e3,
|
|
2758
|
+
recommendedTokens: 8e3,
|
|
2759
|
+
maxTokens: 1e6,
|
|
2760
|
+
// 1M context window
|
|
2761
|
+
category: "standard",
|
|
2762
|
+
configSchema: GoogleConfigSchema
|
|
2763
|
+
},
|
|
2753
2764
|
// Anthropic Claude Models (direct SDK access via @anthropic-ai/sdk)
|
|
2754
2765
|
// Using aliases - automatically points to latest versions
|
|
2755
2766
|
"claude-opus-4-5": {
|