@canonmsg/core 0.20.0 → 0.20.1

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/client.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { type CanonMessage, type CanonConversation, type CanonContact, type CanonContactRequest, type CanonMessagesPage, type CanonResolveAdmissionResult, type AgentContext, type AddMemberResult, type CreateContactRequestResult, type MediaAttachment, type SendMessageOptions, type CreateConversationOptions, type RegistrationStatus, type SetStreamingOptions } from './types.js';
2
+ import type { RuntimeInputKind } from './runtime-cards.js';
2
3
  import type { SendContextualMessageOptions, SendContextualMessageResult } from './self-context.js';
3
4
  import type { InboundDisposition } from './turn-protocol.js';
4
5
  /**
@@ -53,6 +54,38 @@ export declare class CanonClient {
53
54
  setStreaming(options: SetStreamingOptions): Promise<void>;
54
55
  clearStreaming(conversationId: string): Promise<void>;
55
56
  setTyping(conversationId: string, typing: boolean, status?: 'thinking' | 'typing'): Promise<void>;
57
+ createRuntimeInputRequest(options: {
58
+ conversationId: string;
59
+ inputId: string;
60
+ kind: RuntimeInputKind;
61
+ expiresAt: number;
62
+ }): Promise<{
63
+ success: true;
64
+ inputId: string;
65
+ expiresAt: number;
66
+ }>;
67
+ consumeRuntimeInputResponse(options: {
68
+ conversationId: string;
69
+ inputId: string;
70
+ cancel?: boolean;
71
+ }): Promise<{
72
+ status: 'pending';
73
+ inputId: string;
74
+ expiresAt?: number;
75
+ } | {
76
+ status: 'submitted';
77
+ inputId: string;
78
+ kind: RuntimeInputKind;
79
+ value: string;
80
+ } | {
81
+ status: 'cancelled';
82
+ inputId: string;
83
+ kind: RuntimeInputKind;
84
+ } | {
85
+ status: 'timeout';
86
+ inputId: string;
87
+ kind: RuntimeInputKind;
88
+ }>;
56
89
  static register(baseUrl: string | undefined, body: {
57
90
  name: string;
58
91
  description: string;
package/dist/client.js CHANGED
@@ -319,6 +319,26 @@ export class CanonClient {
319
319
  if (!res.ok)
320
320
  throw new CanonApiError(res.status, await res.text());
321
321
  }
322
+ async createRuntimeInputRequest(options) {
323
+ const res = await fetch(`${this.baseUrl}/runtime-input/request`, {
324
+ method: 'POST',
325
+ headers: this.authHeaders(),
326
+ body: JSON.stringify(options),
327
+ });
328
+ if (!res.ok)
329
+ throw new CanonApiError(res.status, await res.text());
330
+ return res.json();
331
+ }
332
+ async consumeRuntimeInputResponse(options) {
333
+ const res = await fetch(`${this.baseUrl}/runtime-input/consume`, {
334
+ method: 'POST',
335
+ headers: this.authHeaders(),
336
+ body: JSON.stringify(options),
337
+ });
338
+ if (!res.ok)
339
+ throw new CanonApiError(res.status, await res.text());
340
+ return res.json();
341
+ }
322
342
  // ── Static unauthenticated registration endpoints ────────────────────
323
343
  static async register(baseUrl, body) {
324
344
  const url = baseUrl || DEFAULT_BASE_URL;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canonmsg/core",
3
- "version": "0.20.0",
3
+ "version": "0.20.1",
4
4
  "description": "Canon core — shared types, REST client, SSE stream, and registration for Canon messaging",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",