@holon-run/uxc-daemon-client 0.13.3 → 0.14.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 +50 -0
- package/dist/index.d.cts +88 -1
- package/dist/index.d.ts +88 -1
- package/dist/index.js +50 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -149,6 +149,56 @@ var UxcDaemonClient = class {
|
|
|
149
149
|
wait_ms: args.waitMs ?? 15e3
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
+
async sourceEnsure(args) {
|
|
153
|
+
return this.request("source.ensure", {
|
|
154
|
+
namespace: args.namespace,
|
|
155
|
+
source_key: args.sourceKey,
|
|
156
|
+
spec: {
|
|
157
|
+
...args.spec,
|
|
158
|
+
resource_uri: args.spec.resource_uri ?? null,
|
|
159
|
+
read_resource: args.spec.read_resource ?? false,
|
|
160
|
+
transport_hint: args.spec.transport_hint ?? null,
|
|
161
|
+
subprotocols: args.spec.subprotocols ?? [],
|
|
162
|
+
initial_text_frames: args.spec.initial_text_frames ?? [],
|
|
163
|
+
poll_config: args.spec.poll_config ?? null,
|
|
164
|
+
options: normalizeOptions(args.spec.options)
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
async sourceStatus(namespace, sourceKey) {
|
|
169
|
+
return this.request("source.status", {
|
|
170
|
+
namespace,
|
|
171
|
+
source_key: sourceKey
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
async sourceStop(namespace, sourceKey) {
|
|
175
|
+
return this.request("source.stop", {
|
|
176
|
+
namespace,
|
|
177
|
+
source_key: sourceKey
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
async sourceDelete(namespace, sourceKey) {
|
|
181
|
+
return this.request("source.delete", {
|
|
182
|
+
namespace,
|
|
183
|
+
source_key: sourceKey
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
async streamRead(args) {
|
|
187
|
+
return this.request("stream.read", {
|
|
188
|
+
stream_id: args.streamId,
|
|
189
|
+
after_offset: args.afterOffset ?? 0,
|
|
190
|
+
limit: args.limit ?? 100
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
async streamInfo(streamId) {
|
|
194
|
+
return this.request("stream.info", { stream_id: streamId });
|
|
195
|
+
}
|
|
196
|
+
async streamTrim(streamId, beforeOffset) {
|
|
197
|
+
return this.request("stream.trim", {
|
|
198
|
+
stream_id: streamId,
|
|
199
|
+
before_offset: beforeOffset
|
|
200
|
+
});
|
|
201
|
+
}
|
|
152
202
|
async *subscribeEvents(jobId, options = {}) {
|
|
153
203
|
let afterSeq = options.afterSeq ?? 0;
|
|
154
204
|
while (true) {
|
package/dist/index.d.cts
CHANGED
|
@@ -98,6 +98,78 @@ interface SubscribeStopResponse {
|
|
|
98
98
|
job_id: string;
|
|
99
99
|
stopped: boolean;
|
|
100
100
|
}
|
|
101
|
+
interface ManagedSourceSpec {
|
|
102
|
+
endpoint: string;
|
|
103
|
+
operation_id?: string | null;
|
|
104
|
+
args?: Record<string, unknown> | null;
|
|
105
|
+
resource_uri?: string | null;
|
|
106
|
+
read_resource?: boolean;
|
|
107
|
+
transport_hint?: "websocket" | "discord_gateway" | "slack_socket_mode" | "feishu_long_connection" | null;
|
|
108
|
+
subprotocols?: string[];
|
|
109
|
+
initial_text_frames?: string[];
|
|
110
|
+
mode: "stream" | "poll";
|
|
111
|
+
poll_config?: PollSubscriptionConfig | null;
|
|
112
|
+
options?: RuntimeInvokeOptions;
|
|
113
|
+
}
|
|
114
|
+
interface ManagedSourceEnsureResponse {
|
|
115
|
+
namespace: string;
|
|
116
|
+
source_key: string;
|
|
117
|
+
run_id: string;
|
|
118
|
+
stream_id: string;
|
|
119
|
+
status: string;
|
|
120
|
+
reused: boolean;
|
|
121
|
+
replaced_previous: boolean;
|
|
122
|
+
}
|
|
123
|
+
interface ManagedSourceView {
|
|
124
|
+
namespace: string;
|
|
125
|
+
source_key: string;
|
|
126
|
+
run_id: string;
|
|
127
|
+
stream_id: string;
|
|
128
|
+
spec_key: string;
|
|
129
|
+
status: string;
|
|
130
|
+
created_at_unix: number;
|
|
131
|
+
updated_at_unix: number;
|
|
132
|
+
started_at_unix?: number | null;
|
|
133
|
+
stopped_at_unix?: number | null;
|
|
134
|
+
last_error?: string | null;
|
|
135
|
+
}
|
|
136
|
+
interface ManagedSourceStopResponse {
|
|
137
|
+
namespace: string;
|
|
138
|
+
source_key: string;
|
|
139
|
+
stopped: boolean;
|
|
140
|
+
}
|
|
141
|
+
interface ManagedSourceDeleteResponse {
|
|
142
|
+
namespace: string;
|
|
143
|
+
source_key: string;
|
|
144
|
+
deleted: boolean;
|
|
145
|
+
}
|
|
146
|
+
interface ManagedStreamEvent {
|
|
147
|
+
stream_id: string;
|
|
148
|
+
offset: number;
|
|
149
|
+
ingested_at_unix: number;
|
|
150
|
+
raw_payload: unknown;
|
|
151
|
+
}
|
|
152
|
+
interface ManagedStreamReadResponse {
|
|
153
|
+
stream_id: string;
|
|
154
|
+
events: ManagedStreamEvent[];
|
|
155
|
+
next_after_offset: number;
|
|
156
|
+
has_more: boolean;
|
|
157
|
+
}
|
|
158
|
+
interface ManagedStreamInfo {
|
|
159
|
+
stream_id: string;
|
|
160
|
+
namespace: string;
|
|
161
|
+
source_key: string;
|
|
162
|
+
created_at_unix: number;
|
|
163
|
+
earliest_offset?: number | null;
|
|
164
|
+
latest_offset?: number | null;
|
|
165
|
+
event_count: number;
|
|
166
|
+
retention_max_rows: number;
|
|
167
|
+
retention_max_age_secs: number;
|
|
168
|
+
}
|
|
169
|
+
interface ManagedStreamTrimResponse {
|
|
170
|
+
stream_id: string;
|
|
171
|
+
trimmed: number;
|
|
172
|
+
}
|
|
101
173
|
interface SubscriptionJobView {
|
|
102
174
|
job_id: string;
|
|
103
175
|
mode: "stream" | "poll";
|
|
@@ -230,6 +302,21 @@ declare class UxcDaemonClient {
|
|
|
230
302
|
limit?: number;
|
|
231
303
|
waitMs?: number;
|
|
232
304
|
}): Promise<SubscriptionEventsResponse>;
|
|
305
|
+
sourceEnsure(args: {
|
|
306
|
+
namespace: string;
|
|
307
|
+
sourceKey: string;
|
|
308
|
+
spec: ManagedSourceSpec;
|
|
309
|
+
}): Promise<ManagedSourceEnsureResponse>;
|
|
310
|
+
sourceStatus(namespace: string, sourceKey: string): Promise<ManagedSourceView>;
|
|
311
|
+
sourceStop(namespace: string, sourceKey: string): Promise<ManagedSourceStopResponse>;
|
|
312
|
+
sourceDelete(namespace: string, sourceKey: string): Promise<ManagedSourceDeleteResponse>;
|
|
313
|
+
streamRead(args: {
|
|
314
|
+
streamId: string;
|
|
315
|
+
afterOffset?: number;
|
|
316
|
+
limit?: number;
|
|
317
|
+
}): Promise<ManagedStreamReadResponse>;
|
|
318
|
+
streamInfo(streamId: string): Promise<ManagedStreamInfo>;
|
|
319
|
+
streamTrim(streamId: string, beforeOffset: number): Promise<ManagedStreamTrimResponse>;
|
|
233
320
|
subscribeEvents(jobId: string, options?: {
|
|
234
321
|
afterSeq?: number;
|
|
235
322
|
limit?: number;
|
|
@@ -242,4 +329,4 @@ declare class UxcDaemonClient {
|
|
|
242
329
|
}
|
|
243
330
|
declare function generateTypeScriptClient(schema: CodegenHostSchemaV1, options?: GenerateTypeScriptClientOptions): string;
|
|
244
331
|
|
|
245
|
-
export { type CodegenHostSchemaV1, type CodegenOperationV1, DaemonRpcError, type DaemonStatus, type GenerateTypeScriptClientOptions, type PollSubscriptionConfig, type RuntimeInvokeOptions, type RuntimeInvokeResponse, type RuntimeMeta, type RuntimeResult, type SubscribeStartArgs, type SubscribeStartResponse, type SubscribeStopResponse, type SubscriptionEventEnvelope, type SubscriptionEventsResponse, type SubscriptionJobView, UxcDaemonClient, type UxcDaemonClientOptions, generateTypeScriptClient };
|
|
332
|
+
export { type CodegenHostSchemaV1, type CodegenOperationV1, DaemonRpcError, type DaemonStatus, type GenerateTypeScriptClientOptions, type ManagedSourceDeleteResponse, type ManagedSourceEnsureResponse, type ManagedSourceSpec, type ManagedSourceStopResponse, type ManagedSourceView, type ManagedStreamEvent, type ManagedStreamInfo, type ManagedStreamReadResponse, type ManagedStreamTrimResponse, type PollSubscriptionConfig, type RuntimeInvokeOptions, type RuntimeInvokeResponse, type RuntimeMeta, type RuntimeResult, type SubscribeStartArgs, type SubscribeStartResponse, type SubscribeStopResponse, type SubscriptionEventEnvelope, type SubscriptionEventsResponse, type SubscriptionJobView, UxcDaemonClient, type UxcDaemonClientOptions, generateTypeScriptClient };
|
package/dist/index.d.ts
CHANGED
|
@@ -98,6 +98,78 @@ interface SubscribeStopResponse {
|
|
|
98
98
|
job_id: string;
|
|
99
99
|
stopped: boolean;
|
|
100
100
|
}
|
|
101
|
+
interface ManagedSourceSpec {
|
|
102
|
+
endpoint: string;
|
|
103
|
+
operation_id?: string | null;
|
|
104
|
+
args?: Record<string, unknown> | null;
|
|
105
|
+
resource_uri?: string | null;
|
|
106
|
+
read_resource?: boolean;
|
|
107
|
+
transport_hint?: "websocket" | "discord_gateway" | "slack_socket_mode" | "feishu_long_connection" | null;
|
|
108
|
+
subprotocols?: string[];
|
|
109
|
+
initial_text_frames?: string[];
|
|
110
|
+
mode: "stream" | "poll";
|
|
111
|
+
poll_config?: PollSubscriptionConfig | null;
|
|
112
|
+
options?: RuntimeInvokeOptions;
|
|
113
|
+
}
|
|
114
|
+
interface ManagedSourceEnsureResponse {
|
|
115
|
+
namespace: string;
|
|
116
|
+
source_key: string;
|
|
117
|
+
run_id: string;
|
|
118
|
+
stream_id: string;
|
|
119
|
+
status: string;
|
|
120
|
+
reused: boolean;
|
|
121
|
+
replaced_previous: boolean;
|
|
122
|
+
}
|
|
123
|
+
interface ManagedSourceView {
|
|
124
|
+
namespace: string;
|
|
125
|
+
source_key: string;
|
|
126
|
+
run_id: string;
|
|
127
|
+
stream_id: string;
|
|
128
|
+
spec_key: string;
|
|
129
|
+
status: string;
|
|
130
|
+
created_at_unix: number;
|
|
131
|
+
updated_at_unix: number;
|
|
132
|
+
started_at_unix?: number | null;
|
|
133
|
+
stopped_at_unix?: number | null;
|
|
134
|
+
last_error?: string | null;
|
|
135
|
+
}
|
|
136
|
+
interface ManagedSourceStopResponse {
|
|
137
|
+
namespace: string;
|
|
138
|
+
source_key: string;
|
|
139
|
+
stopped: boolean;
|
|
140
|
+
}
|
|
141
|
+
interface ManagedSourceDeleteResponse {
|
|
142
|
+
namespace: string;
|
|
143
|
+
source_key: string;
|
|
144
|
+
deleted: boolean;
|
|
145
|
+
}
|
|
146
|
+
interface ManagedStreamEvent {
|
|
147
|
+
stream_id: string;
|
|
148
|
+
offset: number;
|
|
149
|
+
ingested_at_unix: number;
|
|
150
|
+
raw_payload: unknown;
|
|
151
|
+
}
|
|
152
|
+
interface ManagedStreamReadResponse {
|
|
153
|
+
stream_id: string;
|
|
154
|
+
events: ManagedStreamEvent[];
|
|
155
|
+
next_after_offset: number;
|
|
156
|
+
has_more: boolean;
|
|
157
|
+
}
|
|
158
|
+
interface ManagedStreamInfo {
|
|
159
|
+
stream_id: string;
|
|
160
|
+
namespace: string;
|
|
161
|
+
source_key: string;
|
|
162
|
+
created_at_unix: number;
|
|
163
|
+
earliest_offset?: number | null;
|
|
164
|
+
latest_offset?: number | null;
|
|
165
|
+
event_count: number;
|
|
166
|
+
retention_max_rows: number;
|
|
167
|
+
retention_max_age_secs: number;
|
|
168
|
+
}
|
|
169
|
+
interface ManagedStreamTrimResponse {
|
|
170
|
+
stream_id: string;
|
|
171
|
+
trimmed: number;
|
|
172
|
+
}
|
|
101
173
|
interface SubscriptionJobView {
|
|
102
174
|
job_id: string;
|
|
103
175
|
mode: "stream" | "poll";
|
|
@@ -230,6 +302,21 @@ declare class UxcDaemonClient {
|
|
|
230
302
|
limit?: number;
|
|
231
303
|
waitMs?: number;
|
|
232
304
|
}): Promise<SubscriptionEventsResponse>;
|
|
305
|
+
sourceEnsure(args: {
|
|
306
|
+
namespace: string;
|
|
307
|
+
sourceKey: string;
|
|
308
|
+
spec: ManagedSourceSpec;
|
|
309
|
+
}): Promise<ManagedSourceEnsureResponse>;
|
|
310
|
+
sourceStatus(namespace: string, sourceKey: string): Promise<ManagedSourceView>;
|
|
311
|
+
sourceStop(namespace: string, sourceKey: string): Promise<ManagedSourceStopResponse>;
|
|
312
|
+
sourceDelete(namespace: string, sourceKey: string): Promise<ManagedSourceDeleteResponse>;
|
|
313
|
+
streamRead(args: {
|
|
314
|
+
streamId: string;
|
|
315
|
+
afterOffset?: number;
|
|
316
|
+
limit?: number;
|
|
317
|
+
}): Promise<ManagedStreamReadResponse>;
|
|
318
|
+
streamInfo(streamId: string): Promise<ManagedStreamInfo>;
|
|
319
|
+
streamTrim(streamId: string, beforeOffset: number): Promise<ManagedStreamTrimResponse>;
|
|
233
320
|
subscribeEvents(jobId: string, options?: {
|
|
234
321
|
afterSeq?: number;
|
|
235
322
|
limit?: number;
|
|
@@ -242,4 +329,4 @@ declare class UxcDaemonClient {
|
|
|
242
329
|
}
|
|
243
330
|
declare function generateTypeScriptClient(schema: CodegenHostSchemaV1, options?: GenerateTypeScriptClientOptions): string;
|
|
244
331
|
|
|
245
|
-
export { type CodegenHostSchemaV1, type CodegenOperationV1, DaemonRpcError, type DaemonStatus, type GenerateTypeScriptClientOptions, type PollSubscriptionConfig, type RuntimeInvokeOptions, type RuntimeInvokeResponse, type RuntimeMeta, type RuntimeResult, type SubscribeStartArgs, type SubscribeStartResponse, type SubscribeStopResponse, type SubscriptionEventEnvelope, type SubscriptionEventsResponse, type SubscriptionJobView, UxcDaemonClient, type UxcDaemonClientOptions, generateTypeScriptClient };
|
|
332
|
+
export { type CodegenHostSchemaV1, type CodegenOperationV1, DaemonRpcError, type DaemonStatus, type GenerateTypeScriptClientOptions, type ManagedSourceDeleteResponse, type ManagedSourceEnsureResponse, type ManagedSourceSpec, type ManagedSourceStopResponse, type ManagedSourceView, type ManagedStreamEvent, type ManagedStreamInfo, type ManagedStreamReadResponse, type ManagedStreamTrimResponse, type PollSubscriptionConfig, type RuntimeInvokeOptions, type RuntimeInvokeResponse, type RuntimeMeta, type RuntimeResult, type SubscribeStartArgs, type SubscribeStartResponse, type SubscribeStopResponse, type SubscriptionEventEnvelope, type SubscriptionEventsResponse, type SubscriptionJobView, UxcDaemonClient, type UxcDaemonClientOptions, generateTypeScriptClient };
|
package/dist/index.js
CHANGED
|
@@ -113,6 +113,56 @@ var UxcDaemonClient = class {
|
|
|
113
113
|
wait_ms: args.waitMs ?? 15e3
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
+
async sourceEnsure(args) {
|
|
117
|
+
return this.request("source.ensure", {
|
|
118
|
+
namespace: args.namespace,
|
|
119
|
+
source_key: args.sourceKey,
|
|
120
|
+
spec: {
|
|
121
|
+
...args.spec,
|
|
122
|
+
resource_uri: args.spec.resource_uri ?? null,
|
|
123
|
+
read_resource: args.spec.read_resource ?? false,
|
|
124
|
+
transport_hint: args.spec.transport_hint ?? null,
|
|
125
|
+
subprotocols: args.spec.subprotocols ?? [],
|
|
126
|
+
initial_text_frames: args.spec.initial_text_frames ?? [],
|
|
127
|
+
poll_config: args.spec.poll_config ?? null,
|
|
128
|
+
options: normalizeOptions(args.spec.options)
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
async sourceStatus(namespace, sourceKey) {
|
|
133
|
+
return this.request("source.status", {
|
|
134
|
+
namespace,
|
|
135
|
+
source_key: sourceKey
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
async sourceStop(namespace, sourceKey) {
|
|
139
|
+
return this.request("source.stop", {
|
|
140
|
+
namespace,
|
|
141
|
+
source_key: sourceKey
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
async sourceDelete(namespace, sourceKey) {
|
|
145
|
+
return this.request("source.delete", {
|
|
146
|
+
namespace,
|
|
147
|
+
source_key: sourceKey
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
async streamRead(args) {
|
|
151
|
+
return this.request("stream.read", {
|
|
152
|
+
stream_id: args.streamId,
|
|
153
|
+
after_offset: args.afterOffset ?? 0,
|
|
154
|
+
limit: args.limit ?? 100
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
async streamInfo(streamId) {
|
|
158
|
+
return this.request("stream.info", { stream_id: streamId });
|
|
159
|
+
}
|
|
160
|
+
async streamTrim(streamId, beforeOffset) {
|
|
161
|
+
return this.request("stream.trim", {
|
|
162
|
+
stream_id: streamId,
|
|
163
|
+
before_offset: beforeOffset
|
|
164
|
+
});
|
|
165
|
+
}
|
|
116
166
|
async *subscribeEvents(jobId, options = {}) {
|
|
117
167
|
let afterSeq = options.afterSeq ?? 0;
|
|
118
168
|
while (true) {
|