xytara 1.11.0 → 1.12.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/README.md CHANGED
@@ -138,6 +138,8 @@ The current `1.10.0` line starts building on that by exposing reusable continuat
138
138
  - continuation preparation summary surfaces that expose the stable prepared-artifact view directly
139
139
  - continuation summaries that make the default transaction-to-proof bridge explicit instead of inferred
140
140
  - prepared continuation artifacts that classify the preserved execution, economic, and proof-facing context that survives into proof-native follow-through
141
+ - extension-seam summaries that distinguish stable carry from future adapter-ready boundary points on that durable path
142
+ - extension-template surfaces that turn the durable transaction-side artifact into a reusable proof-side extension-review request
141
143
 
142
144
  This is intended to make the public stack easier to compose after grouped execution, not just easier to inspect.
143
145
 
package/index.js CHANGED
@@ -40,7 +40,7 @@ const {
40
40
  } = require("./integrations/registry");
41
41
 
42
42
  const COMMERCE_SDK_NAME = "xytara";
43
- const COMMERCE_SDK_VERSION = "1.11.0";
43
+ const COMMERCE_SDK_VERSION = "1.12.0";
44
44
  const COMMERCE_API_VERSION = "v1";
45
45
 
46
46
  function createClient(options) {
@@ -1169,11 +1169,18 @@ function summarizeInteractionResultPackageContinuationPreparationPayload(payload
1169
1169
  const artifact = item.prepared_artifact_summary && typeof item.prepared_artifact_summary === "object"
1170
1170
  ? item.prepared_artifact_summary
1171
1171
  : {};
1172
+ const extension = item.extension_seam_summary && typeof item.extension_seam_summary === "object"
1173
+ ? item.extension_seam_summary
1174
+ : {};
1175
+ const extensionTemplate = item.extension_template && typeof item.extension_template === "object"
1176
+ ? item.extension_template
1177
+ : {};
1172
1178
  return {
1173
1179
  ok: item.ok === true,
1174
1180
  continuation_ref: continuation ? continuation.continuation_ref : null,
1175
1181
  result_package_ref: continuation ? continuation.result_package_ref : null,
1176
1182
  prepared_artifact_ref: artifact.prepared_artifact_ref || null,
1183
+ extension_seam_ref: extension.extension_seam_ref || null,
1177
1184
  target_surface: template.target_surface || null,
1178
1185
  review_surface: template.review_surface || null,
1179
1186
  continuation_ready: continuation ? continuation.continuation_ready === true : false,
@@ -1185,7 +1192,9 @@ function summarizeInteractionResultPackageContinuationPreparationPayload(payload
1185
1192
  artifact.preserved_context.proof_handoff &&
1186
1193
  artifact.preserved_context.proof_handoff.seam_layer_count || 0
1187
1194
  ),
1188
- proof_ready: artifact.durable_path && artifact.durable_path.proof_ready === true
1195
+ proof_ready: artifact.durable_path && artifact.durable_path.proof_ready === true,
1196
+ future_adapter_hook_count: Number(extension.future_adapter_hook_count || 0),
1197
+ extension_target_surface: extensionTemplate.target_surface || null
1189
1198
  };
1190
1199
  }
1191
1200
 
@@ -4321,6 +4330,22 @@ class CommerceClient {
4321
4330
  });
4322
4331
  }
4323
4332
 
4333
+ async prepareInteractionResultPackageExtensionTemplate(continuationRef, body, options) {
4334
+ const opts = options || {};
4335
+ return this.runNamedTaskRoute("/v1/transaction-center/result-package-continuations/prepare/extension-template", {
4336
+ command: opts.command || String(continuationRef || "").trim() || "result.package.continuation.extension.template",
4337
+ continuation_ref: String(continuationRef || "").trim(),
4338
+ body: body || {},
4339
+ callback_url: opts.callbackUrl || null,
4340
+ settlement_mode: opts.settlementMode || null,
4341
+ payment_protocol: opts.paymentProtocol || null,
4342
+ protocol: opts.protocol || null,
4343
+ integration_id: opts.integrationId || null,
4344
+ integration_ids: Array.isArray(opts.integrationIds) ? opts.integrationIds : [],
4345
+ integration_context: opts.integrationContext || null
4346
+ });
4347
+ }
4348
+
4324
4349
  async runNamedTaskRoute(path, payload) {
4325
4350
  if (!this.apiKey || !this.walletId || !this.walletSecret) {
4326
4351
  throw new Error("named task routes require apiKey, walletId, and walletSecret");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xytara",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "Machine commerce SDK for discovery, quoting, execution, lifecycle inspection, and adapters.",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
package/server.js CHANGED
@@ -1167,6 +1167,58 @@ function buildPreparedContinuationArtifactCompactSummary(portableHandoff, contin
1167
1167
  };
1168
1168
  }
1169
1169
 
1170
+ function buildPreparedContinuationExtensionSeamSummary(portableHandoff, continuation) {
1171
+ const handoff = portableHandoff && typeof portableHandoff === "object" ? portableHandoff : {};
1172
+ const seamLayers = Array.isArray(handoff.seam_layers) ? handoff.seam_layers : [];
1173
+ return {
1174
+ ok: true,
1175
+ extension_seam_ref: continuation && continuation.continuation_ref
1176
+ ? `extension.${continuation.continuation_ref}`
1177
+ : null,
1178
+ continuation_ref: continuation && continuation.continuation_ref ? continuation.continuation_ref : null,
1179
+ stable_carry: {
1180
+ execution_context: {
1181
+ committed_ref: handoff.committed_ref || null,
1182
+ task_refs: Array.isArray(handoff.task_refs) ? handoff.task_refs : []
1183
+ },
1184
+ economic_context: {
1185
+ payment_protocol: handoff.payment_protocol || null,
1186
+ settlement_mode: handoff.settlement_mode || null,
1187
+ treasury_destination_id: handoff.treasury_destination_id || null
1188
+ },
1189
+ proof_context: {
1190
+ source_ref: handoff.source_ref || null,
1191
+ seam_layers: seamLayers
1192
+ }
1193
+ },
1194
+ extension_ready_boundaries: [
1195
+ "prepared_artifact",
1196
+ "proof_review",
1197
+ "proof_run"
1198
+ ],
1199
+ default_followthrough_kind: "prepared_to_review_to_run",
1200
+ future_adapter_hook_count: 3
1201
+ };
1202
+ }
1203
+
1204
+ function buildPreparedContinuationExtensionTemplate(portableHandoff, continuation) {
1205
+ const handoff = portableHandoff && typeof portableHandoff === "object" ? portableHandoff : {};
1206
+ const summary = buildPreparedContinuationExtensionSeamSummary(portableHandoff, continuation);
1207
+ return {
1208
+ ok: true,
1209
+ extension_seam_ref: summary.extension_seam_ref || null,
1210
+ target_surface: "/v1/proof-center/result-package-handoff/review/extension-readiness",
1211
+ request_template: {
1212
+ handoff_bundle: handoff
1213
+ },
1214
+ stable_boundary_ids: [
1215
+ "prepared_artifact",
1216
+ "review_extension_readiness",
1217
+ "proof_run"
1218
+ ]
1219
+ };
1220
+ }
1221
+
1170
1222
  function buildInteractionResultPackageContinuationRequestTemplate(portableHandoff, continuation) {
1171
1223
  const handoff = portableHandoff && typeof portableHandoff === "object" ? portableHandoff : {};
1172
1224
  return {
@@ -2122,6 +2174,8 @@ async function routeRequest(req, res) {
2122
2174
  portable_handoff_summary: summarizeInteractionResultPackagePortableHandoff(portableHandoff),
2123
2175
  continuation_summary: buildInteractionResultPackageContinuationSummary(portableHandoff, continuation),
2124
2176
  prepared_artifact_summary: buildPreparedContinuationArtifactSummary(portableHandoff, continuation),
2177
+ extension_seam_summary: buildPreparedContinuationExtensionSeamSummary(portableHandoff, continuation),
2178
+ extension_template: buildPreparedContinuationExtensionTemplate(portableHandoff, continuation),
2125
2179
  proof_request_template: buildInteractionResultPackageContinuationRequestTemplate(portableHandoff, continuation)
2126
2180
  });
2127
2181
  return;
@@ -2154,7 +2208,42 @@ async function routeRequest(req, res) {
2154
2208
  return;
2155
2209
  }
2156
2210
  const portableHandoff = buildInteractionResultPackagePortableHandoff(result.payload, resultPackage);
2157
- sendJson(res, 200, buildPreparedContinuationArtifactCompactSummary(portableHandoff, continuation));
2211
+ sendJson(res, 200, {
2212
+ ...buildPreparedContinuationArtifactCompactSummary(portableHandoff, continuation),
2213
+ extension_seam_summary: buildPreparedContinuationExtensionSeamSummary(portableHandoff, continuation),
2214
+ extension_template: buildPreparedContinuationExtensionTemplate(portableHandoff, continuation)
2215
+ });
2216
+ return;
2217
+ }
2218
+
2219
+ if (req.method === "POST" && url.pathname === "/v1/transaction-center/result-package-continuations/prepare/extension-template") {
2220
+ const body = await readJsonBody(req);
2221
+ const continuationRef = String(body && body.continuation_ref || "").trim();
2222
+ const continuation = getInteractionResultPackageContinuation(continuationRef);
2223
+ if (!continuation) {
2224
+ sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
2225
+ return;
2226
+ }
2227
+ const resultPackage = getInteractionResultPackage(continuation.result_package_ref);
2228
+ if (!resultPackage) {
2229
+ sendJson(res, 404, { ok: false, error: "result_package_not_found" });
2230
+ return;
2231
+ }
2232
+ const payload = buildInteractionSpinePathRunPayload({
2233
+ ...(body && typeof body === "object" && !Array.isArray(body) ? body : {}),
2234
+ spine_path_ref: resultPackage.source_ref
2235
+ });
2236
+ if (!payload) {
2237
+ sendJson(res, 404, { ok: false, error: "result_package_continuation_not_found" });
2238
+ return;
2239
+ }
2240
+ const result = executeCommandRequest(state, payload, req.headers);
2241
+ if (result.status !== 200) {
2242
+ sendJson(res, result.status, result.payload);
2243
+ return;
2244
+ }
2245
+ const portableHandoff = buildInteractionResultPackagePortableHandoff(result.payload, resultPackage);
2246
+ sendJson(res, 200, buildPreparedContinuationExtensionTemplate(portableHandoff, continuation));
2158
2247
  return;
2159
2248
  }
2160
2249