@cosmicdrift/kumiko-types 0.327.0 → 0.328.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.
Files changed (174) hide show
  1. package/dist/action-icon.d.ts +3 -0
  2. package/dist/action-icon.js +51 -0
  3. package/{src/agent-exposure.ts → dist/agent-exposure.d.ts} +8 -15
  4. package/dist/agent-exposure.js +16 -0
  5. package/dist/concurrency-mode.d.ts +1 -0
  6. package/dist/config-scope.d.ts +1 -0
  7. package/dist/config-scope.js +1 -0
  8. package/dist/config.d.ts +234 -0
  9. package/dist/config.js +1 -0
  10. package/dist/cursor-types.d.ts +16 -0
  11. package/dist/cursor-types.js +1 -0
  12. package/dist/db-connection.d.ts +14 -0
  13. package/dist/db-connection.js +1 -0
  14. package/dist/define-handler.d.ts +58 -0
  15. package/dist/define-handler.js +1 -0
  16. package/dist/derivatives-types.d.ts +53 -0
  17. package/dist/derivatives-types.js +3 -0
  18. package/dist/entity-cache.d.ts +16 -0
  19. package/dist/entity-cache.js +1 -0
  20. package/dist/entity-handlers.d.ts +54 -0
  21. package/dist/entity-handlers.js +1 -0
  22. package/dist/entity-table-meta-types.d.ts +44 -0
  23. package/dist/entity-table-meta-types.js +6 -0
  24. package/dist/envelope-cipher-types.d.ts +5 -0
  25. package/dist/envelope-cipher-types.js +1 -0
  26. package/dist/event-store-executor-types.d.ts +86 -0
  27. package/dist/event-store-executor-types.js +1 -0
  28. package/dist/event-store-types.d.ts +37 -0
  29. package/dist/event-store-types.js +7 -0
  30. package/dist/event-type-map.d.ts +8 -0
  31. package/{src/event-type-map.ts → dist/event-type-map.js} +1 -16
  32. package/dist/executor-brand.d.ts +8 -0
  33. package/dist/executor-brand.js +1 -0
  34. package/dist/extension-options-map.d.ts +9 -0
  35. package/dist/extension-options-map.js +4 -0
  36. package/dist/feature.d.ts +518 -0
  37. package/dist/feature.js +1 -0
  38. package/dist/field-icon.d.ts +1 -0
  39. package/dist/field-icon.js +1 -0
  40. package/dist/fields.d.ts +729 -0
  41. package/dist/fields.js +50 -0
  42. package/dist/file-handle-types.d.ts +12 -0
  43. package/dist/file-handle-types.js +1 -0
  44. package/dist/file-provider-resolver-types.d.ts +3 -0
  45. package/dist/file-provider-resolver-types.js +1 -0
  46. package/dist/file-storage-provider-types.d.ts +17 -0
  47. package/dist/file-storage-provider-types.js +1 -0
  48. package/dist/geo-tz.d.ts +17 -0
  49. package/{src/geo-tz.ts → dist/geo-tz.js} +1 -20
  50. package/dist/handlers.d.ts +493 -0
  51. package/dist/handlers.js +49 -0
  52. package/dist/hook-phase.d.ts +1 -0
  53. package/dist/hook-phase.js +1 -0
  54. package/dist/hooks.d.ts +75 -0
  55. package/dist/hooks.js +1 -0
  56. package/dist/http-route.d.ts +52 -0
  57. package/dist/http-route.js +13 -0
  58. package/dist/identifiers.d.ts +8 -0
  59. package/{src/identifiers.ts → dist/identifiers.js} +7 -24
  60. package/dist/index.d.ts +1 -0
  61. package/dist/index.js +1 -0
  62. package/dist/kms-adapter-types.d.ts +68 -0
  63. package/dist/kms-adapter-types.js +49 -0
  64. package/dist/logger.d.ts +7 -0
  65. package/dist/logger.js +1 -0
  66. package/dist/multi-stream-apply-context-types.d.ts +18 -0
  67. package/dist/multi-stream-apply-context-types.js +1 -0
  68. package/dist/nav-icon.d.ts +3 -0
  69. package/dist/nav-icon.js +100 -0
  70. package/dist/nav.d.ts +39 -0
  71. package/dist/nav.js +1 -0
  72. package/dist/observability/index.d.ts +3 -0
  73. package/dist/observability/index.js +2 -0
  74. package/dist/observability/metric.d.ts +34 -0
  75. package/dist/observability/metric.js +3 -0
  76. package/dist/observability/provider.d.ts +24 -0
  77. package/dist/observability/provider.js +4 -0
  78. package/dist/observability/span.d.ts +32 -0
  79. package/dist/observability/span.js +4 -0
  80. package/dist/ownership.d.ts +33 -0
  81. package/dist/ownership.js +5 -0
  82. package/dist/projection.d.ts +38 -0
  83. package/dist/projection.js +1 -0
  84. package/dist/rate-limit-types.d.ts +19 -0
  85. package/dist/rate-limit-types.js +1 -0
  86. package/dist/relations.d.ts +25 -0
  87. package/dist/relations.js +1 -0
  88. package/dist/schema-table-types.d.ts +15 -0
  89. package/{src/schema-table-types.ts → dist/schema-table-types.js} +0 -20
  90. package/dist/screen.d.ts +1265 -0
  91. package/dist/screen.js +3 -0
  92. package/dist/search-adapter.d.ts +32 -0
  93. package/dist/search-adapter.js +1 -0
  94. package/dist/secrets-types.d.ts +52 -0
  95. package/dist/secrets-types.js +30 -0
  96. package/dist/snapshot-types.d.ts +13 -0
  97. package/dist/snapshot-types.js +1 -0
  98. package/dist/step.d.ts +304 -0
  99. package/dist/step.js +11 -0
  100. package/dist/target-ref.d.ts +5 -0
  101. package/{src/target-ref.ts → dist/target-ref.js} +1 -6
  102. package/dist/tenancy-brand.d.ts +6 -0
  103. package/dist/tenancy-brand.js +1 -0
  104. package/dist/tenant-db-types.d.ts +67 -0
  105. package/dist/tenant-db-types.js +5 -0
  106. package/dist/tree-node.d.ts +26 -0
  107. package/dist/tree-node.js +22 -0
  108. package/dist/tz-context.d.ts +48 -0
  109. package/dist/tz-context.js +6 -0
  110. package/dist/websocket-route.d.ts +46 -0
  111. package/dist/websocket-route.js +10 -0
  112. package/dist/where-clause-types.d.ts +20 -0
  113. package/dist/where-clause-types.js +1 -0
  114. package/dist/workspace.d.ts +10 -0
  115. package/dist/workspace.js +1 -0
  116. package/dist/write-error-info-types.d.ts +12 -0
  117. package/dist/write-error-info-types.js +1 -0
  118. package/package.json +360 -121
  119. package/src/changes.json +12 -0
  120. package/src/__tests__/handlers.test.ts +0 -40
  121. package/src/__tests__/plural-forms.test.ts +0 -18
  122. package/src/action-icon.ts +0 -57
  123. package/src/concurrency-mode.ts +0 -5
  124. package/src/config-scope.ts +0 -5
  125. package/src/config.ts +0 -563
  126. package/src/cursor-types.ts +0 -18
  127. package/src/db-connection.ts +0 -25
  128. package/src/define-handler.ts +0 -138
  129. package/src/derivatives-types.ts +0 -106
  130. package/src/entity-cache.ts +0 -35
  131. package/src/entity-handlers.ts +0 -68
  132. package/src/entity-table-meta-types.ts +0 -101
  133. package/src/envelope-cipher-types.ts +0 -6
  134. package/src/event-store-executor-types.ts +0 -163
  135. package/src/event-store-types.ts +0 -85
  136. package/src/executor-brand.ts +0 -19
  137. package/src/extension-options-map.ts +0 -21
  138. package/src/feature.ts +0 -1141
  139. package/src/field-icon.ts +0 -23
  140. package/src/fields.ts +0 -1114
  141. package/src/file-handle-types.ts +0 -20
  142. package/src/file-provider-resolver-types.ts +0 -7
  143. package/src/file-storage-provider-types.ts +0 -54
  144. package/src/handlers.ts +0 -1246
  145. package/src/hook-phase.ts +0 -2
  146. package/src/hooks.ts +0 -170
  147. package/src/http-route.ts +0 -78
  148. package/src/kms-adapter-types.ts +0 -128
  149. package/src/logger.ts +0 -7
  150. package/src/multi-stream-apply-context-types.ts +0 -52
  151. package/src/nav-icon.ts +0 -105
  152. package/src/nav.ts +0 -139
  153. package/src/observability/index.ts +0 -28
  154. package/src/observability/metric.ts +0 -56
  155. package/src/observability/provider.ts +0 -32
  156. package/src/observability/span.ts +0 -58
  157. package/src/ownership.ts +0 -83
  158. package/src/projection.ts +0 -170
  159. package/src/rate-limit-types.ts +0 -32
  160. package/src/relations.ts +0 -52
  161. package/src/screen.ts +0 -1593
  162. package/src/search-adapter.ts +0 -45
  163. package/src/secrets-types.ts +0 -182
  164. package/src/snapshot-types.ts +0 -36
  165. package/src/step.ts +0 -390
  166. package/src/tenancy-brand.ts +0 -9
  167. package/src/tenant-db-types.ts +0 -116
  168. package/src/tree-node.ts +0 -134
  169. package/src/tz-context.ts +0 -63
  170. package/src/websocket-route.ts +0 -68
  171. package/src/where-clause-types.ts +0 -31
  172. package/src/workspace.ts +0 -42
  173. package/src/write-error-info-types.ts +0 -20
  174. /package/{src/index.ts → dist/concurrency-mode.js} +0 -0
@@ -0,0 +1,6 @@
1
+ // TzContext — the type contract for ctx.tz (pure types; the factory lives in
2
+ // @cosmicdrift/kumiko-framework, time/tz-context.ts).
3
+ //
4
+ // `Temporal` here is the ambient global from TypeScript's lib
5
+ // (lib.esnext.temporal) — at runtime the framework installs the polyfill.
6
+ export {};
@@ -0,0 +1,46 @@
1
+ import type { Context } from "hono";
2
+ import type { SessionUser, WriteResult } from "./handlers.js";
3
+ export declare const WEBSOCKET_MAX_PAYLOAD_BYTES: number;
4
+ export declare const WEBSOCKET_DEFAULT_MAX_MESSAGE_BYTES: number;
5
+ export declare const WEBSOCKET_ROUTE_PATH_PREFIX = "/api/ws/";
6
+ export declare const WEBSOCKET_BACKPRESSURE_LIMIT_BYTES: number;
7
+ export declare const WEBSOCKET_DEFAULT_MAX_CONNECTIONS_PER_USER = 5;
8
+ export declare const WEBSOCKET_MAX_CONNECTIONS_PER_USER_LIMIT = 100;
9
+ export type WebSocketMessageData = string | Uint8Array;
10
+ export type WebSocketConnection = {
11
+ readonly send: (data: WebSocketMessageData) => void;
12
+ readonly close: (code?: number, reason?: string) => void;
13
+ /**
14
+ * Aborts when the socket closes. onClose can run while onOpen/onMessage is
15
+ * still awaiting, so after any await that allocates (e.g. an upstream
16
+ * session), check `signal.aborted` and release it yourself.
17
+ */
18
+ readonly signal: AbortSignal;
19
+ };
20
+ export type WebSocketSessionHandlers = {
21
+ /** May still be awaiting when onClose runs; see `WebSocketConnection.signal`. */
22
+ readonly onOpen?: (connection: WebSocketConnection) => void | Promise<void>;
23
+ readonly onMessage?: (data: WebSocketMessageData, connection: WebSocketConnection) => void | Promise<void>;
24
+ /** Runs immediately on close, not queued behind a slow onMessage; pending messages never start after it. */
25
+ readonly onClose?: (code: number, reason: string, connection: WebSocketConnection) => void | Promise<void>;
26
+ };
27
+ export type WebSocketRouteConnectDeps = {
28
+ readonly user: SessionUser;
29
+ readonly query: (type: string, payload: unknown) => Promise<unknown>;
30
+ readonly write: (type: string, payload: unknown) => Promise<WriteResult>;
31
+ /** Resolved via the server's trustedProxyHops-aware resolver, like HttpRouteHandlerDeps.clientIp. */
32
+ readonly clientIp: string;
33
+ };
34
+ export type WebSocketRouteDefinition = {
35
+ /** Must start with "/api/ws/"; `:param` segments allowed, no "*". */
36
+ readonly path: string;
37
+ /** Per-message cap; oversized messages close the socket with 1009. Default 64 KiB, max 1 MiB. */
38
+ readonly maxMessageBytes?: number;
39
+ /** Concurrent sockets per user and tenant on this route (per server process). Default 5, max 100; above it the upgrade gets 429. */
40
+ readonly maxConnectionsPerUser?: number;
41
+ /**
42
+ * Runs after auth + origin checks, before the upgrade. Returning a Response rejects the upgrade with it.
43
+ * Allocate per-connection resources in `onOpen`, not here: if the upgrade then fails, no `onClose` runs.
44
+ */
45
+ readonly connect: (c: Context<any, any>, deps: WebSocketRouteConnectDeps) => WebSocketSessionHandlers | Response | Promise<WebSocketSessionHandlers | Response>;
46
+ };
@@ -0,0 +1,10 @@
1
+ // WebSocket route definition — feature-declared WebSocket endpoints under
2
+ // /api/ws/*. Auth (session + origin) runs before the upgrade; `connect`
3
+ // then returns the per-connection handlers or a Response that rejects it.
4
+ export const WEBSOCKET_MAX_PAYLOAD_BYTES = 1024 * 1024;
5
+ export const WEBSOCKET_DEFAULT_MAX_MESSAGE_BYTES = 64 * 1024;
6
+ export const WEBSOCKET_ROUTE_PATH_PREFIX = "/api/ws/";
7
+ // Bun closes a socket whose unsent outbound queue exceeds this (slow or stalled reader).
8
+ export const WEBSOCKET_BACKPRESSURE_LIMIT_BYTES = 4 * 1024 * 1024;
9
+ export const WEBSOCKET_DEFAULT_MAX_CONNECTIONS_PER_USER = 5;
10
+ export const WEBSOCKET_MAX_CONNECTIONS_PER_USER_LIMIT = 100;
@@ -0,0 +1,20 @@
1
+ export type WhereOperator = {
2
+ readonly gt?: unknown;
3
+ readonly gte?: unknown;
4
+ readonly lt?: unknown;
5
+ readonly lte?: unknown;
6
+ readonly ne?: unknown;
7
+ readonly in?: readonly unknown[];
8
+ readonly like?: string;
9
+ };
10
+ export type WherePrimitive = string | number | boolean | bigint | Date | null | undefined;
11
+ export type WhereValue = WherePrimitive | readonly WherePrimitive[] | WhereOperator;
12
+ export type WhereObject = Record<string, WhereValue | unknown>;
13
+ export type OrderByClause = {
14
+ readonly col: string;
15
+ readonly direction?: "asc" | "desc";
16
+ };
17
+ export type SelectOptions = {
18
+ readonly limit?: number;
19
+ readonly orderBy?: OrderByClause | readonly OrderByClause[];
20
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { AccessRule } from "./handlers.js";
2
+ export type WorkspaceDefinition = {
3
+ readonly id: string;
4
+ readonly label: string;
5
+ readonly icon?: string;
6
+ readonly order?: number;
7
+ readonly access?: AccessRule;
8
+ readonly nav?: readonly string[];
9
+ readonly default?: boolean;
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ export type WriteErrorInfo = {
2
+ readonly code: string;
3
+ readonly httpStatus: number;
4
+ readonly i18nKey: string;
5
+ readonly i18nParams?: Readonly<Record<string, unknown>>;
6
+ readonly message: string;
7
+ readonly details?: unknown;
8
+ };
9
+ export type WriteFailure = {
10
+ readonly isSuccess: false;
11
+ readonly error: WriteErrorInfo;
12
+ };
@@ -0,0 +1 @@
1
+ export {};