@tryvira/sdk 0.1.67 → 0.1.68

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
@@ -1,5 +1,9 @@
1
1
  # @tryvira/sdk
2
2
 
3
+ Canonical integration helpers use verb-noun names such as `connectAiSystem`,
4
+ `recordUserFeedback`, and `recordBusinessOutcome`. The older `connectOnce`,
5
+ `feedback`, and `outcome` methods remain supported as source-compatible aliases.
6
+
3
7
  The official JavaScript and TypeScript client for Vira. Use it to connect an AI
4
8
  application, record observations, author governed behavior, evaluate changes, release
5
9
  approved behavior, and resolve it at runtime.
package/dist/index.js CHANGED
@@ -312,6 +312,10 @@ var ViraClient = class {
312
312
  }
313
313
  };
314
314
  }
315
+ /** Canonical verb-noun name; connectOnce remains for source compatibility. */
316
+ connectAiSystem(input) {
317
+ return this.connectOnce(input);
318
+ }
315
319
  observe(event, options = {}) {
316
320
  buildObservationRequest(event);
317
321
  return (async () => {
@@ -341,6 +345,12 @@ var ViraClient = class {
341
345
  feedback(event, options = {}) {
342
346
  return this.observe({ ...event, eventType: "feedback.user" }, options);
343
347
  }
348
+ recordBusinessOutcome(event, options = {}) {
349
+ return this.outcome(event, options);
350
+ }
351
+ recordUserFeedback(event, options = {}) {
352
+ return this.feedback(event, options);
353
+ }
344
354
  observeBatch(events, options = {}) {
345
355
  if (!Array.isArray(events) || events.length < 1 || events.length > 100)
346
356
  throw new Error("SDK_OBSERVATION_BATCH_INVALID");
@@ -8,7 +8,7 @@ export interface RuntimeRequest {
8
8
  expiresAt: number;
9
9
  }
10
10
  export interface SdkRequest {
11
- method: "GET" | "POST" | "DELETE";
11
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
12
12
  path: string;
13
13
  query?: Readonly<Record<string, string>>;
14
14
  body?: Readonly<Record<string, unknown>>;
@@ -186,7 +186,7 @@ type ClientObservation = ClientObservationScope & {
186
186
  };
187
187
  export interface ViraHttpRequestOptions {
188
188
  apiKey?: string;
189
- method: "GET" | "POST" | "DELETE";
189
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
190
190
  body?: unknown;
191
191
  idempotencyKey?: string;
192
192
  fetcher?: typeof fetch;
@@ -257,6 +257,8 @@ export declare class ViraClient {
257
257
  idempotencyKey?: string;
258
258
  reuseExistingConnectionOnConflict?: boolean;
259
259
  }): Promise<ViraResponse<ConnectOnceResult> | null>;
260
+ /** Canonical verb-noun name; connectOnce remains for source compatibility. */
261
+ connectAiSystem(input: Parameters<ViraClient['connectOnce']>[0]): Promise<ViraResponse<ConnectOnceResult> | null>;
260
262
  observe(event: ClientObservation, options?: {
261
263
  idempotencyKey?: string;
262
264
  }): Promise<ViraResponse<ClientBody> | null>;
@@ -292,6 +294,12 @@ export declare class ViraClient {
292
294
  }, options?: {
293
295
  idempotencyKey?: string;
294
296
  }): Promise<ViraResponse<ClientBody> | null>;
297
+ recordBusinessOutcome(event: Parameters<ViraClient['outcome']>[0], options?: {
298
+ idempotencyKey?: string;
299
+ }): Promise<ViraResponse<ClientBody> | null>;
300
+ recordUserFeedback(event: Parameters<ViraClient['feedback']>[0], options?: {
301
+ idempotencyKey?: string;
302
+ }): Promise<ViraResponse<ClientBody> | null>;
295
303
  observeBatch(events: readonly (ClientObservationScope & {
296
304
  eventId: string;
297
305
  eventType: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryvira/sdk",
3
- "version": "0.1.67",
3
+ "version": "0.1.68",
4
4
  "description": "Typed Vira SDK for connect-once, observation and governed runtime execution.",
5
5
  "keywords": ["vira", "ai-governance", "ai-runtime", "semantic-routing"],
6
6
  "engines": {"node": ">=20"},