@statelyai/agent 2.0.0-alpha.35 → 2.0.0-alpha.36
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/CHANGELOG.md +111 -0
- package/dist/act-B9hLQls6.mjs +19 -0
- package/dist/act-CrX0JwWY.cjs +42 -0
- package/dist/ai-sdk.cjs +63 -7
- package/dist/ai-sdk.d.cts +13 -3
- package/dist/ai-sdk.d.mts +13 -3
- package/dist/ai-sdk.mjs +63 -7
- package/dist/{decision-BEsATcr1.cjs → decision-CMeuNZ1g.cjs} +262 -4
- package/dist/{decision-COkJNjOW.mjs → decision-m5hGmHpF.mjs} +239 -5
- package/dist/decision-object-B5zGSPFp.d.mts +15 -0
- package/dist/decision-object-DBcLWVvv.d.cts +15 -0
- package/dist/{run-agent-s5D32w99.cjs → effects-B23bFZEs.cjs} +948 -102
- package/dist/{run-agent-Ct_GZw_f.mjs → effects-CuOUNYtZ.mjs} +914 -104
- package/dist/{event-log-C7jeH0y8.mjs → event-log-DkVlk3Rh.mjs} +30 -15
- package/dist/{event-log-BWSSLUff.cjs → event-log-Dkc-yIYu.cjs} +41 -14
- package/dist/{event-log-store-BzXehP7R.d.cts → event-log-store-BBS8so8a.d.mts} +2 -2
- package/dist/{event-log-store-W49TCJXi.mjs → event-log-store-Brx9tOHt.mjs} +1 -1
- package/dist/{event-log-store-CleWpsp5.cjs → event-log-store-Cl-YWDnq.cjs} +1 -1
- package/dist/{event-log-store-CWjN6lmM.d.mts → event-log-store-bc4ICGcS.d.cts} +2 -2
- package/dist/index.cjs +660 -286
- package/dist/index.d.cts +168 -9
- package/dist/index.d.mts +168 -9
- package/dist/index.mjs +639 -271
- package/dist/internal-C3Lqu538.d.cts +43 -0
- package/dist/internal-DUcdhk-i.d.mts +43 -0
- package/dist/log.cjs +2 -2
- package/dist/log.d.cts +1 -1
- package/dist/log.d.mts +1 -1
- package/dist/log.mjs +2 -2
- package/dist/machines.cjs +457 -41
- package/dist/machines.d.cts +114 -43
- package/dist/machines.d.mts +114 -43
- package/dist/machines.mjs +457 -42
- package/dist/{model-source-DmhTMK39.cjs → model-source-B4WQ8Idp.cjs} +1 -1
- package/dist/{model-source-CK3F4YuU.mjs → model-source-kjGwqAV8.mjs} +1 -1
- package/dist/openai.cjs +149 -36
- package/dist/openai.d.cts +28 -10
- package/dist/openai.d.mts +28 -10
- package/dist/openai.mjs +149 -36
- package/dist/otel.d.cts +1 -1
- package/dist/otel.d.mts +1 -1
- package/dist/{run-agent-BGdx5913.d.mts → run-agent-BcQ-9NRT.d.cts} +91 -9
- package/dist/{run-agent-B1-Eqviq.d.cts → run-agent-C86drZtN.d.mts} +91 -9
- package/dist/{setup-agent-05uw4dPZ.mjs → setup-agent-BDmNr6PC.mjs} +9 -3
- package/dist/{setup-agent-BtfeFfF6.d.cts → setup-agent-BIKcbVXV.d.mts} +4 -4
- package/dist/{setup-agent-CXEBURdo.cjs → setup-agent-CmEToB8y.cjs} +9 -3
- package/dist/{setup-agent-C6nqzv_X.d.mts → setup-agent-jlo4vtaZ.d.cts} +4 -4
- package/dist/tanstack-ai.cjs +62 -4
- package/dist/tanstack-ai.d.cts +18 -6
- package/dist/tanstack-ai.d.mts +18 -6
- package/dist/tanstack-ai.mjs +62 -4
- package/dist/testing.cjs +399 -20
- package/dist/testing.d.cts +196 -255
- package/dist/testing.d.mts +196 -255
- package/dist/testing.mjs +395 -20
- package/dist/{text-logic-CV_4KGr6.d.cts → text-logic-BqxalgMr.d.mts} +87 -4
- package/dist/{text-logic-Ckh-rJFV.d.mts → text-logic-CSf9bqpP.d.cts} +87 -4
- package/dist/{types-Dp5_Ru4R.d.cts → types-DQUOOaZO.d.cts} +1 -1
- package/dist/{types-Dp5_Ru4R.d.mts → types-DQUOOaZO.d.mts} +1 -1
- package/dist/{usage-BDiJKyv9.d.cts → usage-DoP0Oi84.d.mts} +1 -1
- package/dist/{usage-DOoVUGVq.d.mts → usage-HtnrUsl9.d.cts} +1 -1
- package/dist/utils-7lSa4H-i.d.cts +403 -0
- package/dist/utils-CBbKw2fM.d.mts +403 -0
- package/dist/validate.cjs +44 -12
- package/dist/validate.d.cts +6 -6
- package/dist/validate.d.mts +6 -6
- package/dist/validate.mjs +44 -12
- package/dist/verify-Bink-Drw.cjs +2304 -0
- package/dist/{verify-BQpE8hUz.d.cts → verify-Buh8XSUr.d.mts} +208 -14
- package/dist/{verify-CqeuEmIk.d.mts → verify-CciG8UP-.d.cts} +208 -14
- package/dist/verify-Dpz1u5Pe.mjs +2251 -0
- package/dist/with-model-calls-B_WLmOSl.cjs +248 -0
- package/dist/with-model-calls-BkOwdroS.mjs +213 -0
- package/docs/act.md +102 -0
- package/docs/advanced.md +105 -0
- package/docs/any-stack.md +62 -0
- package/docs/choosing-a-run-mode.md +55 -0
- package/docs/debugging.md +29 -0
- package/docs/decisions.md +473 -0
- package/docs/environment-and-policy.md +188 -0
- package/docs/evals.md +509 -0
- package/docs/event-log.md +311 -0
- package/docs/from-a-loop.md +528 -0
- package/docs/generate-machines.md +110 -0
- package/docs/hosts.md +414 -0
- package/docs/human-in-the-loop.md +177 -0
- package/docs/index.md +48 -0
- package/docs/judgments.md +281 -0
- package/docs/langgraph-comparison.md +198 -0
- package/docs/machines-as-data.md +454 -0
- package/docs/machines-presets.md +198 -0
- package/docs/machines.md +497 -0
- package/docs/messages.md +67 -0
- package/docs/meta.json +52 -0
- package/docs/models-and-providers.md +268 -0
- package/docs/multi-agent.md +68 -0
- package/docs/observability.md +109 -0
- package/docs/patterns.md +31 -0
- package/docs/persistence.md +136 -0
- package/docs/quickstart.md +121 -0
- package/docs/roadmap.md +22 -0
- package/docs/scope.md +75 -0
- package/docs/statechart-policy-examples.md +69 -0
- package/docs/steps.md +54 -0
- package/docs/strangler-fig.md +323 -0
- package/docs/text-requests.md +250 -0
- package/docs/thinking-in-state-machines.md +324 -0
- package/docs/tools.md +249 -0
- package/docs/upgrading.md +37 -0
- package/docs/usage-and-budgets.md +516 -0
- package/docs/validate-and-repair.md +253 -0
- package/docs/verify.md +487 -0
- package/docs/xstate-4-and-5-apps.md +161 -0
- package/llms.txt +53 -0
- package/package.json +10 -3
- package/readme.md +30 -15
- package/skills/add-evals/SKILL.md +3 -1
- package/skills/add-traces/SKILL.md +6 -1
- package/skills/build-machine/SKILL.md +81 -0
- package/skills/generate-machine/SKILL.md +1 -1
- package/skills/graph-engineering/SKILL.md +13 -3
- package/skills/improve-machine/SKILL.md +21 -2
- package/skills/loop-to-machine/SKILL.md +147 -192
- package/skills/loop-to-machine/reference.md +260 -0
- package/dist/utils-BnXdWih3.d.mts +0 -108
- package/dist/utils-ebVpCYoF.d.cts +0 -108
- package/dist/verify-Bpahmr34.mjs +0 -1241
- package/dist/verify-DCLZa9R0.cjs +0 -1288
- package/dist/with-model-calls-BXYdBdcu.cjs +0 -45
- package/dist/with-model-calls-Bv4V4EHC.mjs +0 -34
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
//#region src/internal/rejected-answer.ts
|
|
2
|
-
/**
|
|
3
|
-
* The rejection for a decision answer that names no candidate event: no tool
|
|
4
|
-
* call, a call to a tool that was not offered, or arguments that are not JSON.
|
|
5
|
-
* `resolveDecision` records it as a failed attempt and asks again. @internal
|
|
6
|
-
*/
|
|
7
|
-
function rejectedAnswer(toolCall, toolNames) {
|
|
8
|
-
const valid = toolNames.join(", ") || "none";
|
|
9
|
-
if (!toolCall) return {
|
|
10
|
-
failure: "unknown-event",
|
|
11
|
-
reason: `no tool was called; call exactly one of: ${valid}`
|
|
12
|
-
};
|
|
13
|
-
if (toolCall.invalidJson) return {
|
|
14
|
-
failure: "invalid-payload",
|
|
15
|
-
reason: `the arguments for tool '${toolCall.toolName}' were not valid JSON`
|
|
16
|
-
};
|
|
17
|
-
return {
|
|
18
|
-
failure: "unknown-event",
|
|
19
|
-
reason: `tool '${toolCall.toolName}' was not offered; valid tools: ${valid}`
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/internal/with-model-calls.ts
|
|
24
|
-
/**
|
|
25
|
-
* Records on a thrown error how many provider calls its request made, so the
|
|
26
|
-
* runtime counts a failed tool loop's steps too (see `getCallModelCalls`).
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
function withModelCalls(error, modelCalls) {
|
|
30
|
-
if (modelCalls > 1 && typeof error === "object" && error !== null && Object.isExtensible(error)) error.modelCalls ??= modelCalls;
|
|
31
|
-
return error;
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
Object.defineProperty(exports, "rejectedAnswer", {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
get: function() {
|
|
37
|
-
return rejectedAnswer;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
Object.defineProperty(exports, "withModelCalls", {
|
|
41
|
-
enumerable: true,
|
|
42
|
-
get: function() {
|
|
43
|
-
return withModelCalls;
|
|
44
|
-
}
|
|
45
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
//#region src/internal/rejected-answer.ts
|
|
2
|
-
/**
|
|
3
|
-
* The rejection for a decision answer that names no candidate event: no tool
|
|
4
|
-
* call, a call to a tool that was not offered, or arguments that are not JSON.
|
|
5
|
-
* `resolveDecision` records it as a failed attempt and asks again. @internal
|
|
6
|
-
*/
|
|
7
|
-
function rejectedAnswer(toolCall, toolNames) {
|
|
8
|
-
const valid = toolNames.join(", ") || "none";
|
|
9
|
-
if (!toolCall) return {
|
|
10
|
-
failure: "unknown-event",
|
|
11
|
-
reason: `no tool was called; call exactly one of: ${valid}`
|
|
12
|
-
};
|
|
13
|
-
if (toolCall.invalidJson) return {
|
|
14
|
-
failure: "invalid-payload",
|
|
15
|
-
reason: `the arguments for tool '${toolCall.toolName}' were not valid JSON`
|
|
16
|
-
};
|
|
17
|
-
return {
|
|
18
|
-
failure: "unknown-event",
|
|
19
|
-
reason: `tool '${toolCall.toolName}' was not offered; valid tools: ${valid}`
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/internal/with-model-calls.ts
|
|
24
|
-
/**
|
|
25
|
-
* Records on a thrown error how many provider calls its request made, so the
|
|
26
|
-
* runtime counts a failed tool loop's steps too (see `getCallModelCalls`).
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
function withModelCalls(error, modelCalls) {
|
|
30
|
-
if (modelCalls > 1 && typeof error === "object" && error !== null && Object.isExtensible(error)) error.modelCalls ??= modelCalls;
|
|
31
|
-
return error;
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
export { rejectedAnswer as n, withModelCalls as t };
|