@skrr-ai/signals 0.1.2 → 0.1.4

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
@@ -4,7 +4,7 @@ CloudEvents-native public contracts and a small, transport-only publisher for
4
4
  the OverSky Signal Plane.
5
5
 
6
6
  This package submits immutable facts to `POST /v1/signals`. It does **not**
7
- create a Commitment, select a Monitor, wake an Agent, or grant any execution
7
+ create a Duty, select a Monitor, wake an Agent, or grant any execution
8
8
  authority. Those are server-owned control-plane decisions.
9
9
 
10
10
  ```ts
@@ -37,5 +37,5 @@ CloudEvents (`application/cloudevents+json`) and keeps the CloudEvents `id`
37
37
  stable across retries.
38
38
 
39
39
  The Signal Source credential determines the tenant and allowed source. Never
40
- put workspace, Commitment, Agent, authorization, request bodies, cookies,
40
+ put workspace, Duty, Agent, authorization, request bodies, cookies,
41
41
  access tokens, or arbitrary stack traces in an event payload.
@@ -24,5 +24,5 @@ Versioning policy:
24
24
  3. Compatible optional-field additions create a new immutable schema version;
25
25
  active Monitors remain pinned to their approved compatibility range.
26
26
  4. A source credential, not any event payload field, determines tenancy and
27
- source identity. These contracts never accept Monitor, Commitment, Agent,
27
+ source identity. These contracts never accept Monitor, Duty, Agent,
28
28
  workspace, or authorization selectors in Signal data.
@@ -3,7 +3,7 @@
3
3
  "info": {
4
4
  "title": "OverSky Signal Plane API",
5
5
  "version": "1.0.0",
6
- "description": "Source-scoped CloudEvents ingestion. A successful receipt only proves durable acceptance; it does not directly invoke a Monitor, Commitment, or Agent."
6
+ "description": "Source-scoped CloudEvents ingestion. A successful receipt only proves durable acceptance; it does not directly invoke a Monitor, Duty, or Agent."
7
7
  },
8
8
  "servers": {
9
9
  "production": {
package/dist/index.cjs CHANGED
@@ -35,6 +35,7 @@ module.exports = __toCommonJS(index_exports);
35
35
 
36
36
  // src/contracts.ts
37
37
  var import_cloudevents = require("cloudevents");
38
+ var VALIDATE_URI_REFERENCE_RE = /\s/;
38
39
  var SIGNAL_CLOUDEVENTS_CONTENT_TYPE = "application/cloudevents+json";
39
40
  var SIGNAL_API_VERSION = "v1";
40
41
  var CLOUD_EVENTS_V1 = "1.0";
@@ -317,7 +318,7 @@ function validateNonEmptyString(value, path, issues) {
317
318
  }
318
319
  }
319
320
  function validateUriReference(value, path, issues) {
320
- if (typeof value !== "string" || value.trim().length === 0 || /\s/.test(value)) {
321
+ if (typeof value !== "string" || value.trim().length === 0 || VALIDATE_URI_REFERENCE_RE.test(value)) {
321
322
  issues.push({ path, code: "format", message: "A non-empty URI-reference is required." });
322
323
  }
323
324
  }
@@ -371,6 +372,7 @@ function omitUndefined(input) {
371
372
 
372
373
  // src/publisher.ts
373
374
  var import_cloudevents2 = require("cloudevents");
375
+ var CONSTRUCTOR_RE = /\/$/;
374
376
  var SignalAPIError = class extends Error {
375
377
  status;
376
378
  code;
@@ -401,7 +403,7 @@ var SignalPublisher = class {
401
403
  if (!options.endpoint) throw new Error("[skrr Signals] endpoint is required.");
402
404
  if (!options.source) throw new Error("[skrr Signals] source is required.");
403
405
  if (!options.token) throw new Error("[skrr Signals] source-scoped token is required.");
404
- this.endpoint = options.endpoint.replace(/\/$/, "");
406
+ this.endpoint = options.endpoint.replace(CONSTRUCTOR_RE, "");
405
407
  this.source = options.source;
406
408
  this.token = options.token;
407
409
  this.timeoutMs = options.timeoutMs ?? 15e3;
package/dist/index.d.cts CHANGED
@@ -9,7 +9,7 @@ interface JsonObject {
9
9
  }
10
10
  /**
11
11
  * Extension attributes are intentionally limited to normal CloudEvents extension
12
- * names. They cannot carry source identity, authorization, Monitor, Commitment,
12
+ * names. They cannot carry source identity, authorization, Monitor, Duty,
13
13
  * or Agent selection data.
14
14
  */
15
15
  type SignalExtensions = Record<string, JsonPrimitive>;
@@ -234,7 +234,7 @@ declare class SignalAPIError extends Error {
234
234
  }
235
235
  /**
236
236
  * A generic, source-scoped publisher. It emits facts only; it cannot name a
237
- * Monitor, Commitment, Agent, workspace, or execution policy.
237
+ * Monitor, Duty, Agent, workspace, or execution policy.
238
238
  */
239
239
  declare class SignalPublisher {
240
240
  readonly endpoint: string;
package/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@ interface JsonObject {
9
9
  }
10
10
  /**
11
11
  * Extension attributes are intentionally limited to normal CloudEvents extension
12
- * names. They cannot carry source identity, authorization, Monitor, Commitment,
12
+ * names. They cannot carry source identity, authorization, Monitor, Duty,
13
13
  * or Agent selection data.
14
14
  */
15
15
  type SignalExtensions = Record<string, JsonPrimitive>;
@@ -234,7 +234,7 @@ declare class SignalAPIError extends Error {
234
234
  }
235
235
  /**
236
236
  * A generic, source-scoped publisher. It emits facts only; it cannot name a
237
- * Monitor, Commitment, Agent, workspace, or execution policy.
237
+ * Monitor, Duty, Agent, workspace, or execution policy.
238
238
  */
239
239
  declare class SignalPublisher {
240
240
  readonly endpoint: string;
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  // src/contracts.ts
2
2
  import { CloudEvent, ValidationError } from "cloudevents";
3
+ var VALIDATE_URI_REFERENCE_RE = /\s/;
3
4
  var SIGNAL_CLOUDEVENTS_CONTENT_TYPE = "application/cloudevents+json";
4
5
  var SIGNAL_API_VERSION = "v1";
5
6
  var CLOUD_EVENTS_V1 = "1.0";
@@ -282,7 +283,7 @@ function validateNonEmptyString(value, path, issues) {
282
283
  }
283
284
  }
284
285
  function validateUriReference(value, path, issues) {
285
- if (typeof value !== "string" || value.trim().length === 0 || /\s/.test(value)) {
286
+ if (typeof value !== "string" || value.trim().length === 0 || VALIDATE_URI_REFERENCE_RE.test(value)) {
286
287
  issues.push({ path, code: "format", message: "A non-empty URI-reference is required." });
287
288
  }
288
289
  }
@@ -336,6 +337,7 @@ function omitUndefined(input) {
336
337
 
337
338
  // src/publisher.ts
338
339
  import { CloudEvent as CloudEvent2, HTTP } from "cloudevents";
340
+ var CONSTRUCTOR_RE = /\/$/;
339
341
  var SignalAPIError = class extends Error {
340
342
  status;
341
343
  code;
@@ -366,7 +368,7 @@ var SignalPublisher = class {
366
368
  if (!options.endpoint) throw new Error("[skrr Signals] endpoint is required.");
367
369
  if (!options.source) throw new Error("[skrr Signals] source is required.");
368
370
  if (!options.token) throw new Error("[skrr Signals] source-scoped token is required.");
369
- this.endpoint = options.endpoint.replace(/\/$/, "");
371
+ this.endpoint = options.endpoint.replace(CONSTRUCTOR_RE, "");
370
372
  this.source = options.source;
371
373
  this.token = options.token;
372
374
  this.timeoutMs = options.timeoutMs ?? 15e3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skrr-ai/signals",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "private": false,
5
5
  "description": "CloudEvents-native Signal contracts and publisher SDK for OverSky",
6
6
  "keywords": [