@elevasis/sdk 1.51.0 → 1.52.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/{chunk-HIVK54X6.js → chunk-T6DTAP2U.js} +121 -18
- package/dist/{chunk-NNRXVYNC.js → chunk-XC57JNMA.js} +79 -19
- package/dist/cli.cjs +151 -19
- package/dist/index.d.ts +248 -1
- package/dist/index.js +1 -1
- package/dist/test-utils/index.d.ts +13 -2
- package/dist/test-utils/index.js +16 -3
- package/dist/worker/index.d.ts +1 -1
- package/dist/worker/index.js +2 -2
- package/package.json +4 -4
- package/reference/_navigation.md +1 -2
- package/reference/_reference-manifest.json +0 -14
- package/reference/packages/ui/src/hooks/README.md +22 -23
- package/reference/scaffold/recipes/extend-content.md +260 -12
- package/reference/ui/exports.mdx +0 -1
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import { ProcessingStageStatusSchema, ListBuilderStageKeySchema, zodToJsonSchema, LLMResponseParseError, errorToString, getErrorDetails, ExecutionError2, validateEntryPoint, validateTerminalSteps, validateStepReferences, logWorkflowStart, detectCycle, WorkflowStepError, logStepStart, validateTerminalOutput, logStepSuccess, determineNextStep, logStepFailure, logExecutionPath, logWorkflowSuccess, logWorkflowFailure, estimateTokens, truncationCharBudget, buildIterationResponseSchema } from './chunk-
|
|
1
|
+
import { ProcessingStageStatusSchema, ListBuilderStageKeySchema, zodToJsonSchema, LLMResponseParseError, errorToString, getErrorDetails, ExecutionError2, validateEntryPoint, validateTerminalSteps, validateStepReferences, WorkflowTimeoutError, WorkflowStalledError, WorkflowCancellationError, logWorkflowStart, detectCycle, WorkflowStepError, logStepStart, validateTerminalOutput, logStepSuccess, determineNextStep, logStepFailure, logExecutionPath, logWorkflowSuccess, logWorkflowFailure, estimateTokens, truncationCharBudget, buildIterationResponseSchema } from './chunk-XC57JNMA.js';
|
|
2
2
|
import { workerData, parentPort } from 'worker_threads';
|
|
3
3
|
import { z, ZodError } from 'zod';
|
|
4
4
|
import { createHmac } from 'crypto';
|
|
5
5
|
|
|
6
|
+
// ../core/src/execution/engine/base/utils.ts
|
|
7
|
+
function abortKindFor(signal) {
|
|
8
|
+
if (!signal?.aborted) return null;
|
|
9
|
+
if (signal.reason === "timeout") return "timeout";
|
|
10
|
+
if (signal.reason === "stalled") return "stalled";
|
|
11
|
+
return "cancelled";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// ../core/src/platform/constants/timeouts.ts
|
|
15
|
+
var DEFAULT_TOOL_TIMEOUT = 18e5;
|
|
16
|
+
var DEFAULT_EXECUTION_TIMEOUT = 72e5;
|
|
17
|
+
|
|
6
18
|
// ../core/src/execution/engine/workflow/workflow.ts
|
|
7
19
|
var Workflow = class {
|
|
8
20
|
config;
|
|
@@ -26,6 +38,33 @@ var Workflow = class {
|
|
|
26
38
|
validateTerminalSteps(this.steps, this.config.resourceId);
|
|
27
39
|
validateStepReferences(this.steps);
|
|
28
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Build the error for an aborted execution, or `null` when the signal has not fired.
|
|
43
|
+
*
|
|
44
|
+
* Mirrors `Agent.abortErrorFor`, sharing its `abortKindFor` classification so a cancelled workflow and
|
|
45
|
+
* a cancelled agent are described the same way, and differing only in the error family -- these carry
|
|
46
|
+
* `category: 'workflow'`, which is what the `execution_errors` row and the API response report.
|
|
47
|
+
*
|
|
48
|
+
* @returns `null` when the signal is not aborted -- callers throw only when this returns non-null.
|
|
49
|
+
*/
|
|
50
|
+
abortErrorFor(signal, stepId, executionPath) {
|
|
51
|
+
const kind = abortKindFor(signal);
|
|
52
|
+
if (!kind) return null;
|
|
53
|
+
if (kind === "timeout") {
|
|
54
|
+
return new WorkflowTimeoutError(`Workflow execution exceeded timeout (${DEFAULT_EXECUTION_TIMEOUT}ms)`, {
|
|
55
|
+
timeout: DEFAULT_EXECUTION_TIMEOUT,
|
|
56
|
+
stepId,
|
|
57
|
+
executionPath
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
if (kind === "stalled") {
|
|
61
|
+
return new WorkflowStalledError("Execution stalled: no heartbeat received within threshold", {
|
|
62
|
+
stepId,
|
|
63
|
+
executionPath
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return new WorkflowCancellationError("Execution cancelled by user", { stepId, executionPath });
|
|
67
|
+
}
|
|
29
68
|
/**
|
|
30
69
|
* Execute the workflow with graph-based flow control
|
|
31
70
|
* Context is required for execution tracking, logging, and organization isolation
|
|
@@ -40,6 +79,8 @@ var Workflow = class {
|
|
|
40
79
|
let currentData = validated;
|
|
41
80
|
let currentStepId = this.entryPoint;
|
|
42
81
|
while (currentStepId !== null) {
|
|
82
|
+
const abortError = this.abortErrorFor(context.signal, currentStepId, executionPath);
|
|
83
|
+
if (abortError) throw abortError;
|
|
43
84
|
detectCycle(visited, executionPath, currentStepId);
|
|
44
85
|
visited.add(currentStepId);
|
|
45
86
|
executionPath.push(currentStepId);
|
|
@@ -791,10 +832,23 @@ var ToolingError = class extends ExecutionError2 {
|
|
|
791
832
|
}
|
|
792
833
|
return "warning";
|
|
793
834
|
}
|
|
835
|
+
/**
|
|
836
|
+
* Set by `withRetry` on the error it throws once its own attempts are spent.
|
|
837
|
+
*
|
|
838
|
+
* Without it the error type says only what KIND of failure happened, never whether anything has
|
|
839
|
+
* already been tried, so a retryable classification survives being retried. Nesting one
|
|
840
|
+
* `withRetry` inside another then multiplies: the integration path wraps `adapter.call` in one
|
|
841
|
+
* and 54 adapter fetch modules wrap their own request in another, and a persistent provider
|
|
842
|
+
* failure made 16 requests where the policy says 4.
|
|
843
|
+
*/
|
|
844
|
+
retryExhausted = false;
|
|
794
845
|
/**
|
|
795
846
|
* Check if error is retryable
|
|
796
847
|
*/
|
|
797
848
|
isRetryable() {
|
|
849
|
+
if (this.retryExhausted) {
|
|
850
|
+
return false;
|
|
851
|
+
}
|
|
798
852
|
return [
|
|
799
853
|
"service_unavailable",
|
|
800
854
|
"rate_limit_exceeded",
|
|
@@ -825,10 +879,6 @@ function cancelled(message, details) {
|
|
|
825
879
|
return new ToolingError("cancelled", message, details);
|
|
826
880
|
}
|
|
827
881
|
|
|
828
|
-
// ../core/src/platform/constants/timeouts.ts
|
|
829
|
-
var DEFAULT_TOOL_TIMEOUT = 18e5;
|
|
830
|
-
var DEFAULT_EXECUTION_TIMEOUT = 72e5;
|
|
831
|
-
|
|
832
882
|
// ../core/src/execution/engine/agent/memory/truncation.ts
|
|
833
883
|
var CLOSING_BRACKET_RESERVE = 32;
|
|
834
884
|
var DANGLING_KEY_WITH_COLON = /,?\s*"(?:[^"\\]|\\.)*"\s*:\s*$/;
|
|
@@ -1170,6 +1220,37 @@ var AgentNoProgressError = class extends AgentError {
|
|
|
1170
1220
|
}
|
|
1171
1221
|
};
|
|
1172
1222
|
|
|
1223
|
+
// ../core/src/platform/utils/concurrency.ts
|
|
1224
|
+
async function allSettledWithConcurrency(items, limit, task) {
|
|
1225
|
+
if (items.length === 0) return [];
|
|
1226
|
+
const bound = Math.max(1, Math.floor(limit));
|
|
1227
|
+
if (bound >= items.length) {
|
|
1228
|
+
return Promise.allSettled(items.map((item, index) => task(item, index)));
|
|
1229
|
+
}
|
|
1230
|
+
const results = new Array(items.length);
|
|
1231
|
+
let cursor = 0;
|
|
1232
|
+
const worker = async () => {
|
|
1233
|
+
while (cursor < items.length) {
|
|
1234
|
+
const index = cursor++;
|
|
1235
|
+
try {
|
|
1236
|
+
results[index] = { status: "fulfilled", value: await task(items[index], index) };
|
|
1237
|
+
} catch (reason) {
|
|
1238
|
+
results[index] = { status: "rejected", reason };
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
};
|
|
1242
|
+
await Promise.all(Array.from({ length: bound }, worker));
|
|
1243
|
+
return results;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
// ../core/src/platform/constants/limits.ts
|
|
1247
|
+
var MAX_SESSION_MEMORY_KEYS = 25;
|
|
1248
|
+
var MAX_MEMORY_TOKENS = 32e3;
|
|
1249
|
+
var MAX_SESSION_MEMORY_TOKENS = 8e3;
|
|
1250
|
+
var MAX_SINGLE_ENTRY_TOKENS = 2e3;
|
|
1251
|
+
var MAX_TOOL_RESULT_TOKENS = 4e3;
|
|
1252
|
+
var MAX_CONCURRENT_TOOL_CALLS = 8;
|
|
1253
|
+
|
|
1173
1254
|
// ../core/src/execution/engine/agent/actions/processor.ts
|
|
1174
1255
|
function normalizeSessionMessages(actions, sessionCapable) {
|
|
1175
1256
|
if (!sessionCapable) {
|
|
@@ -1231,7 +1312,11 @@ async function processActions(iterationContext, response) {
|
|
|
1231
1312
|
}
|
|
1232
1313
|
let shouldComplete = completeRequested && toolCalls.length === 0;
|
|
1233
1314
|
if (toolCalls.length > 0) {
|
|
1234
|
-
const settled = await
|
|
1315
|
+
const settled = await allSettledWithConcurrency(
|
|
1316
|
+
toolCalls,
|
|
1317
|
+
MAX_CONCURRENT_TOOL_CALLS,
|
|
1318
|
+
(action) => executeToolCall(iterationContext, action)
|
|
1319
|
+
);
|
|
1235
1320
|
settled.forEach((outcome, index) => {
|
|
1236
1321
|
if (outcome.status === "rejected") {
|
|
1237
1322
|
const action = toolCalls[index];
|
|
@@ -1399,13 +1484,6 @@ function sanitizeUserInput(input) {
|
|
|
1399
1484
|
};
|
|
1400
1485
|
}
|
|
1401
1486
|
|
|
1402
|
-
// ../core/src/platform/constants/limits.ts
|
|
1403
|
-
var MAX_SESSION_MEMORY_KEYS = 25;
|
|
1404
|
-
var MAX_MEMORY_TOKENS = 32e3;
|
|
1405
|
-
var MAX_SESSION_MEMORY_TOKENS = 8e3;
|
|
1406
|
-
var MAX_SINGLE_ENTRY_TOKENS = 2e3;
|
|
1407
|
-
var MAX_TOOL_RESULT_TOKENS = 4e3;
|
|
1408
|
-
|
|
1409
1487
|
// ../core/src/execution/engine/agent/memory/manager.ts
|
|
1410
1488
|
var ENVELOPE_FULL_RESULT_WINDOW = 3;
|
|
1411
1489
|
function parseIfJson(content2) {
|
|
@@ -2115,15 +2193,20 @@ var Agent = class {
|
|
|
2115
2193
|
* between-iteration check (which never has an error, only the signal) and `wrapAndLogError`
|
|
2116
2194
|
* (which has both) agree on the same classification.
|
|
2117
2195
|
*
|
|
2196
|
+
* The reason-reading itself lives in `abortKindFor` so `Workflow.execute` can classify an abort the
|
|
2197
|
+
* same way without borrowing this method's `Agent*` error family -- those carry `category: 'agent'`,
|
|
2198
|
+
* which is written straight through to the `execution_errors` row.
|
|
2199
|
+
*
|
|
2118
2200
|
* @returns `null` when the signal is not aborted -- callers throw only when this returns non-null.
|
|
2119
2201
|
*/
|
|
2120
2202
|
abortErrorFor(signal, iteration) {
|
|
2121
|
-
|
|
2122
|
-
if (
|
|
2203
|
+
const kind = abortKindFor(signal);
|
|
2204
|
+
if (!kind) return null;
|
|
2205
|
+
if (kind === "timeout") {
|
|
2123
2206
|
const timeout = this.config.constraints?.timeout ?? DEFAULT_EXECUTION_TIMEOUT;
|
|
2124
2207
|
return new AgentTimeoutError(`Agent execution exceeded timeout (${timeout}ms)`, { timeout, iteration });
|
|
2125
2208
|
}
|
|
2126
|
-
if (
|
|
2209
|
+
if (kind === "stalled") {
|
|
2127
2210
|
return new AgentStalledError("Execution stalled: no heartbeat received within threshold", { iteration });
|
|
2128
2211
|
}
|
|
2129
2212
|
return new AgentCancellationError("Execution cancelled by user", { iteration });
|
|
@@ -4373,11 +4456,27 @@ function startWorker(org) {
|
|
|
4373
4456
|
throw new Error("Agent did not produce memory snapshot");
|
|
4374
4457
|
}
|
|
4375
4458
|
const durationMs = Date.now() - startTime;
|
|
4376
|
-
|
|
4459
|
+
const stopReason = agentInstance.getStopReason();
|
|
4460
|
+
const budgetExhausted = stopReason === "budget_exhausted";
|
|
4461
|
+
if (budgetExhausted) {
|
|
4462
|
+
console.warn(`[SDK-WORKER] Agent '${resourceId}' exhausted its iteration budget (${durationMs}ms)`);
|
|
4463
|
+
} else {
|
|
4464
|
+
console.log(`[SDK-WORKER] Agent '${resourceId}' completed (${durationMs}ms)`);
|
|
4465
|
+
}
|
|
4377
4466
|
parentPort.postMessage({
|
|
4378
4467
|
type: "result",
|
|
4379
|
-
status: "completed",
|
|
4468
|
+
status: budgetExhausted ? "failed" : "completed",
|
|
4469
|
+
...budgetExhausted ? {
|
|
4470
|
+
error: "Agent stopped without completing: iteration budget exhausted. Any output below was synthesized from partial work.",
|
|
4471
|
+
errorName: "AgentBudgetExhaustedError",
|
|
4472
|
+
errorCode: "agent_budget_exhausted"
|
|
4473
|
+
} : {},
|
|
4380
4474
|
output,
|
|
4475
|
+
stopReason,
|
|
4476
|
+
// Whether the agent emitted an assistant message this turn. `Agent` has tracked this for
|
|
4477
|
+
// the `agent-turn-silent` detector, which logged to a sink nothing reads; carrying it lets
|
|
4478
|
+
// a silent turn be seen where the turn is recorded.
|
|
4479
|
+
hasSpoken: agentInstance.hasSpoken(),
|
|
4381
4480
|
memorySnapshot,
|
|
4382
4481
|
logs,
|
|
4383
4482
|
metrics: { durationMs }
|
|
@@ -4391,6 +4490,10 @@ function startWorker(org) {
|
|
|
4391
4490
|
type: "result",
|
|
4392
4491
|
status: "failed",
|
|
4393
4492
|
...serializedError,
|
|
4493
|
+
// Carried on the throwing path too: a turn that failed after the agent had already
|
|
4494
|
+
// stopped for its own reason is a different diagnosis from one that failed mid-iteration,
|
|
4495
|
+
// and `stopReason` is the only thing that separates them.
|
|
4496
|
+
...agentInstance ? { stopReason: agentInstance.getStopReason(), hasSpoken: agentInstance.hasSpoken() } : {},
|
|
4394
4497
|
...memorySnapshot ? { memorySnapshot } : {},
|
|
4395
4498
|
logs,
|
|
4396
4499
|
metrics: { durationMs }
|
|
@@ -4610,6 +4610,41 @@ var WorkflowValidationError = class extends ExecutionError2 {
|
|
|
4610
4610
|
super(message, context);
|
|
4611
4611
|
}
|
|
4612
4612
|
};
|
|
4613
|
+
var WorkflowTimeoutError = class extends ExecutionError2 {
|
|
4614
|
+
type = "workflow_timeout_error";
|
|
4615
|
+
severity = "critical";
|
|
4616
|
+
category = "workflow";
|
|
4617
|
+
constructor(message, context) {
|
|
4618
|
+
super(message, context);
|
|
4619
|
+
}
|
|
4620
|
+
/** The ceiling was reached, so a retry has no budget to run in. */
|
|
4621
|
+
isRetryable() {
|
|
4622
|
+
return false;
|
|
4623
|
+
}
|
|
4624
|
+
};
|
|
4625
|
+
var WorkflowStalledError = class extends ExecutionError2 {
|
|
4626
|
+
type = "workflow_stalled_error";
|
|
4627
|
+
severity = "critical";
|
|
4628
|
+
category = "workflow";
|
|
4629
|
+
constructor(message, context) {
|
|
4630
|
+
super(message, context);
|
|
4631
|
+
}
|
|
4632
|
+
isRetryable() {
|
|
4633
|
+
return false;
|
|
4634
|
+
}
|
|
4635
|
+
};
|
|
4636
|
+
var WorkflowCancellationError = class extends ExecutionError2 {
|
|
4637
|
+
type = "workflow_cancellation_error";
|
|
4638
|
+
severity = "warning";
|
|
4639
|
+
category = "workflow";
|
|
4640
|
+
constructor(message, context) {
|
|
4641
|
+
super(message, context);
|
|
4642
|
+
}
|
|
4643
|
+
/** The user asked for this. Retrying would override an explicit instruction. */
|
|
4644
|
+
isRetryable() {
|
|
4645
|
+
return false;
|
|
4646
|
+
}
|
|
4647
|
+
};
|
|
4613
4648
|
|
|
4614
4649
|
// ../core/src/execution/engine/workflow/utils.ts
|
|
4615
4650
|
function validateEntryPoint(steps, entryPoint) {
|
|
@@ -5377,11 +5412,6 @@ function validateAgentGrammar(orgName, agentId, agent, mode) {
|
|
|
5377
5412
|
function validateAgentCheapAssertions(orgName, agentId, agent, mode) {
|
|
5378
5413
|
const issues = [];
|
|
5379
5414
|
const config = agent.config;
|
|
5380
|
-
if (config.sessionCapable && config.securityLevel === "none") {
|
|
5381
|
-
issues.push(
|
|
5382
|
-
`securityLevel: 'none' on a sessionCapable agent -- a session agent takes untrusted user input and must run with prompt-injection defenses ('standard' or 'hardened').`
|
|
5383
|
-
);
|
|
5384
|
-
}
|
|
5385
5415
|
if (!isStubDefinition(agent) && !config.systemPrompt.trim()) {
|
|
5386
5416
|
issues.push(`systemPrompt is empty -- an agent with no behavioural instructions cannot be deployed.`);
|
|
5387
5417
|
}
|
|
@@ -5660,6 +5690,48 @@ function validateHumanCheckpoints(orgName, humanCheckpoints, allInternalIds, val
|
|
|
5660
5690
|
});
|
|
5661
5691
|
}
|
|
5662
5692
|
|
|
5693
|
+
// ../core/src/execution/engine/base/redaction.ts
|
|
5694
|
+
function normalizeKey(key) {
|
|
5695
|
+
return key.toLowerCase().replace(/[_\-.\s]/g, "");
|
|
5696
|
+
}
|
|
5697
|
+
var SECRET_PATTERNS = [
|
|
5698
|
+
"apikey",
|
|
5699
|
+
"secret",
|
|
5700
|
+
"password",
|
|
5701
|
+
"passphrase",
|
|
5702
|
+
"token",
|
|
5703
|
+
"credential",
|
|
5704
|
+
"privatekey",
|
|
5705
|
+
"accesskey",
|
|
5706
|
+
"authorization",
|
|
5707
|
+
"bearer"
|
|
5708
|
+
];
|
|
5709
|
+
var SECRET_PLURAL_EXCEPTIONS = /* @__PURE__ */ new Set([
|
|
5710
|
+
"refreshtokens",
|
|
5711
|
+
"accesstokens",
|
|
5712
|
+
"apitokens",
|
|
5713
|
+
"authtokens",
|
|
5714
|
+
"bearertokens",
|
|
5715
|
+
"sessiontokens",
|
|
5716
|
+
"bypasstokens",
|
|
5717
|
+
"validtokens"
|
|
5718
|
+
]);
|
|
5719
|
+
function isTokenCountKey(normalized) {
|
|
5720
|
+
if (SECRET_PLURAL_EXCEPTIONS.has(normalized)) return false;
|
|
5721
|
+
if (normalized.endsWith("tokens")) return true;
|
|
5722
|
+
return ["tokenbudget", "tokenlimit", "tokencount", "tokenusage"].some((k) => normalized.includes(k));
|
|
5723
|
+
}
|
|
5724
|
+
function isSecretKey(key) {
|
|
5725
|
+
const normalized = normalizeKey(key);
|
|
5726
|
+
if (isTokenCountKey(normalized)) return false;
|
|
5727
|
+
return SECRET_PATTERNS.some((pattern) => normalized.includes(pattern));
|
|
5728
|
+
}
|
|
5729
|
+
function redactSecretValue(value) {
|
|
5730
|
+
if (typeof value !== "string") return "[REDACTED]";
|
|
5731
|
+
if (value.length <= 7) return "[REDACTED]";
|
|
5732
|
+
return value.substring(0, 7) + "...";
|
|
5733
|
+
}
|
|
5734
|
+
|
|
5663
5735
|
// ../core/src/execution/engine/base/serialization.ts
|
|
5664
5736
|
function serializeDefinition(definition, options) {
|
|
5665
5737
|
const opts = {
|
|
@@ -5697,7 +5769,7 @@ function serializeObject(obj, ctx) {
|
|
|
5697
5769
|
for (const [key, val] of Object.entries(obj)) {
|
|
5698
5770
|
if (typeof val === "function") continue;
|
|
5699
5771
|
if (ctx.redactSecrets && isSecretKey(key)) {
|
|
5700
|
-
result[key] =
|
|
5772
|
+
result[key] = redactSecretValue(val);
|
|
5701
5773
|
continue;
|
|
5702
5774
|
}
|
|
5703
5775
|
if (key === "steps" && isWorkflowStepsRecord(val)) {
|
|
@@ -5783,18 +5855,6 @@ function isToolObject(value) {
|
|
|
5783
5855
|
function isNextConfigObject(value) {
|
|
5784
5856
|
return value && typeof value === "object" && "type" in value && (value.type === StepType2.LINEAR || value.type === StepType2.CONDITIONAL);
|
|
5785
5857
|
}
|
|
5786
|
-
function isSecretKey(key) {
|
|
5787
|
-
const lower = key.toLowerCase();
|
|
5788
|
-
const whitelist = ["maxtokens", "memorytokens", "inputtokens", "outputtokens"];
|
|
5789
|
-
if (whitelist.some((w) => lower.includes(w))) return false;
|
|
5790
|
-
const patterns = ["apikey", "secret", "password", "token", "credential"];
|
|
5791
|
-
return patterns.some((p) => lower.includes(p));
|
|
5792
|
-
}
|
|
5793
|
-
function redactSecret(value) {
|
|
5794
|
-
if (typeof value !== "string") return "[REDACTED]";
|
|
5795
|
-
if (value.length <= 7) return "[REDACTED]";
|
|
5796
|
-
return value.substring(0, 7) + "...";
|
|
5797
|
-
}
|
|
5798
5858
|
|
|
5799
5859
|
// ../core/src/platform/registry/serialization.ts
|
|
5800
5860
|
function summarizeSystem(system) {
|
|
@@ -7898,4 +7958,4 @@ function defineWorkflowConfig(resourceId, descriptors, actionRegistry = []) {
|
|
|
7898
7958
|
}
|
|
7899
7959
|
var ListBuilderStageKeySchema = z.string().min(1);
|
|
7900
7960
|
|
|
7901
|
-
export { ActivityEventSchema, BuildPlanSnapshotStepSchema, ContractRefResolutionError, CrmStageKeySchema, CrmStateKeySchema, EmailSchema, ExecutionError, ExecutionError2, LLMResponseParseError, ListBuilderStageKeySchema, ProcessingStageStatusSchema, ProspectingBuildTemplateSchema, RegistryValidationError, ResourceRegistry, StepType, ToolingError, WorkflowStepError, bindResourceDescriptor, buildIterationResponseSchema, compileBusinessOntologyValidationIndex, concurrentPool, createLeadGenStageValidators, defineContract, defineResource, defineResourceOntology, defineResources, defineStep, defineTopology, defineTopologyRelationship, defineWorkflow, defineWorkflowConfig, deriveActions, detectCycle, determineNextStep, diagnosticOutput, errorToString, estimateTokens, getErrorDetails, integrationInput, isBuiltInReadinessProfile, isZodType, logExecutionPath, logStepFailure, logStepStart, logStepSuccess, logWorkflowFailure, logWorkflowStart, logWorkflowSuccess, lookupReadinessProfile, parseTopologyNodeRef, registerReadinessProfile, resolveContractRef, runDiagnostic, splitName, topologyRef, topologyRelationship, truncationCharBudget, validateDeclaredSystemInterfaceReadiness, validateDeploymentSpec, validateEntryPoint, validateRelationships, validateResourceGovernance, validateStepReferences, validateTerminalOutput, validateTerminalSteps, zodToJsonSchema };
|
|
7961
|
+
export { ActivityEventSchema, BuildPlanSnapshotStepSchema, ContractRefResolutionError, CrmStageKeySchema, CrmStateKeySchema, EmailSchema, ExecutionError, ExecutionError2, LLMResponseParseError, ListBuilderStageKeySchema, ProcessingStageStatusSchema, ProspectingBuildTemplateSchema, RegistryValidationError, ResourceRegistry, StepType, ToolingError, WorkflowCancellationError, WorkflowStalledError, WorkflowStepError, WorkflowTimeoutError, bindResourceDescriptor, buildIterationResponseSchema, compileBusinessOntologyValidationIndex, concurrentPool, createLeadGenStageValidators, defineContract, defineResource, defineResourceOntology, defineResources, defineStep, defineTopology, defineTopologyRelationship, defineWorkflow, defineWorkflowConfig, deriveActions, detectCycle, determineNextStep, diagnosticOutput, errorToString, estimateTokens, getErrorDetails, integrationInput, isBuiltInReadinessProfile, isZodType, logExecutionPath, logStepFailure, logStepStart, logStepSuccess, logWorkflowFailure, logWorkflowStart, logWorkflowSuccess, lookupReadinessProfile, parseTopologyNodeRef, registerReadinessProfile, resolveContractRef, runDiagnostic, splitName, topologyRef, topologyRelationship, truncationCharBudget, validateDeclaredSystemInterfaceReadiness, validateDeploymentSpec, validateEntryPoint, validateRelationships, validateResourceGovernance, validateStepReferences, validateTerminalOutput, validateTerminalSteps, zodToJsonSchema };
|
package/dist/cli.cjs
CHANGED
|
@@ -45563,11 +45563,6 @@ function validateAgentGrammar(orgName, agentId, agent, mode) {
|
|
|
45563
45563
|
function validateAgentCheapAssertions(orgName, agentId, agent, mode) {
|
|
45564
45564
|
const issues = [];
|
|
45565
45565
|
const config3 = agent.config;
|
|
45566
|
-
if (config3.sessionCapable && config3.securityLevel === "none") {
|
|
45567
|
-
issues.push(
|
|
45568
|
-
`securityLevel: 'none' on a sessionCapable agent -- a session agent takes untrusted user input and must run with prompt-injection defenses ('standard' or 'hardened').`
|
|
45569
|
-
);
|
|
45570
|
-
}
|
|
45571
45566
|
if (!isStubDefinition(agent) && !config3.systemPrompt.trim()) {
|
|
45572
45567
|
issues.push(`systemPrompt is empty -- an agent with no behavioural instructions cannot be deployed.`);
|
|
45573
45568
|
}
|
|
@@ -45875,6 +45870,54 @@ var init_validation2 = __esm({
|
|
|
45875
45870
|
}
|
|
45876
45871
|
});
|
|
45877
45872
|
|
|
45873
|
+
// ../core/src/execution/engine/base/redaction.ts
|
|
45874
|
+
function normalizeKey(key) {
|
|
45875
|
+
return key.toLowerCase().replace(/[_\-.\s]/g, "");
|
|
45876
|
+
}
|
|
45877
|
+
function isTokenCountKey(normalized) {
|
|
45878
|
+
if (SECRET_PLURAL_EXCEPTIONS.has(normalized)) return false;
|
|
45879
|
+
if (normalized.endsWith("tokens")) return true;
|
|
45880
|
+
return ["tokenbudget", "tokenlimit", "tokencount", "tokenusage"].some((k) => normalized.includes(k));
|
|
45881
|
+
}
|
|
45882
|
+
function isSecretKey(key) {
|
|
45883
|
+
const normalized = normalizeKey(key);
|
|
45884
|
+
if (isTokenCountKey(normalized)) return false;
|
|
45885
|
+
return SECRET_PATTERNS.some((pattern) => normalized.includes(pattern));
|
|
45886
|
+
}
|
|
45887
|
+
function redactSecretValue(value) {
|
|
45888
|
+
if (typeof value !== "string") return "[REDACTED]";
|
|
45889
|
+
if (value.length <= 7) return "[REDACTED]";
|
|
45890
|
+
return value.substring(0, 7) + "...";
|
|
45891
|
+
}
|
|
45892
|
+
var SECRET_PATTERNS, SECRET_PLURAL_EXCEPTIONS;
|
|
45893
|
+
var init_redaction = __esm({
|
|
45894
|
+
"../core/src/execution/engine/base/redaction.ts"() {
|
|
45895
|
+
"use strict";
|
|
45896
|
+
SECRET_PATTERNS = [
|
|
45897
|
+
"apikey",
|
|
45898
|
+
"secret",
|
|
45899
|
+
"password",
|
|
45900
|
+
"passphrase",
|
|
45901
|
+
"token",
|
|
45902
|
+
"credential",
|
|
45903
|
+
"privatekey",
|
|
45904
|
+
"accesskey",
|
|
45905
|
+
"authorization",
|
|
45906
|
+
"bearer"
|
|
45907
|
+
];
|
|
45908
|
+
SECRET_PLURAL_EXCEPTIONS = /* @__PURE__ */ new Set([
|
|
45909
|
+
"refreshtokens",
|
|
45910
|
+
"accesstokens",
|
|
45911
|
+
"apitokens",
|
|
45912
|
+
"authtokens",
|
|
45913
|
+
"bearertokens",
|
|
45914
|
+
"sessiontokens",
|
|
45915
|
+
"bypasstokens",
|
|
45916
|
+
"validtokens"
|
|
45917
|
+
]);
|
|
45918
|
+
}
|
|
45919
|
+
});
|
|
45920
|
+
|
|
45878
45921
|
// ../core/src/execution/engine/base/serialization.ts
|
|
45879
45922
|
function serializeDefinition(definition, options) {
|
|
45880
45923
|
const opts = {
|
|
@@ -45912,7 +45955,7 @@ function serializeObject(obj, ctx) {
|
|
|
45912
45955
|
for (const [key, val] of Object.entries(obj)) {
|
|
45913
45956
|
if (typeof val === "function") continue;
|
|
45914
45957
|
if (ctx.redactSecrets && isSecretKey(key)) {
|
|
45915
|
-
result[key] =
|
|
45958
|
+
result[key] = redactSecretValue(val);
|
|
45916
45959
|
continue;
|
|
45917
45960
|
}
|
|
45918
45961
|
if (key === "steps" && isWorkflowStepsRecord(val)) {
|
|
@@ -45998,23 +46041,12 @@ function isToolObject(value) {
|
|
|
45998
46041
|
function isNextConfigObject(value) {
|
|
45999
46042
|
return value && typeof value === "object" && "type" in value && (value.type === StepType.LINEAR || value.type === StepType.CONDITIONAL);
|
|
46000
46043
|
}
|
|
46001
|
-
function isSecretKey(key) {
|
|
46002
|
-
const lower = key.toLowerCase();
|
|
46003
|
-
const whitelist = ["maxtokens", "memorytokens", "inputtokens", "outputtokens"];
|
|
46004
|
-
if (whitelist.some((w) => lower.includes(w))) return false;
|
|
46005
|
-
const patterns = ["apikey", "secret", "password", "token", "credential"];
|
|
46006
|
-
return patterns.some((p) => lower.includes(p));
|
|
46007
|
-
}
|
|
46008
|
-
function redactSecret(value) {
|
|
46009
|
-
if (typeof value !== "string") return "[REDACTED]";
|
|
46010
|
-
if (value.length <= 7) return "[REDACTED]";
|
|
46011
|
-
return value.substring(0, 7) + "...";
|
|
46012
|
-
}
|
|
46013
46044
|
var init_serialization = __esm({
|
|
46014
46045
|
"../core/src/execution/engine/base/serialization.ts"() {
|
|
46015
46046
|
"use strict";
|
|
46016
46047
|
init_esm();
|
|
46017
46048
|
init_types5();
|
|
46049
|
+
init_redaction();
|
|
46018
46050
|
}
|
|
46019
46051
|
});
|
|
46020
46052
|
|
|
@@ -49298,7 +49330,7 @@ var init_package = __esm({
|
|
|
49298
49330
|
"package.json"() {
|
|
49299
49331
|
package_default = {
|
|
49300
49332
|
name: "@elevasis/sdk",
|
|
49301
|
-
version: "1.
|
|
49333
|
+
version: "1.52.0",
|
|
49302
49334
|
description: "SDK for building Elevasis organization resources",
|
|
49303
49335
|
type: "module",
|
|
49304
49336
|
bin: {
|
|
@@ -53628,6 +53660,106 @@ var UpdateNoteRequestSchema = external_exports.object({
|
|
|
53628
53660
|
metadata: external_exports.record(external_exports.string(), external_exports.unknown()).nullable().optional()
|
|
53629
53661
|
}).strict().refine((data) => Object.keys(data).length > 0, { message: "At least one field must be provided" });
|
|
53630
53662
|
var NoteIdParamsSchema = external_exports.object({ id: UuidSchema });
|
|
53663
|
+
var ProjectRowSchema = external_exports.object({
|
|
53664
|
+
id: external_exports.string(),
|
|
53665
|
+
organization_id: external_exports.string(),
|
|
53666
|
+
name: external_exports.string(),
|
|
53667
|
+
kind: external_exports.string(),
|
|
53668
|
+
status: external_exports.string(),
|
|
53669
|
+
description: external_exports.string().nullable(),
|
|
53670
|
+
deal_id: external_exports.string().nullable(),
|
|
53671
|
+
client_id: external_exports.string().nullable(),
|
|
53672
|
+
client_company_id: external_exports.string().nullable(),
|
|
53673
|
+
start_date: external_exports.string().nullable(),
|
|
53674
|
+
target_end_date: external_exports.string().nullable(),
|
|
53675
|
+
actual_end_date: external_exports.string().nullable(),
|
|
53676
|
+
contract_value: external_exports.number().nullable(),
|
|
53677
|
+
metadata: external_exports.unknown().nullable(),
|
|
53678
|
+
created_at: external_exports.string(),
|
|
53679
|
+
updated_at: external_exports.string()
|
|
53680
|
+
});
|
|
53681
|
+
var MilestoneRowSchema = external_exports.object({
|
|
53682
|
+
id: external_exports.string(),
|
|
53683
|
+
organization_id: external_exports.string(),
|
|
53684
|
+
project_id: external_exports.string(),
|
|
53685
|
+
name: external_exports.string(),
|
|
53686
|
+
status: external_exports.string(),
|
|
53687
|
+
description: external_exports.string().nullable(),
|
|
53688
|
+
due_date: external_exports.string().nullable(),
|
|
53689
|
+
completed_at: external_exports.string().nullable(),
|
|
53690
|
+
sequence: external_exports.number(),
|
|
53691
|
+
checklist: external_exports.unknown().nullable(),
|
|
53692
|
+
metadata: external_exports.unknown().nullable(),
|
|
53693
|
+
created_at: external_exports.string(),
|
|
53694
|
+
updated_at: external_exports.string()
|
|
53695
|
+
});
|
|
53696
|
+
var TaskRowSchema = external_exports.object({
|
|
53697
|
+
id: external_exports.string(),
|
|
53698
|
+
organization_id: external_exports.string(),
|
|
53699
|
+
project_id: external_exports.string(),
|
|
53700
|
+
name: external_exports.string(),
|
|
53701
|
+
type: external_exports.string(),
|
|
53702
|
+
status: external_exports.string(),
|
|
53703
|
+
description: external_exports.string().nullable(),
|
|
53704
|
+
milestone_id: external_exports.string().nullable(),
|
|
53705
|
+
parent_task_id: external_exports.string().nullable(),
|
|
53706
|
+
due_date: external_exports.string().nullable(),
|
|
53707
|
+
completed_at: external_exports.string().nullable(),
|
|
53708
|
+
file_url: external_exports.string().nullable(),
|
|
53709
|
+
checklist: external_exports.unknown(),
|
|
53710
|
+
resume_context: external_exports.unknown().nullable(),
|
|
53711
|
+
metadata: external_exports.unknown().nullable(),
|
|
53712
|
+
created_at: external_exports.string(),
|
|
53713
|
+
updated_at: external_exports.string()
|
|
53714
|
+
});
|
|
53715
|
+
var NoteRowSchema = external_exports.object({
|
|
53716
|
+
id: external_exports.string(),
|
|
53717
|
+
organization_id: external_exports.string(),
|
|
53718
|
+
project_id: external_exports.string(),
|
|
53719
|
+
content: external_exports.string(),
|
|
53720
|
+
type: external_exports.string(),
|
|
53721
|
+
summary: external_exports.string().nullable(),
|
|
53722
|
+
task_id: external_exports.string().nullable(),
|
|
53723
|
+
milestone_id: external_exports.string().nullable(),
|
|
53724
|
+
occurred_at: external_exports.string(),
|
|
53725
|
+
created_by: external_exports.string().nullable(),
|
|
53726
|
+
created_at: external_exports.string()
|
|
53727
|
+
});
|
|
53728
|
+
var ProjectWithCountsSchema = ProjectRowSchema.extend({
|
|
53729
|
+
milestoneCount: external_exports.number().int(),
|
|
53730
|
+
taskCount: external_exports.number().int(),
|
|
53731
|
+
completedMilestones: external_exports.number().int().optional(),
|
|
53732
|
+
completedTasks: external_exports.number().int().optional()
|
|
53733
|
+
});
|
|
53734
|
+
var ProjectCompanyRefSchema = external_exports.object({
|
|
53735
|
+
id: external_exports.string(),
|
|
53736
|
+
name: external_exports.string(),
|
|
53737
|
+
domain: external_exports.string().nullable()
|
|
53738
|
+
});
|
|
53739
|
+
var ProjectDetailSchema = ProjectRowSchema.extend({
|
|
53740
|
+
milestones: external_exports.array(MilestoneRowSchema),
|
|
53741
|
+
tasks: external_exports.array(TaskRowSchema),
|
|
53742
|
+
company: ProjectCompanyRefSchema.nullable(),
|
|
53743
|
+
deal: ProjectSourceDealRefSchema.nullable(),
|
|
53744
|
+
client: ProjectClientRefSchema.nullable()
|
|
53745
|
+
});
|
|
53746
|
+
var TaskResumeContextSchema = external_exports.object({
|
|
53747
|
+
id: external_exports.string(),
|
|
53748
|
+
project_id: external_exports.string(),
|
|
53749
|
+
resume_context: external_exports.unknown().nullable(),
|
|
53750
|
+
updated_at: external_exports.string()
|
|
53751
|
+
});
|
|
53752
|
+
var ProjectListResponseSchema = external_exports.object({ projects: external_exports.array(ProjectWithCountsSchema) });
|
|
53753
|
+
var ProjectDetailResponseSchema = external_exports.object({ project: ProjectDetailSchema });
|
|
53754
|
+
var ProjectResponseSchema = external_exports.object({ project: ProjectRowSchema });
|
|
53755
|
+
var MilestoneListResponseSchema = external_exports.object({ milestones: external_exports.array(MilestoneRowSchema) });
|
|
53756
|
+
var MilestoneResponseSchema = external_exports.object({ milestone: MilestoneRowSchema });
|
|
53757
|
+
var TaskListResponseSchema = external_exports.object({ tasks: external_exports.array(TaskRowSchema) });
|
|
53758
|
+
var TaskResponseSchema = external_exports.object({ task: TaskRowSchema });
|
|
53759
|
+
var TaskResumeContextResponseSchema = external_exports.object({ task: TaskResumeContextSchema });
|
|
53760
|
+
var NoteListResponseSchema = external_exports.object({ notes: external_exports.array(NoteRowSchema) });
|
|
53761
|
+
var NoteResponseSchema = external_exports.object({ note: NoteRowSchema });
|
|
53762
|
+
var DeleteSuccessResponseSchema = external_exports.object({ success: external_exports.boolean() });
|
|
53631
53763
|
|
|
53632
53764
|
// src/cli/commands/project/notes.ts
|
|
53633
53765
|
init_wrap_action();
|