@runtypelabs/sdk 11.4.1 → 11.5.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.cjs CHANGED
@@ -12714,6 +12714,69 @@ var QuestionSetsNamespace = class {
12714
12714
  }
12715
12715
  };
12716
12716
  //#endregion
12717
+ //#region src/signals-namespace.ts
12718
+ function pathId(id) {
12719
+ return encodeURIComponent(id);
12720
+ }
12721
+ /**
12722
+ * Trace signals: typed fields read out of every bound agent turn. Configure
12723
+ * sets and bindings here; results arrive as the `signals` block on runs and traces.
12724
+ */
12725
+ var SignalsNamespace = class {
12726
+ constructor(getClient) {
12727
+ this.getClient = getClient;
12728
+ }
12729
+ /** The organization's signal sets, newest first. */
12730
+ async listSets() {
12731
+ return this.getClient().get("/signal-sets");
12732
+ }
12733
+ /** The named starting points `createSet` accepts as `preset`. */
12734
+ async listPresets() {
12735
+ return this.getClient().get("/signal-sets/presets");
12736
+ }
12737
+ /** A set with every immutable version and its current one. */
12738
+ async getSet(id) {
12739
+ return this.getClient().get(`/signal-sets/${pathId(id)}`);
12740
+ }
12741
+ /**
12742
+ * Create a set from a preset or a definition; version 1 is current at once.
12743
+ *
12744
+ * @example
12745
+ * ```typescript
12746
+ * const { signalSet } = await Runtype.signals.createSet({ name: 'Health', preset: 'conversation_health' })
12747
+ * ```
12748
+ */
12749
+ async createSet(input) {
12750
+ return this.getClient().post("/signal-sets", input);
12751
+ }
12752
+ /** Rename or re-describe a set; signals change only through `publishVersion`. */
12753
+ async updateSet(id, input) {
12754
+ return this.getClient().patch(`/signal-sets/${pathId(id)}`, input);
12755
+ }
12756
+ /** Publish a new immutable version and make it current. Existing bindings keep theirs. */
12757
+ async publishVersion(id, definition) {
12758
+ return this.getClient().post(`/signal-sets/${pathId(id)}/versions`, { definition });
12759
+ }
12760
+ /** Dry-run a version over an agent's recent completed traces. Writes no results; model calls are billed. */
12761
+ async preview(id, versionNumber, input) {
12762
+ return this.getClient().post(`/signal-sets/${pathId(id)}/versions/${versionNumber}/preview`, input);
12763
+ }
12764
+ async listBindings(params = {}) {
12765
+ return this.getClient().get("/signal-bindings", params);
12766
+ }
12767
+ /** Bind a set version to an agent. Refusals carry a stable `code` such as `SIGNALS_LOGGING_OFF`. */
12768
+ async bind(input) {
12769
+ return this.getClient().post("/signal-bindings", input);
12770
+ }
12771
+ async unbind(bindingId) {
12772
+ return this.getClient().delete(`/signal-bindings/${pathId(bindingId)}`);
12773
+ }
12774
+ /** Hourly rollups summed over the window. Read `sample: 'uniform'` for live-traffic rates. */
12775
+ async stats(params = {}) {
12776
+ return this.getClient().get("/signals/stats", params);
12777
+ }
12778
+ };
12779
+ //#endregion
12717
12780
  //#region src/products-ensure.ts
12718
12781
  /**
12719
12782
  * `spec` with its stack as a save stores it: without the server-set fields (`detected`, `declared`,
@@ -14080,6 +14143,19 @@ var Runtype = class {
14080
14143
  return new QuestionSetsNamespace(() => this.getClient());
14081
14144
  }
14082
14145
  /**
14146
+ * Signals namespace - trace signal sets, bindings, preview and stats
14147
+ *
14148
+ * @example
14149
+ * ```typescript
14150
+ * const { signalSet } = await Runtype.signals.createSet({ name: 'Health', preset: 'conversation_health' })
14151
+ * await Runtype.signals.preview(signalSet.id, 1, { agentId })
14152
+ * await Runtype.signals.bind({ signalSetId: signalSet.id, target: { kind: 'agent', id: agentId } })
14153
+ * ```
14154
+ */
14155
+ static get signals() {
14156
+ return new SignalsNamespace(() => this.getClient());
14157
+ }
14158
+ /**
14083
14159
  * Products namespace - Product config-as-code (define / ensure / pull)
14084
14160
  *
14085
14161
  * Converges the top-level product record (description, icon, spec). Nested
@@ -14618,7 +14694,7 @@ function transformQueryParams(params) {
14618
14694
  }
14619
14695
  //#endregion
14620
14696
  //#region src/version.ts
14621
- const SDK_VERSION = "11.4.1";
14697
+ const SDK_VERSION = "11.5.0";
14622
14698
  /**
14623
14699
  * Canonical client identity the API uses for attribution
14624
14700
  * (`detectActorSource` in apps/api/src/lib/audit-log.ts keys `'sdk'` off the
@@ -14675,6 +14751,7 @@ var RuntypeClient = class {
14675
14751
  };
14676
14752
  if (config.apiKey) this.headers.Authorization = `Bearer ${config.apiKey}`;
14677
14753
  this.sandboxDeployments = new SandboxDeploymentsNamespace(() => this);
14754
+ this.signals = new SignalsNamespace(() => this);
14678
14755
  this.flows = new FlowsEndpoint(this);
14679
14756
  this.prompts = new PromptsEndpoint(this);
14680
14757
  this.records = new RecordsEndpoint(this);
@@ -16964,6 +17041,7 @@ exports.ScheduleDriftError = ScheduleDriftError;
16964
17041
  exports.ScheduleEnsureConflictError = ScheduleEnsureConflictError;
16965
17042
  exports.SchedulesEndpoint = SchedulesEndpoint;
16966
17043
  exports.SecretsEndpoint = SecretsEndpoint;
17044
+ exports.SignalsNamespace = SignalsNamespace;
16967
17045
  exports.SimulationsEndpoint = SimulationsEndpoint;
16968
17046
  exports.SkillDriftError = SkillDriftError;
16969
17047
  exports.SkillEnsureConflictError = SkillEnsureConflictError;