@runtypelabs/sdk 4.19.1 → 4.20.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/index.mjs CHANGED
@@ -4270,13 +4270,17 @@ function defineFpo(fpo) {
4270
4270
  return fpo;
4271
4271
  }
4272
4272
  async function ensureFpo(client, fpo, options = {}) {
4273
- const { dryRun, onConflict } = options;
4273
+ const { dryRun, onConflict, prune } = options;
4274
4274
  return client.post("/products/ensure-fpo", {
4275
4275
  fpo,
4276
4276
  ...dryRun ? { dryRun: true } : {},
4277
- ...onConflict ? { onConflict } : {}
4277
+ ...onConflict ? { onConflict } : {},
4278
+ ...prune ? { prune: true } : {}
4278
4279
  });
4279
4280
  }
4281
+ async function pullFpo(client, name) {
4282
+ return client.get("/products/pull-fpo", { name });
4283
+ }
4280
4284
 
4281
4285
  // src/products-namespace.ts
4282
4286
  var ProductsNamespace = class {
@@ -4334,6 +4338,24 @@ var ProductsNamespace = class {
4334
4338
  async ensureFpo(fpo, options = {}) {
4335
4339
  return ensureFpo(this.getClient(), fpo, options);
4336
4340
  }
4341
+ /**
4342
+ * Reconstruct a self-contained Full Product Object from the live product graph
4343
+ * (resolved by name) — the absorb-drift direction of `ensureFpo`. Feeding the
4344
+ * returned `fpo` back into `ensureFpo` converges to `unchanged`.
4345
+ *
4346
+ * records/schedules/secrets are not reconstructed and `tools` is emitted empty
4347
+ * (tool refs are portable `tool:<name>`); inspect `result.warnings` for
4348
+ * per-pull caveats.
4349
+ *
4350
+ * @example
4351
+ * ```typescript
4352
+ * const { fpo } = await Runtype.products.pullFpo('Support Copilot')
4353
+ * await Runtype.products.ensureFpo(fpo, { dryRun: true }) // → result: 'unchanged'
4354
+ * ```
4355
+ */
4356
+ async pullFpo(name) {
4357
+ return pullFpo(this.getClient(), name);
4358
+ }
4337
4359
  };
4338
4360
 
4339
4361
  // src/surfaces-ensure.ts
@@ -5070,6 +5092,12 @@ var Runtype = class {
5070
5092
  }
5071
5093
  };
5072
5094
 
5095
+ // src/version.ts
5096
+ var FALLBACK_VERSION = "0.0.0";
5097
+ var SDK_VERSION = "4.20.0".length > 0 ? "4.20.0" : FALLBACK_VERSION;
5098
+ var RUNTYPE_CLIENT_KIND = "sdk";
5099
+ var SDK_USER_AGENT = `runtype-sdk/${SDK_VERSION} (typescript)`;
5100
+
5073
5101
  // src/generated-tool-gate.ts
5074
5102
  var TOOL_NAME_PATTERN = /^[A-Za-z][A-Za-z0-9_]{1,63}$/;
5075
5103
  var DEFAULT_MAX_CODE_LENGTH = 12e3;
@@ -11456,6 +11484,14 @@ var RuntypeClient2 = class {
11456
11484
  this.timeout = config.timeout === void 0 ? 3e4 : config.timeout;
11457
11485
  this.headers = {
11458
11486
  "Content-Type": "application/json",
11487
+ // Advertise client identity + version so the API can attribute SDK traffic
11488
+ // (see detectActorSource in apps/api/src/lib/audit-log.ts). Defaults come
11489
+ // first so callers that wrap this client with their own attribution — the
11490
+ // CLI sends `X-Runtype-Client: cli` + `runtype-cli/<v>` — override them.
11491
+ // `User-Agent` is a forbidden header in browsers and is silently dropped
11492
+ // there; `X-Runtype-Client` is the reliable cross-environment signal.
11493
+ "X-Runtype-Client": RUNTYPE_CLIENT_KIND,
11494
+ "User-Agent": SDK_USER_AGENT,
11459
11495
  ...config.headers || {}
11460
11496
  };
11461
11497
  if (config.apiKey) {
@@ -11537,7 +11573,8 @@ var RuntypeClient2 = class {
11537
11573
  description: entry.description,
11538
11574
  parametersSchema: entry.parametersSchema,
11539
11575
  ...entry.origin ? { origin: entry.origin } : {},
11540
- ...entry.pageOrigin ? { pageOrigin: entry.pageOrigin } : {}
11576
+ ...entry.pageOrigin ? { pageOrigin: entry.pageOrigin } : {},
11577
+ ...entry.untrustedContentHint ? { untrustedContentHint: true } : {}
11541
11578
  })) : [];
11542
11579
  const modifiedRequest = {
11543
11580
  ...request6,
@@ -12724,11 +12761,14 @@ export {
12724
12761
  PromptsEndpoint,
12725
12762
  PromptsNamespace,
12726
12763
  ProviderKeysEndpoint,
12764
+ RUNTYPE_CLIENT_KIND,
12727
12765
  RecordsEndpoint,
12728
12766
  Runtype,
12729
12767
  RuntypeApiError,
12730
12768
  RuntypeClient2 as RuntypeClient,
12731
12769
  RuntypeFlowBuilder,
12770
+ SDK_USER_AGENT,
12771
+ SDK_VERSION,
12732
12772
  STEP_FIELD_REGISTRY,
12733
12773
  STEP_TYPE_TO_METHOD,
12734
12774
  SchedulesEndpoint,
@@ -12800,6 +12840,7 @@ export {
12800
12840
  parseOffloadedOutputId,
12801
12841
  parseSSEChunk,
12802
12842
  processStream,
12843
+ pullFpo,
12803
12844
  registerWorkflowHook,
12804
12845
  resolveStallStopAfter,
12805
12846
  resolveWorkflowHook,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runtypelabs/sdk",
3
- "version": "4.19.1",
3
+ "version": "4.20.0",
4
4
  "type": "module",
5
5
  "description": "TypeScript SDK for the Runtype API with fluent methods. Use it to quickly realize AI products, agents, and workflows.",
6
6
  "main": "dist/index.cjs",