@undefineds.co/models 0.1.1 → 0.2.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.
Files changed (228) hide show
  1. package/dist/agent.repository.d.ts +20 -40
  2. package/dist/agent.schema.d.ts +20 -1
  3. package/dist/agent.schema.js +25 -1
  4. package/dist/ai-config/index.d.ts +8 -6
  5. package/dist/ai-config/index.js +41 -23
  6. package/dist/ai-model.schema.d.ts +13 -1
  7. package/dist/ai-model.schema.js +17 -1
  8. package/dist/ai-provider.schema.d.ts +9 -1
  9. package/dist/ai-provider.schema.js +13 -1
  10. package/dist/approval.schema.d.ts +21 -1
  11. package/dist/approval.schema.js +33 -1
  12. package/dist/audit.schema.d.ts +17 -1
  13. package/dist/audit.schema.js +29 -1
  14. package/dist/chat.repository.d.ts +19 -15
  15. package/dist/chat.schema.d.ts +37 -1
  16. package/dist/chat.schema.js +47 -1
  17. package/dist/client/index.d.ts +121 -0
  18. package/dist/client/index.js +299 -0
  19. package/dist/contact.repository.d.ts +21 -21
  20. package/dist/contact.schema.d.ts +48 -1
  21. package/dist/contact.schema.js +60 -1
  22. package/dist/credential.schema.d.ts +15 -1
  23. package/dist/credential.schema.js +19 -1
  24. package/dist/discovery/index.d.ts +2 -2
  25. package/dist/discovery/index.js +2 -2
  26. package/dist/extension/extension.schema.d.ts +4 -1
  27. package/dist/extension/extension.schema.js +11 -1
  28. package/dist/extension/index.d.ts +1 -1
  29. package/dist/favorite/favorite.schema.d.ts +24 -1
  30. package/dist/favorite/favorite.schema.js +34 -1
  31. package/dist/favorite/index.d.ts +2 -2
  32. package/dist/file/file.schema.d.ts +39 -1
  33. package/dist/file/file.schema.js +51 -1
  34. package/dist/file/index.d.ts +1 -1
  35. package/dist/fixtures/contracts-chat-contact.d.ts +5 -5
  36. package/dist/fixtures/contracts-chat-contact.js +1 -1
  37. package/dist/grant.schema.d.ts +16 -1
  38. package/dist/grant.schema.js +29 -1
  39. package/dist/import/index.d.ts +1 -1
  40. package/dist/inbox-notification.schema.d.ts +9 -1
  41. package/dist/inbox-notification.schema.js +16 -1
  42. package/dist/index.d.ts +42 -40
  43. package/dist/index.js +20 -16
  44. package/dist/knowledge/index.d.ts +1 -1
  45. package/dist/knowledge/knowledge-folder.schema.d.ts +7 -1
  46. package/dist/knowledge/knowledge-folder.schema.js +6 -1
  47. package/dist/message.repository.d.ts +20 -20
  48. package/dist/message.schema.d.ts +32 -1
  49. package/dist/message.schema.js +47 -1
  50. package/dist/namespaces.d.ts +178 -1
  51. package/dist/namespaces.js +253 -1
  52. package/dist/profile.d.ts +22 -1
  53. package/dist/profile.js +88 -1
  54. package/dist/profile.repository.d.ts +105 -0
  55. package/dist/profile.repository.js +47 -0
  56. package/dist/profile.schema.d.ts +16 -0
  57. package/dist/{core/profile.js → profile.schema.js} +4 -4
  58. package/dist/repository.d.ts +49 -9
  59. package/dist/repository.js +49 -46
  60. package/dist/schema.d.ts +244 -1
  61. package/dist/schema.js +37 -1
  62. package/dist/session/index.d.ts +1 -1
  63. package/dist/session/index.js +1 -1
  64. package/dist/session/session.schema.d.ts +43 -1
  65. package/dist/session/session.schema.js +46 -1
  66. package/dist/session.repository.d.ts +61 -0
  67. package/dist/session.repository.js +8 -0
  68. package/dist/settings/index.d.ts +1 -1
  69. package/dist/settings/settings.schema.d.ts +49 -1
  70. package/dist/settings/settings.schema.js +63 -1
  71. package/dist/sidecar/persistence-mapping.d.ts +5 -5
  72. package/dist/sidecar/sidecar-events.d.ts +30 -30
  73. package/dist/thread.repository.d.ts +15 -19
  74. package/dist/thread.schema.d.ts +30 -1
  75. package/dist/thread.schema.js +39 -1
  76. package/dist/types/message-block.d.ts +1 -1
  77. package/dist/vocab/_namespaces.d.ts +1 -1
  78. package/dist/vocab/index.d.ts +5 -6
  79. package/dist/vocab/index.js +0 -1
  80. package/dist/vocab/message.vocab.js +1 -1
  81. package/dist/vocab/thread.vocab.d.ts +1 -2
  82. package/dist/vocab/thread.vocab.js +2 -3
  83. package/dist/watch/index.d.ts +226 -0
  84. package/dist/watch/index.js +1156 -0
  85. package/package.json +41 -31
  86. package/dist/_drizzle-solid/columns.d.ts +0 -37
  87. package/dist/_drizzle-solid/columns.js +0 -1
  88. package/dist/_drizzle-solid/pod-table.d.ts +0 -3
  89. package/dist/_drizzle-solid/pod-table.js +0 -1
  90. package/dist/_drizzle-solid/types.d.ts +0 -40
  91. package/dist/_drizzle-solid/types.js +0 -1
  92. package/dist/ai-config.d.ts +0 -1
  93. package/dist/ai-config.js +0 -1
  94. package/dist/chat.utils.d.ts +0 -3
  95. package/dist/chat.utils.js +0 -30
  96. package/dist/core/agent-provider.schema.d.ts +0 -1
  97. package/dist/core/agent-provider.schema.js +0 -1
  98. package/dist/core/agent-status.schema.d.ts +0 -12
  99. package/dist/core/agent-status.schema.js +0 -18
  100. package/dist/core/agent.schema.d.ts +0 -72
  101. package/dist/core/agent.schema.js +0 -38
  102. package/dist/core/ai-config.schema.d.ts +0 -11
  103. package/dist/core/ai-config.schema.js +0 -18
  104. package/dist/core/ai-model.schema.d.ts +0 -15
  105. package/dist/core/ai-model.schema.js +0 -21
  106. package/dist/core/ai-provider.schema.d.ts +0 -16
  107. package/dist/core/ai-provider.schema.js +0 -28
  108. package/dist/core/approval.schema.d.ts +0 -21
  109. package/dist/core/approval.schema.js +0 -33
  110. package/dist/core/audit.schema.d.ts +0 -17
  111. package/dist/core/audit.schema.js +0 -29
  112. package/dist/core/chat.schema.d.ts +0 -36
  113. package/dist/core/chat.schema.js +0 -45
  114. package/dist/core/contact.schema.d.ts +0 -47
  115. package/dist/core/contact.schema.js +0 -59
  116. package/dist/core/credential.schema.d.ts +0 -56
  117. package/dist/core/credential.schema.js +0 -40
  118. package/dist/core/extension/extension.schema.d.ts +0 -4
  119. package/dist/core/extension/extension.schema.js +0 -11
  120. package/dist/core/extension/index.d.ts +0 -1
  121. package/dist/core/extension/index.js +0 -1
  122. package/dist/core/extension.d.ts +0 -1
  123. package/dist/core/extension.js +0 -1
  124. package/dist/core/favorite/favorite.schema.d.ts +0 -24
  125. package/dist/core/favorite/favorite.schema.js +0 -34
  126. package/dist/core/favorite/index.d.ts +0 -1
  127. package/dist/core/favorite/index.js +0 -1
  128. package/dist/core/file/file.schema.d.ts +0 -39
  129. package/dist/core/file/file.schema.js +0 -51
  130. package/dist/core/file/index.d.ts +0 -1
  131. package/dist/core/file/index.js +0 -1
  132. package/dist/core/file.d.ts +0 -1
  133. package/dist/core/file.js +0 -1
  134. package/dist/core/grant.schema.d.ts +0 -16
  135. package/dist/core/grant.schema.js +0 -29
  136. package/dist/core/import/import-job.schema.d.ts +0 -5
  137. package/dist/core/import/import-job.schema.js +0 -5
  138. package/dist/core/import/index.d.ts +0 -1
  139. package/dist/core/import/index.js +0 -1
  140. package/dist/core/import.d.ts +0 -1
  141. package/dist/core/import.js +0 -1
  142. package/dist/core/inbox-notification.schema.d.ts +0 -9
  143. package/dist/core/inbox-notification.schema.js +0 -16
  144. package/dist/core/index.d.ts +0 -31
  145. package/dist/core/index.js +0 -32
  146. package/dist/core/knowledge/index.d.ts +0 -1
  147. package/dist/core/knowledge/index.js +0 -1
  148. package/dist/core/knowledge/knowledge-folder.schema.d.ts +0 -7
  149. package/dist/core/knowledge/knowledge-folder.schema.js +0 -6
  150. package/dist/core/knowledge.d.ts +0 -1
  151. package/dist/core/knowledge.js +0 -1
  152. package/dist/core/message.schema.d.ts +0 -33
  153. package/dist/core/message.schema.js +0 -49
  154. package/dist/core/namespaces.d.ts +0 -176
  155. package/dist/core/namespaces.js +0 -289
  156. package/dist/core/profile.d.ts +0 -16
  157. package/dist/core/schema.d.ts +0 -304
  158. package/dist/core/schema.js +0 -46
  159. package/dist/core/session/index.d.ts +0 -1
  160. package/dist/core/session/index.js +0 -1
  161. package/dist/core/session/session.schema.d.ts +0 -6
  162. package/dist/core/session/session.schema.js +0 -6
  163. package/dist/core/session.d.ts +0 -1
  164. package/dist/core/session.js +0 -1
  165. package/dist/core/settings/index.d.ts +0 -1
  166. package/dist/core/settings/index.js +0 -1
  167. package/dist/core/settings/settings.schema.d.ts +0 -49
  168. package/dist/core/settings/settings.schema.js +0 -63
  169. package/dist/core/settings.d.ts +0 -1
  170. package/dist/core/settings.js +0 -1
  171. package/dist/core/thread.schema.d.ts +0 -28
  172. package/dist/core/thread.schema.js +0 -36
  173. package/dist/core/types/collaboration-blocks.d.ts +0 -52
  174. package/dist/core/types/collaboration-blocks.js +0 -7
  175. package/dist/core/types/message-block.d.ts +0 -270
  176. package/dist/core/types/message-block.js +0 -125
  177. package/dist/core/vector-store.schema.d.ts +0 -25
  178. package/dist/core/vector-store.schema.js +0 -35
  179. package/dist/core/vocab/_namespaces.d.ts +0 -1
  180. package/dist/core/vocab/_namespaces.js +0 -3
  181. package/dist/core/vocab/chat.vocab.d.ts +0 -16
  182. package/dist/core/vocab/chat.vocab.js +0 -22
  183. package/dist/core/vocab/contact.vocab.d.ts +0 -21
  184. package/dist/core/vocab/contact.vocab.js +0 -22
  185. package/dist/core/vocab/index.d.ts +0 -6
  186. package/dist/core/vocab/index.js +0 -6
  187. package/dist/core/vocab/message.vocab.d.ts +0 -20
  188. package/dist/core/vocab/message.vocab.js +0 -24
  189. package/dist/core/vocab/sidecar.vocab.d.ts +0 -46
  190. package/dist/core/vocab/sidecar.vocab.js +0 -47
  191. package/dist/core/vocab/thread.vocab.d.ts +0 -11
  192. package/dist/core/vocab/thread.vocab.js +0 -14
  193. package/dist/core/vocab/workspace.vocab.d.ts +0 -12
  194. package/dist/core/vocab/workspace.vocab.js +0 -13
  195. package/dist/core/vocab.d.ts +0 -1
  196. package/dist/core/vocab.js +0 -1
  197. package/dist/core/workspace.schema.d.ts +0 -35
  198. package/dist/core/workspace.schema.js +0 -106
  199. package/dist/core.d.ts +0 -1
  200. package/dist/core.js +0 -1
  201. package/dist/discovery/vercel.d.ts +0 -25
  202. package/dist/discovery/vercel.js +0 -95
  203. package/dist/discovery.d.ts +0 -1
  204. package/dist/discovery.js +0 -1
  205. package/dist/extension.d.ts +0 -1
  206. package/dist/extension.js +0 -1
  207. package/dist/favorite.d.ts +0 -1
  208. package/dist/favorite.js +0 -1
  209. package/dist/file.d.ts +0 -1
  210. package/dist/file.js +0 -1
  211. package/dist/import.d.ts +0 -1
  212. package/dist/import.js +0 -1
  213. package/dist/knowledge.d.ts +0 -1
  214. package/dist/knowledge.js +0 -1
  215. package/dist/session.d.ts +0 -1
  216. package/dist/session.js +0 -1
  217. package/dist/settings.d.ts +0 -1
  218. package/dist/settings.js +0 -1
  219. package/dist/sidecar/index.d.ts +0 -2
  220. package/dist/sidecar/index.js +0 -2
  221. package/dist/vocab/workspace.vocab.d.ts +0 -12
  222. package/dist/vocab/workspace.vocab.js +0 -13
  223. package/dist/vocab.d.ts +0 -1
  224. package/dist/vocab.js +0 -1
  225. package/dist/workspace.repository.d.ts +0 -45
  226. package/dist/workspace.repository.js +0 -8
  227. package/dist/workspace.schema.d.ts +0 -1
  228. package/dist/workspace.schema.js +0 -1
@@ -1,20 +0,0 @@
1
- export declare const MessageVocab: {
2
- readonly thread: string;
3
- readonly chat: string;
4
- readonly maker: string;
5
- readonly role: string;
6
- readonly content: string;
7
- readonly richContent: string;
8
- readonly status: string;
9
- readonly replacedBy: string;
10
- readonly deletedAt: string;
11
- readonly createdAt: string;
12
- readonly updatedAt: string;
13
- readonly senderName: string;
14
- readonly senderAvatarUrl: string;
15
- readonly mentions: string;
16
- readonly replyTo: string;
17
- readonly routedBy: string;
18
- readonly routeTargetAgentId: string;
19
- readonly coordinationId: string;
20
- };
@@ -1,24 +0,0 @@
1
- import { DCTerms, FOAF, LINX_MSG, SCHEMA, SIOC, UDFS, WF } from '../namespaces.js';
2
- export const MessageVocab = {
3
- // Existing
4
- thread: SIOC.hasContainer,
5
- chat: WF.message,
6
- maker: FOAF.maker,
7
- role: UDFS.messageType,
8
- content: SIOC.content,
9
- richContent: SIOC.richContent,
10
- status: UDFS.messageStatus,
11
- replacedBy: DCTerms.isReplacedBy,
12
- deletedAt: SCHEMA.dateDeleted,
13
- createdAt: DCTerms.created,
14
- updatedAt: DCTerms.modified,
15
- // Group message extensions
16
- senderName: LINX_MSG.senderName,
17
- senderAvatarUrl: LINX_MSG.senderAvatarUrl,
18
- mentions: LINX_MSG.mentions,
19
- replyTo: LINX_MSG.replyTo,
20
- // Multi-AI routing
21
- routedBy: LINX_MSG.routedBy,
22
- routeTargetAgentId: LINX_MSG.routeTargetAgentId,
23
- coordinationId: LINX_MSG.coordinationId,
24
- };
@@ -1,46 +0,0 @@
1
- export declare const ApprovalVocab: {
2
- readonly session: string;
3
- readonly toolCallId: string;
4
- readonly toolName: string;
5
- readonly target: string;
6
- readonly action: string;
7
- readonly risk: string;
8
- readonly status: string;
9
- readonly assignedTo: string;
10
- readonly decisionBy: string;
11
- readonly decisionRole: string;
12
- readonly onBehalfOf: string;
13
- readonly reason: string;
14
- readonly policyVersion: string;
15
- readonly createdAt: string;
16
- readonly resolvedAt: string;
17
- };
18
- export declare const AuditVocab: {
19
- readonly action: string;
20
- readonly actor: string;
21
- readonly actorRole: string;
22
- readonly onBehalfOf: string;
23
- readonly session: string;
24
- readonly toolCallId: string;
25
- readonly approval: string;
26
- readonly context: string;
27
- readonly policy: string;
28
- readonly policyVersion: string;
29
- readonly createdAt: string;
30
- };
31
- export declare const GrantVocab: {
32
- readonly target: string;
33
- readonly action: string;
34
- readonly effect: string;
35
- readonly riskCeiling: string;
36
- readonly decisionBy: string;
37
- readonly decisionRole: string;
38
- readonly onBehalfOf: string;
39
- readonly createdAt: string;
40
- readonly revokedAt: string;
41
- };
42
- export declare const InboxNotificationVocab: {
43
- readonly actor: string;
44
- readonly object: string;
45
- readonly createdAt: string;
46
- };
@@ -1,47 +0,0 @@
1
- import { AS, DCTerms, ODRL, UDFS } from '../namespaces.js';
2
- export const ApprovalVocab = {
3
- session: UDFS.session,
4
- toolCallId: UDFS.toolCallId,
5
- toolName: UDFS.toolName,
6
- target: ODRL.target,
7
- action: ODRL.action,
8
- risk: UDFS.risk,
9
- status: UDFS.status,
10
- assignedTo: UDFS.assignedTo,
11
- decisionBy: UDFS.decisionBy,
12
- decisionRole: UDFS.decisionRole,
13
- onBehalfOf: UDFS.onBehalfOf,
14
- reason: UDFS.reason,
15
- policyVersion: UDFS.policyVersion,
16
- createdAt: DCTerms.created,
17
- resolvedAt: UDFS.resolvedAt,
18
- };
19
- export const AuditVocab = {
20
- action: UDFS.action,
21
- actor: UDFS.actor,
22
- actorRole: UDFS.actorRole,
23
- onBehalfOf: UDFS.onBehalfOf,
24
- session: UDFS.session,
25
- toolCallId: UDFS.toolCallId,
26
- approval: UDFS.approval,
27
- context: UDFS.context,
28
- policy: UDFS.policy,
29
- policyVersion: UDFS.policyVersion,
30
- createdAt: DCTerms.created,
31
- };
32
- export const GrantVocab = {
33
- target: ODRL.target,
34
- action: ODRL.action,
35
- effect: UDFS.effect,
36
- riskCeiling: UDFS.riskCeiling,
37
- decisionBy: UDFS.decisionBy,
38
- decisionRole: UDFS.decisionRole,
39
- onBehalfOf: UDFS.onBehalfOf,
40
- createdAt: DCTerms.created,
41
- revokedAt: UDFS.revokedAt,
42
- };
43
- export const InboxNotificationVocab = {
44
- actor: AS.actor,
45
- object: AS.object,
46
- createdAt: DCTerms.created,
47
- };
@@ -1,11 +0,0 @@
1
- export declare const ThreadVocab: {
2
- readonly chatId: string;
3
- readonly title: string;
4
- readonly starred: string;
5
- readonly status: string;
6
- readonly metadata: string;
7
- readonly createdAt: string;
8
- readonly updatedAt: string;
9
- readonly workspace: string;
10
- readonly type: string;
11
- };
@@ -1,14 +0,0 @@
1
- import { DCTerms, LINX_CHAT, SIOC, UDFS } from '../namespaces.js';
2
- export const ThreadVocab = {
3
- chatId: SIOC.has_parent,
4
- title: DCTerms.title,
5
- starred: UDFS.favorite,
6
- status: UDFS.status,
7
- metadata: UDFS.metadata,
8
- createdAt: DCTerms.created,
9
- updatedAt: DCTerms.modified,
10
- // Execution context: workspace container (Agent@workspace)
11
- workspace: LINX_CHAT.workspace,
12
- // Type marker (for SPARQL convenience)
13
- type: SIOC.Thread,
14
- };
@@ -1,12 +0,0 @@
1
- export declare const WorkspaceVocab: {
2
- readonly title: string;
3
- readonly workspaceType: string;
4
- readonly kind: string;
5
- readonly rootUri: string;
6
- readonly repoRootUri: string;
7
- readonly baseRef: string;
8
- readonly branch: string;
9
- readonly createdAt: string;
10
- readonly updatedAt: string;
11
- readonly type: string;
12
- };
@@ -1,13 +0,0 @@
1
- import { DCTerms, UDFS } from '../namespaces.js';
2
- export const WorkspaceVocab = {
3
- title: DCTerms.title,
4
- workspaceType: UDFS.workspaceType,
5
- kind: UDFS.workspaceKind,
6
- rootUri: UDFS.rootUri,
7
- repoRootUri: UDFS.repoRootUri,
8
- baseRef: UDFS.baseRef,
9
- branch: UDFS.branch,
10
- createdAt: DCTerms.created,
11
- updatedAt: DCTerms.modified,
12
- type: UDFS.Workspace,
13
- };
@@ -1 +0,0 @@
1
- export * from './vocab/index.js';
@@ -1 +0,0 @@
1
- export * from './vocab/index.js';
@@ -1,35 +0,0 @@
1
- export declare const WORKSPACE_TYPES: readonly ["pod", "local"];
2
- export type WorkspaceType = typeof WORKSPACE_TYPES[number];
3
- export declare const WORKSPACE_KINDS: readonly ["folder", "git", "worktree"];
4
- export type WorkspaceKind = typeof WORKSPACE_KINDS[number];
5
- /**
6
- * Workspace schema.
7
- *
8
- * Only Pod-backed workspace metadata is persisted here.
9
- * Local workspaces are addressed directly via `linx://{node-id}/path/to/root`.
10
- */
11
- export declare const workspaceTable: import("@undefineds.co/models/_drizzle-solid/pod-table").PodTableWithColumns<import("@undefineds.co/models/_drizzle-solid/types").ResolvedColumns<{
12
- id: import("@undefineds.co/models/_drizzle-solid/columns").PodStringColumn<false, false>;
13
- title: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, false, false>;
14
- workspaceType: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, true, true>;
15
- kind: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, true, true>;
16
- rootUri: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"uri", null, false, false>;
17
- repoRootUri: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"uri", null, false, false>;
18
- baseRef: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, false, false>;
19
- branch: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, false, false>;
20
- createdAt: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"datetime", null, true, true>;
21
- updatedAt: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"datetime", null, true, true>;
22
- }>>;
23
- export type WorkspaceRow = typeof workspaceTable.$inferSelect;
24
- export type WorkspaceInsert = typeof workspaceTable.$inferInsert;
25
- export type WorkspaceUpdate = typeof workspaceTable.$inferUpdate;
26
- export declare function getWorkspaceContainerPath(workspaceId: string): string;
27
- export declare function resolveWorkspaceContainerUri(podBaseUrl: string, workspaceId: string): string;
28
- export declare function parseWorkspaceIdFromContainerUri(workspaceUri?: string | null): string | null;
29
- export declare function normalizeLocalWorkspacePath(value?: string | null): string | undefined;
30
- export declare function buildLocalWorkspaceUri(nodeId: string, rootPath: string): string;
31
- export declare function isLocalWorkspaceUri(workspaceUri?: string | null): boolean;
32
- export declare function parseLocalWorkspaceUri(workspaceUri?: string | null): {
33
- nodeId: string;
34
- path: string;
35
- } | null;
@@ -1,106 +0,0 @@
1
- import { id, podTable, string, timestamp, uri } from '@undefineds.co/drizzle-solid';
2
- import { UDFS, DCTerms } from './namespaces.js';
3
- export const WORKSPACE_TYPES = ['pod', 'local'];
4
- export const WORKSPACE_KINDS = ['folder', 'git', 'worktree'];
5
- const URI_WITH_SLASHES = /^[a-zA-Z][a-zA-Z\d+.-]*:\/\//;
6
- const WINDOWS_PATH_PREFIX = /^[a-zA-Z]:[\\/]/;
7
- /**
8
- * Workspace schema.
9
- *
10
- * Only Pod-backed workspace metadata is persisted here.
11
- * Local workspaces are addressed directly via `linx://{node-id}/path/to/root`.
12
- */
13
- export const workspaceTable = podTable('workspace', {
14
- id: id('id'),
15
- title: string('title').predicate(DCTerms.title),
16
- workspaceType: string('workspaceType').predicate(UDFS.workspaceType).notNull().default('pod'),
17
- kind: string('kind').predicate(UDFS.workspaceKind).notNull().default('folder'),
18
- rootUri: uri('rootUri').predicate(UDFS.rootUri),
19
- repoRootUri: uri('repoRootUri').predicate(UDFS.repoRootUri),
20
- baseRef: string('baseRef').predicate(UDFS.baseRef),
21
- branch: string('branch').predicate(UDFS.branch),
22
- createdAt: timestamp('createdAt').predicate(DCTerms.created).notNull().defaultNow(),
23
- updatedAt: timestamp('updatedAt').predicate(DCTerms.modified).notNull().defaultNow(),
24
- }, {
25
- base: '/.data/workspaces/',
26
- sparqlEndpoint: '/.data/workspaces/-/sparql',
27
- type: UDFS.Workspace,
28
- namespace: UDFS,
29
- subjectTemplate: '{id}/index.ttl#this',
30
- });
31
- export function getWorkspaceContainerPath(workspaceId) {
32
- return `/.data/workspaces/${workspaceId}/`;
33
- }
34
- export function resolveWorkspaceContainerUri(podBaseUrl, workspaceId) {
35
- return `${podBaseUrl.replace(/\/$/, '')}${getWorkspaceContainerPath(workspaceId)}`;
36
- }
37
- export function parseWorkspaceIdFromContainerUri(workspaceUri) {
38
- if (!workspaceUri)
39
- return null;
40
- const match = workspaceUri.match(/\/\.data\/workspaces\/([^/]+)\/?$/);
41
- return match?.[1] ?? null;
42
- }
43
- export function normalizeLocalWorkspacePath(value) {
44
- const trimmed = value?.trim();
45
- if (!trimmed)
46
- return undefined;
47
- if (trimmed.startsWith('file://')) {
48
- try {
49
- const url = new URL(trimmed);
50
- const normalized = decodeURIComponent(url.pathname || '').replace(/\/{2,}/g, '/');
51
- return normalized.length > 1 ? normalized.replace(/\/$/, '') : normalized;
52
- }
53
- catch {
54
- return trimmed;
55
- }
56
- }
57
- if (trimmed.startsWith('linx://')) {
58
- return parseLocalWorkspaceUri(trimmed)?.path;
59
- }
60
- if (URI_WITH_SLASHES.test(trimmed)) {
61
- return trimmed;
62
- }
63
- if (WINDOWS_PATH_PREFIX.test(trimmed)) {
64
- return `/${trimmed.replace(/\\/g, '/')}`.replace(/\/{2,}/g, '/');
65
- }
66
- const normalized = trimmed.replace(/\\/g, '/').replace(/\/{2,}/g, '/');
67
- if (normalized.startsWith('/')) {
68
- return normalized.length > 1 ? normalized.replace(/\/$/, '') : normalized;
69
- }
70
- return `/${normalized.replace(/^\/+/, '')}`.replace(/\/$/, '');
71
- }
72
- export function buildLocalWorkspaceUri(nodeId, rootPath) {
73
- const normalizedNodeId = nodeId.trim();
74
- const normalizedPath = normalizeLocalWorkspacePath(rootPath);
75
- if (!normalizedNodeId) {
76
- throw new Error('nodeId is required for local workspace URIs.');
77
- }
78
- if (!normalizedPath) {
79
- throw new Error('rootPath is required for local workspace URIs.');
80
- }
81
- const encodedPath = normalizedPath
82
- .split('/')
83
- .filter(Boolean)
84
- .map((segment) => encodeURIComponent(segment))
85
- .join('/');
86
- return `linx://${encodeURIComponent(normalizedNodeId)}/${encodedPath}`;
87
- }
88
- export function isLocalWorkspaceUri(workspaceUri) {
89
- return typeof workspaceUri === 'string' && workspaceUri.startsWith('linx://');
90
- }
91
- export function parseLocalWorkspaceUri(workspaceUri) {
92
- if (!workspaceUri || !isLocalWorkspaceUri(workspaceUri))
93
- return null;
94
- try {
95
- const url = new URL(workspaceUri);
96
- const nodeId = decodeURIComponent(url.host);
97
- const path = decodeURIComponent(url.pathname || '').replace(/\/{2,}/g, '/');
98
- return {
99
- nodeId,
100
- path: path.length > 1 ? path.replace(/\/$/, '') : path,
101
- };
102
- }
103
- catch {
104
- return null;
105
- }
106
- }
package/dist/core.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './core/index.js';
package/dist/core.js DELETED
@@ -1 +0,0 @@
1
- export * from './core/index.js';
@@ -1,25 +0,0 @@
1
- import type { DiscoveryRegistry, ModelMetadata } from './types.js';
2
- export interface VercelModelPricing {
3
- input?: string;
4
- output?: string;
5
- }
6
- export interface VercelModelEntry {
7
- id: string;
8
- name?: string;
9
- description?: string;
10
- owned_by?: string;
11
- context_window?: number;
12
- max_tokens?: number;
13
- type?: string;
14
- tags?: string[];
15
- pricing?: VercelModelPricing;
16
- }
17
- export interface VercelModelCatalogResponse {
18
- object?: string;
19
- data?: VercelModelEntry[];
20
- }
21
- export declare const VERCEL_OWNER_PROVIDER_MAP: Record<string, string>;
22
- export declare function mapVercelOwnerToProviderId(owner?: string | null): string;
23
- export declare function normalizeVercelModelEntry(entry: VercelModelEntry, defaultModelIds?: Readonly<Record<string, string>>): ModelMetadata | null;
24
- export declare function mergeVercelModelsIntoDiscovery(currentModels: readonly ModelMetadata[], upstreamModels: readonly VercelModelEntry[], defaultModelIds?: Readonly<Record<string, string>>): ModelMetadata[];
25
- export declare function updateDiscoveryModelRegistry(currentRegistry: DiscoveryRegistry, upstreamCatalog: VercelModelCatalogResponse, updatedAt: string, defaultModelIds?: Readonly<Record<string, string>>): DiscoveryRegistry;
@@ -1,95 +0,0 @@
1
- export const VERCEL_OWNER_PROVIDER_MAP = {
2
- alibaba: 'qwen',
3
- anthropic: 'anthropic',
4
- deepseek: 'deepseek',
5
- google: 'google',
6
- minimax: 'minimax',
7
- mistral: 'mistral',
8
- moonshotai: 'moonshot',
9
- openai: 'openai',
10
- togetherai: 'together',
11
- xai: 'x-ai',
12
- zai: 'zhipu',
13
- };
14
- const DEFAULT_SYNCED_MODEL_TYPES = new Set(['language']);
15
- function toNumber(value) {
16
- if (typeof value !== 'string')
17
- return undefined;
18
- const parsed = Number(value);
19
- return Number.isFinite(parsed) ? parsed : undefined;
20
- }
21
- function normalizeCapabilities(entry) {
22
- const capabilities = new Set();
23
- const tags = new Set(entry.tags ?? []);
24
- if (entry.type === 'language') {
25
- capabilities.add('chat');
26
- }
27
- if (tags.has('vision') || tags.has('file-input')) {
28
- capabilities.add('vision');
29
- }
30
- if (tags.has('tool-use')) {
31
- capabilities.add('function-calling');
32
- }
33
- if (entry.type === 'language') {
34
- capabilities.add('streaming');
35
- }
36
- return Array.from(capabilities);
37
- }
38
- function compareModels(left, right) {
39
- if (left.provider !== right.provider) {
40
- return left.provider.localeCompare(right.provider);
41
- }
42
- if (Boolean(left.isDefault) !== Boolean(right.isDefault)) {
43
- return left.isDefault ? -1 : 1;
44
- }
45
- return left.id.localeCompare(right.id);
46
- }
47
- export function mapVercelOwnerToProviderId(owner) {
48
- if (!owner)
49
- return '';
50
- return VERCEL_OWNER_PROVIDER_MAP[owner] ?? '';
51
- }
52
- export function normalizeVercelModelEntry(entry, defaultModelIds = {}) {
53
- const provider = mapVercelOwnerToProviderId(entry.owned_by);
54
- if (!provider)
55
- return null;
56
- if (!entry.id || !DEFAULT_SYNCED_MODEL_TYPES.has(String(entry.type ?? 'language'))) {
57
- return null;
58
- }
59
- return {
60
- id: entry.id,
61
- provider,
62
- displayName: entry.name || entry.id,
63
- description: entry.description,
64
- contextLength: typeof entry.context_window === 'number' ? entry.context_window : undefined,
65
- maxOutputTokens: typeof entry.max_tokens === 'number' ? entry.max_tokens : undefined,
66
- capabilities: normalizeCapabilities(entry),
67
- pricing: {
68
- input: toNumber(entry.pricing?.input) ?? 0,
69
- output: toNumber(entry.pricing?.output) ?? 0,
70
- },
71
- isDefault: defaultModelIds[provider] === entry.id || undefined,
72
- };
73
- }
74
- export function mergeVercelModelsIntoDiscovery(currentModels, upstreamModels, defaultModelIds = {}) {
75
- const syncedProviderIds = new Set(upstreamModels
76
- .map((entry) => mapVercelOwnerToProviderId(entry.owned_by))
77
- .filter(Boolean));
78
- const preservedModels = currentModels.filter((model) => !syncedProviderIds.has(model.provider));
79
- const normalizedModels = upstreamModels
80
- .map((entry) => normalizeVercelModelEntry(entry, defaultModelIds))
81
- .filter((model) => Boolean(model));
82
- const deduped = new Map();
83
- for (const model of [...preservedModels, ...normalizedModels]) {
84
- deduped.set(`${model.provider}:${model.id}`, model);
85
- }
86
- return Array.from(deduped.values()).sort(compareModels);
87
- }
88
- export function updateDiscoveryModelRegistry(currentRegistry, upstreamCatalog, updatedAt, defaultModelIds = {}) {
89
- const upstreamModels = Array.isArray(upstreamCatalog.data) ? upstreamCatalog.data : [];
90
- return {
91
- ...currentRegistry,
92
- updatedAt,
93
- models: mergeVercelModelsIntoDiscovery(currentRegistry.models ?? [], upstreamModels, defaultModelIds),
94
- };
95
- }
@@ -1 +0,0 @@
1
- export * from './discovery/index.js';
package/dist/discovery.js DELETED
@@ -1 +0,0 @@
1
- export * from './discovery/index.js';
@@ -1 +0,0 @@
1
- export * from './extension/index.js';
package/dist/extension.js DELETED
@@ -1 +0,0 @@
1
- export * from './extension/index.js';
@@ -1 +0,0 @@
1
- export * from './favorite/index.js';
package/dist/favorite.js DELETED
@@ -1 +0,0 @@
1
- export * from './favorite/index.js';
package/dist/file.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './file/index.js';
package/dist/file.js DELETED
@@ -1 +0,0 @@
1
- export * from './file/index.js';
package/dist/import.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './import/index.js';
package/dist/import.js DELETED
@@ -1 +0,0 @@
1
- export * from './import/index.js';
@@ -1 +0,0 @@
1
- export * from './knowledge/index.js';
package/dist/knowledge.js DELETED
@@ -1 +0,0 @@
1
- export * from './knowledge/index.js';
package/dist/session.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './session/index.js';
package/dist/session.js DELETED
@@ -1 +0,0 @@
1
- export * from './session/index.js';
@@ -1 +0,0 @@
1
- export * from './settings/index.js';
package/dist/settings.js DELETED
@@ -1 +0,0 @@
1
- export * from './settings/index.js';
@@ -1,2 +0,0 @@
1
- export * from './sidecar-events.js';
2
- export * from './persistence-mapping.js';
@@ -1,2 +0,0 @@
1
- export * from './sidecar-events.js';
2
- export * from './persistence-mapping.js';
@@ -1,12 +0,0 @@
1
- export declare const WorkspaceVocab: {
2
- readonly title: string;
3
- readonly workspaceType: string;
4
- readonly kind: string;
5
- readonly rootUri: string;
6
- readonly repoRootUri: string;
7
- readonly baseRef: string;
8
- readonly branch: string;
9
- readonly createdAt: string;
10
- readonly updatedAt: string;
11
- readonly type: string;
12
- };
@@ -1,13 +0,0 @@
1
- import { DCTerms, UDFS } from '../namespaces.js';
2
- export const WorkspaceVocab = {
3
- title: DCTerms.title,
4
- workspaceType: UDFS.workspaceType,
5
- kind: UDFS.workspaceKind,
6
- rootUri: UDFS.rootUri,
7
- repoRootUri: UDFS.repoRootUri,
8
- baseRef: UDFS.baseRef,
9
- branch: UDFS.branch,
10
- createdAt: DCTerms.created,
11
- updatedAt: DCTerms.modified,
12
- type: UDFS.Workspace,
13
- };
package/dist/vocab.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './vocab/index.js';
package/dist/vocab.js DELETED
@@ -1 +0,0 @@
1
- export * from './vocab/index.js';
@@ -1,45 +0,0 @@
1
- export declare const workspaceRepository: import("./repository.js").PodRepositoryDescriptor<import("@undefineds.co/models/_drizzle-solid/pod-table").PodTableWithColumns<import("@undefineds.co/models/_drizzle-solid/types").ResolvedColumns<{
2
- id: import("@undefineds.co/models/_drizzle-solid/columns").PodStringColumn<false, false>;
3
- title: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, false, false>;
4
- workspaceType: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, true, true>;
5
- kind: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, true, true>;
6
- rootUri: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"uri", null, false, false>;
7
- repoRootUri: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"uri", null, false, false>;
8
- baseRef: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, false, false>;
9
- branch: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"string", null, false, false>;
10
- createdAt: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"datetime", null, true, true>;
11
- updatedAt: import("@undefineds.co/models/_drizzle-solid/columns").ColumnBuilder<"datetime", null, true, true>;
12
- }>>, {
13
- id: string;
14
- title: string;
15
- workspaceType: string;
16
- kind: string;
17
- rootUri: string;
18
- repoRootUri: string;
19
- baseRef: string;
20
- branch: string;
21
- createdAt: Date;
22
- updatedAt: Date;
23
- }, {
24
- id?: string | undefined;
25
- title?: string | undefined;
26
- workspaceType?: string | undefined;
27
- kind?: string | undefined;
28
- rootUri?: string | undefined;
29
- repoRootUri?: string | undefined;
30
- baseRef?: string | undefined;
31
- branch?: string | undefined;
32
- createdAt?: Date | undefined;
33
- updatedAt?: Date | undefined;
34
- }, {
35
- id?: string | null | undefined;
36
- title?: string | null | undefined;
37
- workspaceType?: string | undefined;
38
- kind?: string | undefined;
39
- rootUri?: string | null | undefined;
40
- repoRootUri?: string | null | undefined;
41
- baseRef?: string | null | undefined;
42
- branch?: string | null | undefined;
43
- createdAt?: Date | undefined;
44
- updatedAt?: Date | undefined;
45
- }, Record<string, unknown>>;
@@ -1,8 +0,0 @@
1
- import { definePodRepository } from './repository.js';
2
- import { workspaceTable } from './workspace.schema.js';
3
- export const workspaceRepository = definePodRepository({
4
- namespace: 'workspace',
5
- table: workspaceTable,
6
- searchableFields: ['title', 'branch'],
7
- defaultSort: { field: 'updatedAt', direction: 'desc' },
8
- });
@@ -1 +0,0 @@
1
- export { workspaceTable, WORKSPACE_TYPES, WORKSPACE_KINDS, getWorkspaceContainerPath, resolveWorkspaceContainerUri, parseWorkspaceIdFromContainerUri, normalizeLocalWorkspacePath, buildLocalWorkspaceUri, parseLocalWorkspaceUri, isLocalWorkspaceUri, type WorkspaceType, type WorkspaceKind, type WorkspaceRow, type WorkspaceInsert, type WorkspaceUpdate, } from './core.js';
@@ -1 +0,0 @@
1
- export { workspaceTable, WORKSPACE_TYPES, WORKSPACE_KINDS, getWorkspaceContainerPath, resolveWorkspaceContainerUri, parseWorkspaceIdFromContainerUri, normalizeLocalWorkspacePath, buildLocalWorkspaceUri, parseLocalWorkspaceUri, isLocalWorkspaceUri, } from './core.js';