@b3os/sdk 0.2.1 → 0.2.2

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.
Files changed (138) hide show
  1. package/dist/cjs/core/util.d.ts +1 -1
  2. package/dist/cjs/core/util.js +1 -1
  3. package/dist/cjs/generated/client.d.ts +13 -0
  4. package/dist/cjs/generated/client.js +25 -0
  5. package/dist/cjs/generated/client.js.map +1 -1
  6. package/dist/cjs/generated/errors.d.ts +1 -1
  7. package/dist/cjs/generated/errors.js +75 -0
  8. package/dist/cjs/generated/errors.js.map +1 -1
  9. package/dist/cjs/generated/ids.d.ts +61 -0
  10. package/dist/cjs/generated/ids.js +15 -0
  11. package/dist/cjs/generated/ids.js.map +1 -1
  12. package/dist/cjs/generated/jobs.js +4 -0
  13. package/dist/cjs/generated/jobs.js.map +1 -1
  14. package/dist/cjs/generated/ns/actions.d.ts +267 -33
  15. package/dist/cjs/generated/ns/actions.js +375 -33
  16. package/dist/cjs/generated/ns/actions.js.map +1 -1
  17. package/dist/cjs/generated/ns/agents.d.ts +229 -0
  18. package/dist/cjs/generated/ns/agents.js +402 -0
  19. package/dist/cjs/generated/ns/agents.js.map +1 -0
  20. package/dist/cjs/generated/ns/images.d.ts +81 -0
  21. package/dist/cjs/generated/ns/images.js +122 -0
  22. package/dist/cjs/generated/ns/images.js.map +1 -0
  23. package/dist/cjs/generated/ns/infer.d.ts +71 -3
  24. package/dist/cjs/generated/ns/infer.js +98 -3
  25. package/dist/cjs/generated/ns/infer.js.map +1 -1
  26. package/dist/cjs/generated/ns/keys.d.ts +3 -1
  27. package/dist/cjs/generated/ns/keys.js +3 -1
  28. package/dist/cjs/generated/ns/keys.js.map +1 -1
  29. package/dist/cjs/generated/ns/listeners.d.ts +159 -0
  30. package/dist/cjs/generated/ns/listeners.js +264 -0
  31. package/dist/cjs/generated/ns/listeners.js.map +1 -0
  32. package/dist/cjs/generated/ns/orgs.d.ts +10 -0
  33. package/dist/cjs/generated/ns/orgs.js +26 -1
  34. package/dist/cjs/generated/ns/orgs.js.map +1 -1
  35. package/dist/cjs/generated/ns/projects.d.ts +32 -0
  36. package/dist/cjs/generated/ns/projects.js +66 -0
  37. package/dist/cjs/generated/ns/projects.js.map +1 -1
  38. package/dist/cjs/generated/ns/render.d.ts +192 -21
  39. package/dist/cjs/generated/ns/render.js +267 -24
  40. package/dist/cjs/generated/ns/render.js.map +1 -1
  41. package/dist/cjs/generated/ns/requests.d.ts +3 -1
  42. package/dist/cjs/generated/ns/requests.js +3 -1
  43. package/dist/cjs/generated/ns/requests.js.map +1 -1
  44. package/dist/cjs/generated/ns/routines.d.ts +11 -4
  45. package/dist/cjs/generated/ns/routines.js +11 -4
  46. package/dist/cjs/generated/ns/routines.js.map +1 -1
  47. package/dist/cjs/generated/ns/sandboxes.d.ts +292 -7
  48. package/dist/cjs/generated/ns/sandboxes.js +444 -6
  49. package/dist/cjs/generated/ns/sandboxes.js.map +1 -1
  50. package/dist/cjs/generated/ns/usage.d.ts +1 -1
  51. package/dist/cjs/generated/ns/usage.js +1 -1
  52. package/dist/cjs/generated/ns/vision.d.ts +59 -17
  53. package/dist/cjs/generated/ns/vision.js +59 -21
  54. package/dist/cjs/generated/ns/vision.js.map +1 -1
  55. package/dist/cjs/generated/types.d.ts +2564 -68
  56. package/dist/cjs/helpers/sandboxes.d.ts +20 -1
  57. package/dist/cjs/helpers/sandboxes.js +13 -1
  58. package/dist/cjs/helpers/sandboxes.js.map +1 -1
  59. package/dist/esm/core/util.d.ts +1 -1
  60. package/dist/esm/core/util.js +1 -1
  61. package/dist/esm/generated/client.d.ts +13 -0
  62. package/dist/esm/generated/client.js +25 -0
  63. package/dist/esm/generated/client.js.map +1 -1
  64. package/dist/esm/generated/errors.d.ts +1 -1
  65. package/dist/esm/generated/errors.js +75 -0
  66. package/dist/esm/generated/errors.js.map +1 -1
  67. package/dist/esm/generated/ids.d.ts +61 -0
  68. package/dist/esm/generated/ids.js +15 -0
  69. package/dist/esm/generated/ids.js.map +1 -1
  70. package/dist/esm/generated/jobs.js +4 -0
  71. package/dist/esm/generated/jobs.js.map +1 -1
  72. package/dist/esm/generated/ns/actions.d.ts +267 -33
  73. package/dist/esm/generated/ns/actions.js +375 -33
  74. package/dist/esm/generated/ns/actions.js.map +1 -1
  75. package/dist/esm/generated/ns/agents.d.ts +229 -0
  76. package/dist/esm/generated/ns/agents.js +398 -0
  77. package/dist/esm/generated/ns/agents.js.map +1 -0
  78. package/dist/esm/generated/ns/images.d.ts +81 -0
  79. package/dist/esm/generated/ns/images.js +118 -0
  80. package/dist/esm/generated/ns/images.js.map +1 -0
  81. package/dist/esm/generated/ns/infer.d.ts +71 -3
  82. package/dist/esm/generated/ns/infer.js +98 -3
  83. package/dist/esm/generated/ns/infer.js.map +1 -1
  84. package/dist/esm/generated/ns/keys.d.ts +3 -1
  85. package/dist/esm/generated/ns/keys.js +3 -1
  86. package/dist/esm/generated/ns/keys.js.map +1 -1
  87. package/dist/esm/generated/ns/listeners.d.ts +159 -0
  88. package/dist/esm/generated/ns/listeners.js +260 -0
  89. package/dist/esm/generated/ns/listeners.js.map +1 -0
  90. package/dist/esm/generated/ns/orgs.d.ts +10 -0
  91. package/dist/esm/generated/ns/orgs.js +26 -1
  92. package/dist/esm/generated/ns/orgs.js.map +1 -1
  93. package/dist/esm/generated/ns/projects.d.ts +32 -0
  94. package/dist/esm/generated/ns/projects.js +66 -0
  95. package/dist/esm/generated/ns/projects.js.map +1 -1
  96. package/dist/esm/generated/ns/render.d.ts +192 -21
  97. package/dist/esm/generated/ns/render.js +267 -24
  98. package/dist/esm/generated/ns/render.js.map +1 -1
  99. package/dist/esm/generated/ns/requests.d.ts +3 -1
  100. package/dist/esm/generated/ns/requests.js +3 -1
  101. package/dist/esm/generated/ns/requests.js.map +1 -1
  102. package/dist/esm/generated/ns/routines.d.ts +11 -4
  103. package/dist/esm/generated/ns/routines.js +11 -4
  104. package/dist/esm/generated/ns/routines.js.map +1 -1
  105. package/dist/esm/generated/ns/sandboxes.d.ts +292 -7
  106. package/dist/esm/generated/ns/sandboxes.js +444 -6
  107. package/dist/esm/generated/ns/sandboxes.js.map +1 -1
  108. package/dist/esm/generated/ns/usage.d.ts +1 -1
  109. package/dist/esm/generated/ns/usage.js +1 -1
  110. package/dist/esm/generated/ns/vision.d.ts +59 -17
  111. package/dist/esm/generated/ns/vision.js +59 -21
  112. package/dist/esm/generated/ns/vision.js.map +1 -1
  113. package/dist/esm/generated/types.d.ts +2564 -68
  114. package/dist/esm/helpers/sandboxes.d.ts +20 -1
  115. package/dist/esm/helpers/sandboxes.js +13 -1
  116. package/dist/esm/helpers/sandboxes.js.map +1 -1
  117. package/package.json +1 -1
  118. package/src/core/util.ts +1 -1
  119. package/src/generated/client.ts +28 -0
  120. package/src/generated/errors.ts +150 -0
  121. package/src/generated/ids.ts +15 -0
  122. package/src/generated/jobs.ts +4 -0
  123. package/src/generated/ns/actions.ts +403 -33
  124. package/src/generated/ns/agents.ts +461 -0
  125. package/src/generated/ns/images.ts +128 -0
  126. package/src/generated/ns/infer.ts +100 -3
  127. package/src/generated/ns/keys.ts +3 -1
  128. package/src/generated/ns/listeners.ts +296 -0
  129. package/src/generated/ns/orgs.ts +27 -1
  130. package/src/generated/ns/projects.ts +74 -0
  131. package/src/generated/ns/render.ts +277 -24
  132. package/src/generated/ns/requests.ts +3 -1
  133. package/src/generated/ns/routines.ts +11 -4
  134. package/src/generated/ns/sandboxes.ts +492 -7
  135. package/src/generated/ns/usage.ts +1 -1
  136. package/src/generated/ns/vision.ts +59 -21
  137. package/src/generated/types.ts +2907 -192
  138. package/src/helpers/sandboxes.ts +31 -2
@@ -0,0 +1,159 @@
1
+ import type { RequestOptions, StreamOptions } from "../../core/client.ts";
2
+ import { Namespace } from "../../core/namespace.ts";
3
+ import type { Op } from "../../core/op.ts";
4
+ import type { APIPromise, ListPromise } from "../../core/promise.ts";
5
+ import type { EventStream } from "../../core/sse.ts";
6
+ import type * as T from "../types.ts";
7
+ /** Descriptors of every listeners operation, keyed by method name (for tooling and custom clients). */
8
+ export declare const listenersOps: {
9
+ readonly listListeners: Op;
10
+ readonly createListener: Op;
11
+ readonly deleteListener: Op;
12
+ readonly getListener: Op;
13
+ readonly updateListener: Op;
14
+ readonly listEvents: Op;
15
+ readonly ingestEvents: Op;
16
+ readonly redeliverEvent: Op;
17
+ readonly streamEvents: Op;
18
+ readonly testListener: Op;
19
+ };
20
+ /**
21
+ * Persistent subscriptions: a polled, streamed or pushed source, a CEL filter and a routine or webhook sink (`/v1/listeners`).
22
+ */
23
+ export declare class ListenersAPI extends Namespace {
24
+ /**
25
+ * List listeners
26
+ *
27
+ * Lists this project's listeners, newest first, in every status. Deleted listeners are not listed.
28
+ *
29
+ * `GET /v1/listeners` · scope `listeners:read` · served by the node
30
+ */
31
+ listListeners(params?: T.ListenersListListenersParams, options?: RequestOptions): ListPromise<T.ListenerList, T.Listener>;
32
+ /**
33
+ * Create a listener
34
+ *
35
+ * Validates the definition, compiles its CEL expressions and starts the source; the answer is `201` with the
36
+ * listener in status `starting`, and `active` follows once the first connect or poll succeeds. A source that
37
+ * cannot be reached does not fail the create: the listener goes `reconnecting` and retries with backoff, and
38
+ * after 24 hours of failures it ends `failed` with the reason in `error`.
39
+ *
40
+ * The routine named in a `routine` sink must exist in this project and needs `routines:run` on top of
41
+ * `listeners:write`; a `source.connection` needs `vault:run`, and the URL's host must be one of the
42
+ * connection's `hosts` (otherwise `422 listener_invalid`, reason `connection_host`). Without `ttl_s` or
43
+ * `expires_at` the listener lives until it is deleted. Without `budget.events_per_day` it gets the
44
+ * organization's share, `listeners.events.daily` divided by `listeners.active.max`; the object always shows the
45
+ * budget in force.
46
+ *
47
+ * A `filter.model` asks the small model one question about each event CEL kept, as the listener's owner, so it
48
+ * needs `infer:run` and bills infer tokens, within `budget.model_tokens_per_day`. The question is the system
49
+ * message and the event its own delimited user message; no tools are offered and the answer is parsed strictly.
50
+ * An event's content can still try to steer the model: at worst it makes the answer `true` for that event,
51
+ * which `budget.events_per_day` and `budget.model_tokens_per_day` bound, so do not rely on the model filter
52
+ * alone to keep untrusted events from a sink that acts on them. When the model cannot answer (an error, a
53
+ * timeout, output that does not parse, the token budget spent), `on_error` decides (`drop` by default, or
54
+ * `pass`), and the event's `filter.model` says what happened.
55
+ *
56
+ * A `pack` source is checked by the actions trigger manager at create (the trigger exists, `with` is valid,
57
+ * its connections are usable) and is held there as a trigger subscription the listener owns; it is removed
58
+ * when the listener is paused, deleted or ends.
59
+ *
60
+ * A `webhook` source's listener is `active` at once, and its answer carries `source.hook_id` and
61
+ * `source.hook_url` to give the provider; with the `b3os` scheme it also carries `source.secret`, which no
62
+ * later answer shows. A `verify.secret` connection needs `vault:run`. A `websocket` source is held by the
63
+ * node's socket holder; while that unit is down the listener stays `starting` or `reconnecting`.
64
+ *
65
+ * The listener belongs to the creating key (`owner.kind: key`): when that key is revoked or expires the
66
+ * listener ends `revoked`. One created from a sandbox belongs to the key that created the sandbox and also
67
+ * ends when the sandbox's root sandbox ends.
68
+ *
69
+ * `POST /v1/listeners` · scope `listeners:write` · served by the node
70
+ */
71
+ createListener(body: T.ListenerCreateRequest, options?: RequestOptions): APIPromise<T.Listener>;
72
+ /**
73
+ * Delete a listener
74
+ *
75
+ * Closes the source and stops delivery at once; an event already handed to its sink is not recalled. The
76
+ * event history stays readable for its 7 days through `GET /v1/listeners/{listener_id}/events` and is then
77
+ * deleted.
78
+ *
79
+ * `DELETE /v1/listeners/{listener_id}` · scope `listeners:write` · served by the node
80
+ */
81
+ deleteListener(listenerId: string, options?: RequestOptions): APIPromise<T.Deleted>;
82
+ /**
83
+ * Get a listener
84
+ *
85
+ * Returns one of this project's listeners: its status, the source's state (cursor, connected since, next
86
+ * attempt), the budget in force and what it used today (UTC), and its counters.
87
+ *
88
+ * `GET /v1/listeners/{listener_id}` · scope `listeners:read` · served by the node
89
+ */
90
+ getListener(listenerId: string, options?: RequestOptions): APIPromise<T.Listener>;
91
+ /**
92
+ * Change, pause or resume a listener
93
+ *
94
+ * Changes the lifetime (`ttl_s` counts from now; `expires_at: null` removes it), the filter, the sink, the
95
+ * budget, `redact` and `metadata`. `paused: true` closes the source and stops delivery, keeping the cursor;
96
+ * `false` opens it again where it stopped. A listener paused by its budget resumes by itself when the UTC day
97
+ * ends, or now if the PATCH raises the budget above what it used. The source cannot change: create a new
98
+ * listener. A new filter or `redact` applies to events received after the answer. A listener that ended
99
+ * (`failed`, `expired`, `revoked`) answers `409 listener_not_active`, except that a `failed` one can be
100
+ * resumed with `paused: false`, which starts its source again.
101
+ *
102
+ * `PATCH /v1/listeners/{listener_id}` · scope `listeners:write` · served by the node
103
+ */
104
+ updateListener(listenerId: string, body: T.ListenerUpdateRequest, options?: RequestOptions): APIPromise<T.Listener>;
105
+ /**
106
+ * List a listener's events
107
+ *
108
+ * The listener's history, newest first: every event it kept (duplicates within the dedupe window are only
109
+ * counted, in `stats.duplicates`) with its payload, the filter's verdict, its status and its delivery, and a
110
+ * `gap` record for each time the source was down with events possibly missed. Kept 7 days. Payloads larger
111
+ * than 64 KiB are cut to their first 64 KiB with `payload_truncated: true`. Values at the listener's `redact`
112
+ * paths read `"[redacted]"`.
113
+ *
114
+ * `GET /v1/listeners/{listener_id}/events` · scope `listeners:read` · served by the node
115
+ */
116
+ listEvents(listenerId: string, params?: T.ListenersListEventsParams, options?: RequestOptions): ListPromise<T.ListenerEventList, T.ListenerEvent>;
117
+ /**
118
+ * Send events to a push listener
119
+ *
120
+ * Sends up to 100 events to a listener whose source is `push`. Each goes through dedupe (its `dedupe_key`, or
121
+ * the listener's `dedupe.key` expression, or a hash of the payload), the filter and the sink, as an event from
122
+ * any other source would. The answer comes once every event is in the listener's log (`202`); delivery
123
+ * follows. A listener of another source type answers `409 listener_wrong_source`; one that is not active,
124
+ * `409 listener_not_active`; one whose backlog is full, `429 listener_backlog_full` with `Retry-After`.
125
+ * Code in a sandbox calls it at `B3OS_API_URL` when its grant holds `listeners:write`.
126
+ *
127
+ * `POST /v1/listeners/{listener_id}/events` · scope `listeners:write` · served by the node
128
+ */
129
+ ingestEvents(listenerId: string, body: T.ListenerIngestRequest, options?: RequestOptions): APIPromise<T.ListenerIngestResult>;
130
+ /**
131
+ * Deliver an event again
132
+ *
133
+ * Hands a kept event (`delivered` or `failed`) to the sink again, with the same `dedupe_key`, so a sink that
134
+ * already has it can drop it. The filter does not run again. The answer is the event, `pending`.
135
+ *
136
+ * `POST /v1/listeners/{listener_id}/events/{event_id}/redeliver` · scope `listeners:write` · served by the node
137
+ */
138
+ redeliverEvent(listenerId: string, eventId: string, options?: RequestOptions): APIPromise<T.ListenerEvent>;
139
+ /**
140
+ * Stream a listener's events
141
+ *
142
+ * Server-sent events as the listener keeps events, records gaps and changes status. Reconnect with
143
+ * `Last-Event-ID` (the `seq` of the last frame you read) to resume: frames still in the 7-day history are sent
144
+ * again from there. `: ping` every 15 seconds.
145
+ *
146
+ * `GET /v1/listeners/{listener_id}/stream` · scope `listeners:read` · served by the node
147
+ */
148
+ streamEvents(listenerId: string, options?: StreamOptions): EventStream<T.ListenerStreamFrame>;
149
+ /**
150
+ * Test a listener on a sample event
151
+ *
152
+ * Runs a sample payload through the listener's dedupe key and filter and returns what happened, without
153
+ * touching the dedupe window or the history. With `deliver: true` the sample, if the filter keeps it, is also
154
+ * written to the log and delivered like any event, marked `test: true` in the sink's copy.
155
+ *
156
+ * `POST /v1/listeners/{listener_id}/test` · scope `listeners:write` · served by the node
157
+ */
158
+ testListener(listenerId: string, body: T.ListenerTestRequest, options?: RequestOptions): APIPromise<T.ListenerTestResult>;
159
+ }
@@ -0,0 +1,260 @@
1
+ // Generated by packages/sdk/scripts/generate.mjs from packages/spec/dist. Do not edit; run `pnpm generate`.
2
+ import { Namespace } from "../../core/namespace.js";
3
+ const listListenersOp = {
4
+ id: "listenersListListeners",
5
+ method: "GET",
6
+ path: "/v1/listeners",
7
+ timeoutMs: 10000,
8
+ scope: "listeners:read",
9
+ };
10
+ const createListenerOp = {
11
+ id: "listenersCreateListener",
12
+ method: "POST",
13
+ path: "/v1/listeners",
14
+ body: "json",
15
+ idem: true,
16
+ timeoutMs: 15000,
17
+ scope: "listeners:write",
18
+ };
19
+ const deleteListenerOp = {
20
+ id: "listenersDeleteListener",
21
+ method: "DELETE",
22
+ path: "/v1/listeners/{listener_id}",
23
+ params: ["listener_id"],
24
+ timeoutMs: 10000,
25
+ scope: "listeners:write",
26
+ };
27
+ const getListenerOp = {
28
+ id: "listenersGetListener",
29
+ method: "GET",
30
+ path: "/v1/listeners/{listener_id}",
31
+ params: ["listener_id"],
32
+ timeoutMs: 10000,
33
+ scope: "listeners:read",
34
+ };
35
+ const updateListenerOp = {
36
+ id: "listenersUpdateListener",
37
+ method: "PATCH",
38
+ path: "/v1/listeners/{listener_id}",
39
+ params: ["listener_id"],
40
+ body: "json",
41
+ timeoutMs: 10000,
42
+ scope: "listeners:write",
43
+ };
44
+ const listEventsOp = {
45
+ id: "listenersListEvents",
46
+ method: "GET",
47
+ path: "/v1/listeners/{listener_id}/events",
48
+ params: ["listener_id"],
49
+ timeoutMs: 10000,
50
+ scope: "listeners:read",
51
+ };
52
+ const ingestEventsOp = {
53
+ id: "listenersIngestEvents",
54
+ method: "POST",
55
+ path: "/v1/listeners/{listener_id}/events",
56
+ params: ["listener_id"],
57
+ body: "json",
58
+ timeoutMs: 10000,
59
+ scope: "listeners:write",
60
+ };
61
+ const redeliverEventOp = {
62
+ id: "listenersRedeliverEvent",
63
+ method: "POST",
64
+ path: "/v1/listeners/{listener_id}/events/{event_id}/redeliver",
65
+ params: ["listener_id", "event_id"],
66
+ timeoutMs: 10000,
67
+ scope: "listeners:write",
68
+ };
69
+ const streamEventsOp = {
70
+ id: "listenersStreamEvents",
71
+ method: "GET",
72
+ path: "/v1/listeners/{listener_id}/stream",
73
+ params: ["listener_id"],
74
+ stream: "sse",
75
+ timeoutMs: 3600000,
76
+ scope: "listeners:read",
77
+ };
78
+ const testListenerOp = {
79
+ id: "listenersTestListener",
80
+ method: "POST",
81
+ path: "/v1/listeners/{listener_id}/test",
82
+ params: ["listener_id"],
83
+ body: "json",
84
+ timeoutMs: 10000,
85
+ scope: "listeners:write",
86
+ };
87
+ /** Descriptors of every listeners operation, keyed by method name (for tooling and custom clients). */
88
+ export const listenersOps = {
89
+ listListeners: listListenersOp,
90
+ createListener: createListenerOp,
91
+ deleteListener: deleteListenerOp,
92
+ getListener: getListenerOp,
93
+ updateListener: updateListenerOp,
94
+ listEvents: listEventsOp,
95
+ ingestEvents: ingestEventsOp,
96
+ redeliverEvent: redeliverEventOp,
97
+ streamEvents: streamEventsOp,
98
+ testListener: testListenerOp,
99
+ };
100
+ /**
101
+ * Persistent subscriptions: a polled, streamed or pushed source, a CEL filter and a routine or webhook sink (`/v1/listeners`).
102
+ */
103
+ export class ListenersAPI extends Namespace {
104
+ /**
105
+ * List listeners
106
+ *
107
+ * Lists this project's listeners, newest first, in every status. Deleted listeners are not listed.
108
+ *
109
+ * `GET /v1/listeners` · scope `listeners:read` · served by the node
110
+ */
111
+ listListeners(params, options) {
112
+ return this._client._list(listListenersOp, { query: params }, options);
113
+ }
114
+ /**
115
+ * Create a listener
116
+ *
117
+ * Validates the definition, compiles its CEL expressions and starts the source; the answer is `201` with the
118
+ * listener in status `starting`, and `active` follows once the first connect or poll succeeds. A source that
119
+ * cannot be reached does not fail the create: the listener goes `reconnecting` and retries with backoff, and
120
+ * after 24 hours of failures it ends `failed` with the reason in `error`.
121
+ *
122
+ * The routine named in a `routine` sink must exist in this project and needs `routines:run` on top of
123
+ * `listeners:write`; a `source.connection` needs `vault:run`, and the URL's host must be one of the
124
+ * connection's `hosts` (otherwise `422 listener_invalid`, reason `connection_host`). Without `ttl_s` or
125
+ * `expires_at` the listener lives until it is deleted. Without `budget.events_per_day` it gets the
126
+ * organization's share, `listeners.events.daily` divided by `listeners.active.max`; the object always shows the
127
+ * budget in force.
128
+ *
129
+ * A `filter.model` asks the small model one question about each event CEL kept, as the listener's owner, so it
130
+ * needs `infer:run` and bills infer tokens, within `budget.model_tokens_per_day`. The question is the system
131
+ * message and the event its own delimited user message; no tools are offered and the answer is parsed strictly.
132
+ * An event's content can still try to steer the model: at worst it makes the answer `true` for that event,
133
+ * which `budget.events_per_day` and `budget.model_tokens_per_day` bound, so do not rely on the model filter
134
+ * alone to keep untrusted events from a sink that acts on them. When the model cannot answer (an error, a
135
+ * timeout, output that does not parse, the token budget spent), `on_error` decides (`drop` by default, or
136
+ * `pass`), and the event's `filter.model` says what happened.
137
+ *
138
+ * A `pack` source is checked by the actions trigger manager at create (the trigger exists, `with` is valid,
139
+ * its connections are usable) and is held there as a trigger subscription the listener owns; it is removed
140
+ * when the listener is paused, deleted or ends.
141
+ *
142
+ * A `webhook` source's listener is `active` at once, and its answer carries `source.hook_id` and
143
+ * `source.hook_url` to give the provider; with the `b3os` scheme it also carries `source.secret`, which no
144
+ * later answer shows. A `verify.secret` connection needs `vault:run`. A `websocket` source is held by the
145
+ * node's socket holder; while that unit is down the listener stays `starting` or `reconnecting`.
146
+ *
147
+ * The listener belongs to the creating key (`owner.kind: key`): when that key is revoked or expires the
148
+ * listener ends `revoked`. One created from a sandbox belongs to the key that created the sandbox and also
149
+ * ends when the sandbox's root sandbox ends.
150
+ *
151
+ * `POST /v1/listeners` · scope `listeners:write` · served by the node
152
+ */
153
+ createListener(body, options) {
154
+ return this._client._call(createListenerOp, { body }, options);
155
+ }
156
+ /**
157
+ * Delete a listener
158
+ *
159
+ * Closes the source and stops delivery at once; an event already handed to its sink is not recalled. The
160
+ * event history stays readable for its 7 days through `GET /v1/listeners/{listener_id}/events` and is then
161
+ * deleted.
162
+ *
163
+ * `DELETE /v1/listeners/{listener_id}` · scope `listeners:write` · served by the node
164
+ */
165
+ deleteListener(listenerId, options) {
166
+ return this._client._call(deleteListenerOp, { path: [listenerId] }, options);
167
+ }
168
+ /**
169
+ * Get a listener
170
+ *
171
+ * Returns one of this project's listeners: its status, the source's state (cursor, connected since, next
172
+ * attempt), the budget in force and what it used today (UTC), and its counters.
173
+ *
174
+ * `GET /v1/listeners/{listener_id}` · scope `listeners:read` · served by the node
175
+ */
176
+ getListener(listenerId, options) {
177
+ return this._client._call(getListenerOp, { path: [listenerId] }, options);
178
+ }
179
+ /**
180
+ * Change, pause or resume a listener
181
+ *
182
+ * Changes the lifetime (`ttl_s` counts from now; `expires_at: null` removes it), the filter, the sink, the
183
+ * budget, `redact` and `metadata`. `paused: true` closes the source and stops delivery, keeping the cursor;
184
+ * `false` opens it again where it stopped. A listener paused by its budget resumes by itself when the UTC day
185
+ * ends, or now if the PATCH raises the budget above what it used. The source cannot change: create a new
186
+ * listener. A new filter or `redact` applies to events received after the answer. A listener that ended
187
+ * (`failed`, `expired`, `revoked`) answers `409 listener_not_active`, except that a `failed` one can be
188
+ * resumed with `paused: false`, which starts its source again.
189
+ *
190
+ * `PATCH /v1/listeners/{listener_id}` · scope `listeners:write` · served by the node
191
+ */
192
+ updateListener(listenerId, body, options) {
193
+ return this._client._call(updateListenerOp, { path: [listenerId], body }, options);
194
+ }
195
+ /**
196
+ * List a listener's events
197
+ *
198
+ * The listener's history, newest first: every event it kept (duplicates within the dedupe window are only
199
+ * counted, in `stats.duplicates`) with its payload, the filter's verdict, its status and its delivery, and a
200
+ * `gap` record for each time the source was down with events possibly missed. Kept 7 days. Payloads larger
201
+ * than 64 KiB are cut to their first 64 KiB with `payload_truncated: true`. Values at the listener's `redact`
202
+ * paths read `"[redacted]"`.
203
+ *
204
+ * `GET /v1/listeners/{listener_id}/events` · scope `listeners:read` · served by the node
205
+ */
206
+ listEvents(listenerId, params, options) {
207
+ return this._client._list(listEventsOp, { path: [listenerId], query: params }, options);
208
+ }
209
+ /**
210
+ * Send events to a push listener
211
+ *
212
+ * Sends up to 100 events to a listener whose source is `push`. Each goes through dedupe (its `dedupe_key`, or
213
+ * the listener's `dedupe.key` expression, or a hash of the payload), the filter and the sink, as an event from
214
+ * any other source would. The answer comes once every event is in the listener's log (`202`); delivery
215
+ * follows. A listener of another source type answers `409 listener_wrong_source`; one that is not active,
216
+ * `409 listener_not_active`; one whose backlog is full, `429 listener_backlog_full` with `Retry-After`.
217
+ * Code in a sandbox calls it at `B3OS_API_URL` when its grant holds `listeners:write`.
218
+ *
219
+ * `POST /v1/listeners/{listener_id}/events` · scope `listeners:write` · served by the node
220
+ */
221
+ ingestEvents(listenerId, body, options) {
222
+ return this._client._call(ingestEventsOp, { path: [listenerId], body }, options);
223
+ }
224
+ /**
225
+ * Deliver an event again
226
+ *
227
+ * Hands a kept event (`delivered` or `failed`) to the sink again, with the same `dedupe_key`, so a sink that
228
+ * already has it can drop it. The filter does not run again. The answer is the event, `pending`.
229
+ *
230
+ * `POST /v1/listeners/{listener_id}/events/{event_id}/redeliver` · scope `listeners:write` · served by the node
231
+ */
232
+ redeliverEvent(listenerId, eventId, options) {
233
+ return this._client._call(redeliverEventOp, { path: [listenerId, eventId] }, options);
234
+ }
235
+ /**
236
+ * Stream a listener's events
237
+ *
238
+ * Server-sent events as the listener keeps events, records gaps and changes status. Reconnect with
239
+ * `Last-Event-ID` (the `seq` of the last frame you read) to resume: frames still in the 7-day history are sent
240
+ * again from there. `: ping` every 15 seconds.
241
+ *
242
+ * `GET /v1/listeners/{listener_id}/stream` · scope `listeners:read` · served by the node
243
+ */
244
+ streamEvents(listenerId, options) {
245
+ return this._client._stream(streamEventsOp, { path: [listenerId] }, options, {});
246
+ }
247
+ /**
248
+ * Test a listener on a sample event
249
+ *
250
+ * Runs a sample payload through the listener's dedupe key and filter and returns what happened, without
251
+ * touching the dedupe window or the history. With `deliver: true` the sample, if the filter keeps it, is also
252
+ * written to the log and delivered like any event, marked `test: true` in the sink's copy.
253
+ *
254
+ * `POST /v1/listeners/{listener_id}/test` · scope `listeners:write` · served by the node
255
+ */
256
+ testListener(listenerId, body, options) {
257
+ return this._client._call(testListenerOp, { path: [listenerId], body }, options);
258
+ }
259
+ }
260
+ //# sourceMappingURL=listeners.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listeners.js","sourceRoot":"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YAAY,EACZ,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EACrC,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,YAAY,CACV,UAAkB,EAClB,IAA6B,EAC7B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAyB,cAAc,EAAE,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3G,CAAC;IAED;;;;;;;OAOG;IACH,cAAc,CAAC,UAAkB,EAAE,OAAe,EAAE,OAAwB;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAkB,gBAAgB,EAAE,EAAE,IAAI,EAAE,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IACzG,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,CAAC,UAAkB,EAAE,OAAuB;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAwB,cAAc,EAAE,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;IAC1G,CAAC;IAED;;;;;;;;OAQG;IACH,YAAY,CACV,UAAkB,EAClB,IAA2B,EAC3B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAuB,cAAc,EAAE,EAAE,IAAI,EAAE,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IACzG,CAAC;CACF"}
@@ -8,6 +8,7 @@ export declare const orgsOps: {
8
8
  readonly listOrgs: Op;
9
9
  readonly getOrg: Op;
10
10
  readonly listMembers: Op;
11
+ readonly getOrgSettings: Op;
11
12
  };
12
13
  /** Organizations and members (`/v1/orgs`; served by beta-api.b3os.org). */
13
14
  export declare class OrgsAPI extends Namespace {
@@ -35,4 +36,13 @@ export declare class OrgsAPI extends Namespace {
35
36
  * `GET /v1/orgs/{org_id}/members` · scope `platform:read` · served by beta-api.b3os.org
36
37
  */
37
38
  listMembers(orgId: string, params?: T.PlatformListMembersParams, options?: RequestOptions): ListPromise<T.MemberList, T.Member>;
39
+ /**
40
+ * List an organization's settings
41
+ *
42
+ * The settings stored for the organization, which apply to every project that sets nothing itself. Members
43
+ * and the organization's keys may read them.
44
+ *
45
+ * `GET /v1/orgs/{org_id}/settings` · scope `authenticated` · served by beta-api.b3os.org
46
+ */
47
+ getOrgSettings(orgId: string, options?: RequestOptions): APIPromise<T.StoredSettingList>;
38
48
  }
@@ -26,8 +26,22 @@ const listMembersOp = {
26
26
  timeoutMs: 10000,
27
27
  scope: "platform:read",
28
28
  };
29
+ const getOrgSettingsOp = {
30
+ id: "platformGetOrgSettings",
31
+ method: "GET",
32
+ path: "/v1/orgs/{org_id}/settings",
33
+ params: ["org_id"],
34
+ edge: true,
35
+ timeoutMs: 10000,
36
+ scope: "authenticated",
37
+ };
29
38
  /** Descriptors of every orgs operation, keyed by method name (for tooling and custom clients). */
30
- export const orgsOps = { listOrgs: listOrgsOp, getOrg: getOrgOp, listMembers: listMembersOp };
39
+ export const orgsOps = {
40
+ listOrgs: listOrgsOp,
41
+ getOrg: getOrgOp,
42
+ listMembers: listMembersOp,
43
+ getOrgSettings: getOrgSettingsOp,
44
+ };
31
45
  /** Organizations and members (`/v1/orgs`; served by beta-api.b3os.org). */
32
46
  export class OrgsAPI extends Namespace {
33
47
  /**
@@ -60,5 +74,16 @@ export class OrgsAPI extends Namespace {
60
74
  listMembers(orgId, params, options) {
61
75
  return this._client._list(listMembersOp, { path: [orgId], query: params }, options);
62
76
  }
77
+ /**
78
+ * List an organization's settings
79
+ *
80
+ * The settings stored for the organization, which apply to every project that sets nothing itself. Members
81
+ * and the organization's keys may read them.
82
+ *
83
+ * `GET /v1/orgs/{org_id}/settings` · scope `authenticated` · served by beta-api.b3os.org
84
+ */
85
+ getOrgSettings(orgId, options) {
86
+ return this._client._call(getOrgSettingsOp, { path: [orgId] }, options);
87
+ }
63
88
  }
64
89
  //# sourceMappingURL=orgs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"orgs.js","sourceRoot":"","sources":["../../../../src/generated/ns/orgs.ts"],"names":[],"mappings":"AAAA,4GAA4G;AAG5G,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKpD,MAAM,UAAU,GAAO;IACrB,EAAE,EAAE,kBAAkB;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,eAAe;CACvB,CAAC;AACF,MAAM,QAAQ,GAAO;IACnB,EAAE,EAAE,gBAAgB;IACpB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,mBAAmB;IACzB,MAAM,EAAE,CAAC,QAAQ,CAAC;IAClB,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,eAAe;CACvB,CAAC;AACF,MAAM,aAAa,GAAO;IACxB,EAAE,EAAE,qBAAqB;IACzB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,2BAA2B;IACjC,MAAM,EAAE,CAAC,QAAQ,CAAC;IAClB,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,eAAe;CACvB,CAAC;AAEF,kGAAkG;AAClG,MAAM,CAAC,MAAM,OAAO,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAW,CAAC;AAEvG,2EAA2E;AAC3E,MAAM,OAAO,OAAQ,SAAQ,SAAS;IACpC;;;;;;OAMG;IACH,QAAQ,CAAC,OAAwB;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAqB,UAAU,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CA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readonly updateProject: Op;
13
+ readonly getProjectSettings: Op;
14
+ readonly unsetProjectSetting: Op;
15
+ readonly setProjectSetting: Op;
13
16
  };
14
17
  /** Projects (`/v1/projects`; served by beta-api.b3os.org). */
15
18
  export declare class ProjectsAPI extends Namespace {
@@ -54,4 +57,33 @@ export declare class ProjectsAPI extends Namespace {
54
57
  * `PATCH /v1/projects/{project_id}` · scope `platform:write` · served by beta-api.b3os.org
55
58
  */
56
59
  updateProject(projectId: string, body: T.ProjectUpdateRequest, options?: RequestOptions): APIPromise<T.Project>;
60
+ /**
61
+ * List a project's settings
62
+ *
63
+ * The settings stored for the project, without inherited values (`GET /v1/settings` resolves those). Any valid
64
+ * credential may read its own project's; another project of the organization needs `platform:read`.
65
+ *
66
+ * `GET /v1/projects/{project_id}/settings` · scope `authenticated` · served by beta-api.b3os.org
67
+ */
68
+ getProjectSettings(projectId: string, options?: RequestOptions): APIPromise<T.StoredSettingList>;
69
+ /**
70
+ * Unset a project setting
71
+ *
72
+ * Removes the project's own value, so the organization's or the default applies again. Who may call it is as
73
+ * for setting it. Unsetting an option the project does not set succeeds too.
74
+ *
75
+ * `DELETE /v1/projects/{project_id}/settings/{option}` · scope `authenticated` · served by beta-api.b3os.org
76
+ */
77
+ unsetProjectSetting(projectId: string, option: string, options?: RequestOptions): APIPromise<T.Deleted>;
78
+ /**
79
+ * Set a project setting
80
+ *
81
+ * Sets `option` for the project. A credential with `settings:write` sets its own project's; `platform:write`
82
+ * sets any project's in the organization. The value must be one the option serves: an unknown option or a
83
+ * value outside its catalog is `422 invalid_option`, a reserved value `422 option_not_allowed`. Nodes apply
84
+ * it within a few seconds; work already running keeps what it started with.
85
+ *
86
+ * `PUT /v1/projects/{project_id}/settings/{option}` · scope `authenticated` · served by beta-api.b3os.org
87
+ */
88
+ setProjectSetting(projectId: string, option: string, body: T.SettingRequest, options?: RequestOptions): APIPromise<T.StoredSetting>;
57
89
  }
@@ -46,6 +46,34 @@ const updateProjectOp = {
46
46
  timeoutMs: 10000,
47
47
  scope: "platform:write",
48
48
  };
49
+ const getProjectSettingsOp = {
50
+ id: "platformGetProjectSettings",
51
+ method: "GET",
52
+ path: "/v1/projects/{project_id}/settings",
53
+ params: ["project_id"],
54
+ edge: true,
55
+ timeoutMs: 10000,
56
+ scope: "authenticated",
57
+ };
58
+ const unsetProjectSettingOp = {
59
+ id: "platformUnsetProjectSetting",
60
+ method: "DELETE",
61
+ path: "/v1/projects/{project_id}/settings/{option}",
62
+ params: ["project_id", "option"],
63
+ edge: true,
64
+ timeoutMs: 10000,
65
+ scope: "authenticated",
66
+ };
67
+ const setProjectSettingOp = {
68
+ id: "platformSetProjectSetting",
69
+ method: "PUT",
70
+ path: "/v1/projects/{project_id}/settings/{option}",
71
+ params: ["project_id", "option"],
72
+ body: "json",
73
+ edge: true,
74
+ timeoutMs: 10000,
75
+ scope: "authenticated",
76
+ };
49
77
  /** Descriptors of every projects operation, keyed by method name (for tooling and custom clients). */
50
78
  export const projectsOps = {
51
79
  listProjects: listProjectsOp,
@@ -53,6 +81,9 @@ export const projectsOps = {
53
81
  deleteProject: deleteProjectOp,
54
82
  getProject: getProjectOp,
55
83
  updateProject: updateProjectOp,
84
+ getProjectSettings: getProjectSettingsOp,
85
+ unsetProjectSetting: unsetProjectSettingOp,
86
+ setProjectSetting: setProjectSettingOp,
56
87
  };
57
88
  /** Projects (`/v1/projects`; served by beta-api.b3os.org). */
58
89
  export class ProjectsAPI extends Namespace {
@@ -107,5 +138,40 @@ export class ProjectsAPI extends Namespace {
107
138
  updateProject(projectId, body, options) {
108
139
  return this._client._call(updateProjectOp, { path: [projectId], body }, options);
109
140
  }
141
+ /**
142
+ * List a project's settings
143
+ *
144
+ * The settings stored for the project, without inherited values (`GET /v1/settings` resolves those). Any valid
145
+ * credential may read its own project's; another project of the organization needs `platform:read`.
146
+ *
147
+ * `GET /v1/projects/{project_id}/settings` · scope `authenticated` · served by beta-api.b3os.org
148
+ */
149
+ getProjectSettings(projectId, options) {
150
+ return this._client._call(getProjectSettingsOp, { path: [projectId] }, options);
151
+ }
152
+ /**
153
+ * Unset a project setting
154
+ *
155
+ * Removes the project's own value, so the organization's or the default applies again. Who may call it is as
156
+ * for setting it. Unsetting an option the project does not set succeeds too.
157
+ *
158
+ * `DELETE /v1/projects/{project_id}/settings/{option}` · scope `authenticated` · served by beta-api.b3os.org
159
+ */
160
+ unsetProjectSetting(projectId, option, options) {
161
+ return this._client._call(unsetProjectSettingOp, { path: [projectId, option] }, options);
162
+ }
163
+ /**
164
+ * Set a project setting
165
+ *
166
+ * Sets `option` for the project. A credential with `settings:write` sets its own project's; `platform:write`
167
+ * sets any project's in the organization. The value must be one the option serves: an unknown option or a
168
+ * value outside its catalog is `422 invalid_option`, a reserved value `422 option_not_allowed`. Nodes apply
169
+ * it within a few seconds; work already running keeps what it started with.
170
+ *
171
+ * `PUT /v1/projects/{project_id}/settings/{option}` · scope `authenticated` · served by beta-api.b3os.org
172
+ */
173
+ setProjectSetting(projectId, option, body, options) {
174
+ return this._client._call(setProjectSettingOp, { path: [projectId, option], body }, options);
175
+ }
110
176
  }
111
177
  //# sourceMappingURL=projects.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"projects.js","sourceRoot":"","sources":["../../../../src/generated/ns/projects.ts"],"names":[],"mappings":"AAAA,4GAA4G;AAG5G,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAKpD,MAAM,cAAc,GAAO;IACzB,EAAE,EAAE,sBAAsB;IAC1B,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,eAAe;CACvB,CAAC;AACF,MAAM,eAAe,GAAO;IAC1B,EAAE,EAAE,uBAAuB;IAC3B,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,KAAK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