@adcp/sdk 9.4.0 → 9.6.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.
Files changed (69) hide show
  1. package/dist/lib/core/AgentClient.d.ts +2 -2
  2. package/dist/lib/core/AgentClient.d.ts.map +1 -1
  3. package/dist/lib/core/AgentClient.js +4 -4
  4. package/dist/lib/core/AgentClient.js.map +1 -1
  5. package/dist/lib/core/AsyncHandler.d.ts +6 -0
  6. package/dist/lib/core/AsyncHandler.d.ts.map +1 -1
  7. package/dist/lib/core/AsyncHandler.js.map +1 -1
  8. package/dist/lib/core/ConversationTypes.d.ts +21 -0
  9. package/dist/lib/core/ConversationTypes.d.ts.map +1 -1
  10. package/dist/lib/core/SingleAgentClient.d.ts +40 -5
  11. package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
  12. package/dist/lib/core/SingleAgentClient.js +201 -52
  13. package/dist/lib/core/SingleAgentClient.js.map +1 -1
  14. package/dist/lib/core/TaskExecutor.d.ts +1 -1
  15. package/dist/lib/core/TaskExecutor.d.ts.map +1 -1
  16. package/dist/lib/core/TaskExecutor.js +15 -4
  17. package/dist/lib/core/TaskExecutor.js.map +1 -1
  18. package/dist/lib/index.d.ts +2 -2
  19. package/dist/lib/index.d.ts.map +1 -1
  20. package/dist/lib/index.js +3 -2
  21. package/dist/lib/index.js.map +1 -1
  22. package/dist/lib/protocols/a2a.d.ts +1 -1
  23. package/dist/lib/protocols/a2a.d.ts.map +1 -1
  24. package/dist/lib/protocols/a2a.js +66 -35
  25. package/dist/lib/protocols/a2a.js.map +1 -1
  26. package/dist/lib/protocols/abort.d.ts +10 -0
  27. package/dist/lib/protocols/abort.d.ts.map +1 -0
  28. package/dist/lib/protocols/abort.js +107 -0
  29. package/dist/lib/protocols/abort.js.map +1 -0
  30. package/dist/lib/protocols/index.d.ts +10 -0
  31. package/dist/lib/protocols/index.d.ts.map +1 -1
  32. package/dist/lib/protocols/index.js +33 -9
  33. package/dist/lib/protocols/index.js.map +1 -1
  34. package/dist/lib/protocols/mcp-tasks.d.ts +4 -0
  35. package/dist/lib/protocols/mcp-tasks.d.ts.map +1 -1
  36. package/dist/lib/protocols/mcp-tasks.js +27 -11
  37. package/dist/lib/protocols/mcp-tasks.js.map +1 -1
  38. package/dist/lib/protocols/mcp.d.ts +14 -2
  39. package/dist/lib/protocols/mcp.d.ts.map +1 -1
  40. package/dist/lib/protocols/mcp.js +116 -43
  41. package/dist/lib/protocols/mcp.js.map +1 -1
  42. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  43. package/dist/lib/server/create-adcp-server.d.ts.map +1 -1
  44. package/dist/lib/server/create-adcp-server.js +3 -1
  45. package/dist/lib/server/create-adcp-server.js.map +1 -1
  46. package/dist/lib/signing/capability-priming.d.ts.map +1 -1
  47. package/dist/lib/signing/capability-priming.js +5 -1
  48. package/dist/lib/signing/capability-priming.js.map +1 -1
  49. package/dist/lib/substitution/index.d.ts +2 -0
  50. package/dist/lib/substitution/index.d.ts.map +1 -1
  51. package/dist/lib/substitution/index.js +3 -1
  52. package/dist/lib/substitution/index.js.map +1 -1
  53. package/dist/lib/substitution/observer/html-parser.d.ts.map +1 -1
  54. package/dist/lib/substitution/observer/html-parser.js +27 -9
  55. package/dist/lib/substitution/observer/html-parser.js.map +1 -1
  56. package/dist/lib/substitution/translate.d.ts +89 -0
  57. package/dist/lib/substitution/translate.d.ts.map +1 -0
  58. package/dist/lib/substitution/translate.js +144 -0
  59. package/dist/lib/substitution/translate.js.map +1 -0
  60. package/dist/lib/testing/client.js +3 -3
  61. package/dist/lib/testing/client.js.map +1 -1
  62. package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
  63. package/dist/lib/testing/storyboard/runner.js +36 -9
  64. package/dist/lib/testing/storyboard/runner.js.map +1 -1
  65. package/dist/lib/testing/types.d.ts +2 -0
  66. package/dist/lib/testing/types.d.ts.map +1 -1
  67. package/dist/lib/version.d.ts +3 -3
  68. package/dist/lib/version.js +3 -3
  69. package/package.json +1 -1
@@ -1920,6 +1920,10 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
1920
1920
  // default `depends_on` resolution ("all prior phases") doesn't re-scan
1921
1921
  // the storyboard. Phases push their own id at end-of-phase.
1922
1922
  const priorPhaseIds = [];
1923
+ // Phase → branch-set membership, resolved once up front so the stateful
1924
+ // cascade (and the post-loop branch-set re-grade) can consult it. Phases
1925
+ // outside any branch set are absent from the map.
1926
+ const branchSetsByPhaseId = resolveBranchSets(storyboard);
1923
1927
  // Helpers for per-phase cascade state.
1924
1928
  const effectiveDependsOn = (phase, prior) => phase.depends_on ?? prior;
1925
1929
  const cascadeForPhase = (phase, prior) => {
@@ -1928,7 +1932,26 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
1928
1932
  if (phaseStatefulCascades.has(phase.id)) {
1929
1933
  return { tripped: true, trigger: phaseStatefulCascades.get(phase.id) ?? null };
1930
1934
  }
1935
+ // Branch-set peers under `any_of` are mutually-exclusive ALTERNATIVES, not
1936
+ // a stateful dependency chain: a conformant seller satisfies exactly one
1937
+ // peer, so the non-taken peer(s) fail by design (storyboard-schema.yaml,
1938
+ // "Per-step grading in any_of branch patterns"). A peer's expected
1939
+ // failure must NOT cascade-skip a sibling peer — doing so suppresses the
1940
+ // only viable contribution and fails the any_of gate even though the
1941
+ // seller behaved conformantly. Exclude same-branch-set peers from this
1942
+ // phase's cascade dependencies. (adcontextprotocol/adcp-client#2305)
1943
+ //
1944
+ // Scoped to `any_of` deliberately: `BranchSetSpec.semantics` is typed
1945
+ // `string` to leave room for future semantics (e.g. `all_of`/`one_of`)
1946
+ // where peers legitimately DO depend on each other and must keep
1947
+ // cascading. `all_of` is rejected at load time today, so this is
1948
+ // forward-compat hardening rather than live behavior.
1949
+ const ownSpec = branchSetsByPhaseId.get(phase.id);
1950
+ const ownAnyOfBranchSet = ownSpec?.semantics === 'any_of' ? ownSpec.id : undefined;
1931
1951
  for (const depId of effectiveDependsOn(phase, prior)) {
1952
+ if (ownAnyOfBranchSet !== undefined && branchSetsByPhaseId.get(depId)?.id === ownAnyOfBranchSet) {
1953
+ continue;
1954
+ }
1932
1955
  if (phaseStatefulCascades.has(depId)) {
1933
1956
  return { tripped: true, trigger: phaseStatefulCascades.get(depId) ?? null };
1934
1957
  }
@@ -2775,8 +2798,9 @@ async function executeStoryboardPass(agentUrls, storyboard, options, dispatchOff
2775
2798
  // contribution status isn't knowable inside the per-phase loop. Runs
2776
2799
  // before storyboard-scoped assertions so `onEnd` hooks see the finalized
2777
2800
  // per-step grades (a moot peer's "failure" should not trip a cross-step
2778
- // invariant).
2779
- const branchSetsByPhaseId = resolveBranchSets(storyboard);
2801
+ // invariant). `branchSetsByPhaseId` was resolved before the phase loop so
2802
+ // the stateful cascade could consult it (branch-set peers don't cascade
2803
+ // onto each other); reuse it here.
2780
2804
  const branchSetDelta = applyBranchSetGrading(storyboard.phases, phaseResults, branchSetsByPhaseId, contributions, contributionSources, countedAsFailed);
2781
2805
  skippedCount += branchSetDelta.skippedDelta;
2782
2806
  // Fire storyboard-scoped assertions. These observe the full run and can
@@ -3303,12 +3327,14 @@ client, step, storyboardId, phaseId, context, allSteps, options, state) {
3303
3327
  extraction: { path: 'none' },
3304
3328
  };
3305
3329
  }
3306
- // Account-mode capability gate: sync_accounts is exclusive to implicit mode
3307
- // (require_operator_auth: false). When the seller declared explicit mode
3308
- // (require_operator_auth: true), sync_accounts does not apply — grade
3309
- // not_applicable rather than missing_tool so adopters can distinguish
3310
- // "your capability declaration says this path isn't yours" from "you forgot
3311
- // to implement a required tool."
3330
+ // Account-mode capability gate: when the seller declared explicit mode
3331
+ // (require_operator_auth: true) and does not advertise sync_accounts,
3332
+ // sync_accounts does not apply — grade not_applicable rather than
3333
+ // missing_tool so adopters can distinguish "your capability declaration
3334
+ // says this path isn't yours" from "you forgot to implement a required
3335
+ // tool." If the seller explicitly advertises sync_accounts, run it: account
3336
+ // discovery mode and account-level write surfaces such as notification
3337
+ // config registration are orthogonal.
3312
3338
  //
3313
3339
  // list_accounts is NOT gated here: it appears in audience_sync and other
3314
3340
  // storyboard flows regardless of account mode, so it is always applicable.
@@ -3319,7 +3345,8 @@ client, step, storyboardId, phaseId, context, allSteps, options, state) {
3319
3345
  const rawCaps = options._profile?.raw_capabilities;
3320
3346
  if (rawCaps !== undefined) {
3321
3347
  const requireOperatorAuth = resolveCapabilityPath(rawCaps, 'account.require_operator_auth');
3322
- if (requireOperatorAuth === true) {
3348
+ const syncAccountsAdvertised = options.agentTools?.includes('sync_accounts') === true;
3349
+ if (requireOperatorAuth === true && !syncAccountsAdvertised) {
3323
3350
  const detail = `Agent declared explicit account mode (require_operator_auth: true); ` +
3324
3351
  `sync_accounts is not applicable — list_accounts is the correct tool for this account shape.`;
3325
3352
  const next = getNextStepPreview(step.id, allSteps, context, runState.runnerVars);