@undefineds.co/models 0.2.21 → 0.2.22
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/README.md +178 -523
- package/dist/ai-config/index.d.ts +24 -0
- package/dist/ai-config/index.js +133 -23
- package/dist/ai-model.schema.js +1 -1
- package/dist/ai-provider.schema.js +2 -2
- package/dist/approval.schema.d.ts +1 -0
- package/dist/approval.schema.js +11 -0
- package/dist/audit.schema.d.ts +1 -0
- package/dist/audit.schema.js +11 -0
- package/dist/chat.schema.d.ts +1 -1
- package/dist/chat.schema.js +1 -1
- package/dist/credential.schema.d.ts +6 -0
- package/dist/credential.schema.js +2 -1
- package/dist/grant.schema.d.ts +1 -0
- package/dist/grant.schema.js +3 -0
- package/dist/index.d.ts +6 -7
- package/dist/index.js +6 -11
- package/dist/message.schema.js +8 -8
- package/dist/namespaces.d.ts +0 -3
- package/dist/namespaces.js +2 -7
- package/dist/schema.d.ts +4 -0
- package/dist/session/index.d.ts +1 -1
- package/dist/session/index.js +1 -1
- package/dist/session/session.schema.d.ts +6 -1
- package/dist/session/session.schema.js +31 -3
- package/dist/session.repository.d.ts +4 -0
- package/dist/thread.schema.js +2 -2
- package/dist/vocab/message.vocab.js +8 -8
- package/dist/vocab/thread.vocab.js +2 -2
- package/package.json +3 -7
- package/dist/watch/index.d.ts +0 -281
- package/dist/watch/index.js +0 -1493
|
@@ -20,6 +20,9 @@ export interface AIConfigProviderState {
|
|
|
20
20
|
enabled: boolean;
|
|
21
21
|
apiKey?: string;
|
|
22
22
|
baseUrl?: string;
|
|
23
|
+
credentialId?: string;
|
|
24
|
+
credentialLabel?: string;
|
|
25
|
+
credentialIsDefault?: boolean;
|
|
23
26
|
models: AIConfigModel[];
|
|
24
27
|
selectedModelId?: string;
|
|
25
28
|
}
|
|
@@ -36,6 +39,16 @@ export interface BuildAIConfigProviderStateMapOptions {
|
|
|
36
39
|
modelRows: Array<Partial<AIModelRow> & Record<string, unknown>>;
|
|
37
40
|
fallbackToCatalogModels?: boolean;
|
|
38
41
|
}
|
|
42
|
+
export interface AIConfigCredentialSelection {
|
|
43
|
+
providerId: string;
|
|
44
|
+
credential: Partial<CredentialRow> & Record<string, unknown>;
|
|
45
|
+
credentialId?: string;
|
|
46
|
+
credentialLabel?: string;
|
|
47
|
+
apiKey: string;
|
|
48
|
+
baseUrl?: string;
|
|
49
|
+
proxyUrl?: string;
|
|
50
|
+
isDefault: boolean;
|
|
51
|
+
}
|
|
39
52
|
export interface AIConfigMutationPlan {
|
|
40
53
|
providerId: string;
|
|
41
54
|
providerPayload?: AIProviderInsert;
|
|
@@ -43,6 +56,10 @@ export interface AIConfigMutationPlan {
|
|
|
43
56
|
modelUpserts: AIModelInsert[];
|
|
44
57
|
modelDeleteIds: string[];
|
|
45
58
|
}
|
|
59
|
+
export interface AIConfigDisconnectPlan {
|
|
60
|
+
providerId: string;
|
|
61
|
+
credentialDeleteIds: string[];
|
|
62
|
+
}
|
|
46
63
|
export declare const UNDEFINEDS_AI_PROVIDER_ID = "undefineds";
|
|
47
64
|
export declare const UNDEFINEDS_AI_PROVIDER_DISPLAY_NAME = "undefineds";
|
|
48
65
|
export declare const UNDEFINEDS_AI_BASE_URL = "https://api.undefineds.co/v1";
|
|
@@ -61,6 +78,9 @@ export declare function getAIConfigDefaultBaseUrl(providerId: string): string |
|
|
|
61
78
|
export declare function getDefaultAIConfigCredentialId(providerId: string): string;
|
|
62
79
|
export declare function aiConfigProviderRef(providerId: string): string;
|
|
63
80
|
export declare function aiConfigModelRef(providerId: string, modelId?: string): string;
|
|
81
|
+
export declare function selectAIConfigCredential(providerId: string, credentialRows: Array<Partial<CredentialRow> & Record<string, unknown>>, providerRows?: Array<Partial<AIProviderRow> & Record<string, unknown>>): AIConfigCredentialSelection | undefined;
|
|
82
|
+
export declare function aiConfigProviderUri(providerId: string): string;
|
|
83
|
+
export declare function aiConfigModelUri(modelId: string, providerId?: string): string;
|
|
64
84
|
export declare function buildAIConfigProviderStateMap(options: BuildAIConfigProviderStateMapOptions): Record<string, AIConfigProviderState>;
|
|
65
85
|
export declare function buildAIConfigMutationPlan(input: {
|
|
66
86
|
providerId: string;
|
|
@@ -69,3 +89,7 @@ export declare function buildAIConfigMutationPlan(input: {
|
|
|
69
89
|
currentModelRows: Array<Partial<AIModelRow> & Record<string, unknown>>;
|
|
70
90
|
updates: AIConfigUpdate;
|
|
71
91
|
}): AIConfigMutationPlan;
|
|
92
|
+
export declare function buildAIConfigDisconnectPlan(input: {
|
|
93
|
+
providerId: string;
|
|
94
|
+
currentCredentialRows: Array<Partial<CredentialRow> & Record<string, unknown>>;
|
|
95
|
+
}): AIConfigDisconnectPlan;
|
package/dist/ai-config/index.js
CHANGED
|
@@ -106,6 +106,26 @@ function preferredSelectedModelId(models) {
|
|
|
106
106
|
function existingDate(value) {
|
|
107
107
|
return value instanceof Date ? value : undefined;
|
|
108
108
|
}
|
|
109
|
+
function normalizeOptionalText(value) {
|
|
110
|
+
return typeof value === 'string' && value.trim() ? value.trim() : undefined;
|
|
111
|
+
}
|
|
112
|
+
function normalizeOptionalBoolean(value) {
|
|
113
|
+
return value === true || value === 'true' || value === 1 || value === '1';
|
|
114
|
+
}
|
|
115
|
+
function normalizeOptionalTimestamp(value) {
|
|
116
|
+
if (value instanceof Date)
|
|
117
|
+
return value.getTime();
|
|
118
|
+
if (typeof value === 'string' && value.trim()) {
|
|
119
|
+
const parsed = Date.parse(value);
|
|
120
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
121
|
+
}
|
|
122
|
+
if (typeof value === 'number' && Number.isFinite(value))
|
|
123
|
+
return value;
|
|
124
|
+
return 0;
|
|
125
|
+
}
|
|
126
|
+
function normalizeOptionalInteger(value) {
|
|
127
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : 0;
|
|
128
|
+
}
|
|
109
129
|
export function getAIConfigProviderCatalog() {
|
|
110
130
|
return AI_CONFIG_PROVIDER_CATALOG;
|
|
111
131
|
}
|
|
@@ -128,12 +148,15 @@ export function normalizeAIConfigResourceId(raw) {
|
|
|
128
148
|
return value;
|
|
129
149
|
}
|
|
130
150
|
const clean = value.replace(/\/$/, '');
|
|
131
|
-
if (!ABSOLUTE_IRI.test(value)) {
|
|
132
|
-
return clean.endsWith('.ttl') ? clean.slice(0, -4) : clean;
|
|
133
|
-
}
|
|
134
151
|
const tail = clean.split('/').pop() || clean;
|
|
135
152
|
return tail.endsWith('.ttl') ? tail.slice(0, -4) : tail;
|
|
136
153
|
}
|
|
154
|
+
function aiConfigResourceRefToProviderId(raw) {
|
|
155
|
+
return normalizeAIConfigProviderId(raw);
|
|
156
|
+
}
|
|
157
|
+
function aiConfigResourceRefToModelId(raw, providerId) {
|
|
158
|
+
return normalizeAIConfigModelId(raw, providerId);
|
|
159
|
+
}
|
|
137
160
|
export function normalizeAIConfigModelId(raw, providerId) {
|
|
138
161
|
const modelId = normalizeAIConfigResourceId(raw);
|
|
139
162
|
if (!modelId.includes('/'))
|
|
@@ -158,8 +181,17 @@ export function normalizeAIConfigProviderId(raw) {
|
|
|
158
181
|
}
|
|
159
182
|
return normalized;
|
|
160
183
|
}
|
|
184
|
+
function aiConfigProviderRowId(row) {
|
|
185
|
+
return aiConfigResourceRefToProviderId(String(row.id ?? row['@id'] ?? ''));
|
|
186
|
+
}
|
|
187
|
+
function aiConfigCredentialProviderId(row) {
|
|
188
|
+
return aiConfigResourceRefToProviderId(String(row.provider ?? row.id ?? ''));
|
|
189
|
+
}
|
|
190
|
+
function aiConfigModelProviderId(row) {
|
|
191
|
+
return aiConfigResourceRefToProviderId(String(row.isProvidedBy ?? ''));
|
|
192
|
+
}
|
|
161
193
|
function normalizeAIConfigModelStorageId(raw, providerId) {
|
|
162
|
-
return
|
|
194
|
+
return aiConfigResourceRefToModelId(raw, providerId);
|
|
163
195
|
}
|
|
164
196
|
export function sameAIConfigProviderFamily(left, right) {
|
|
165
197
|
const normalizedLeft = normalizeAIConfigProviderId(left);
|
|
@@ -177,7 +209,8 @@ export function getDefaultAIConfigCredentialId(providerId) {
|
|
|
177
209
|
return `${normalizeAIConfigProviderId(providerId)}-default`;
|
|
178
210
|
}
|
|
179
211
|
export function aiConfigProviderRef(providerId) {
|
|
180
|
-
|
|
212
|
+
const provider = normalizeAIConfigProviderId(providerId);
|
|
213
|
+
return provider ? `/settings/providers/${provider}.ttl` : provider;
|
|
181
214
|
}
|
|
182
215
|
export function aiConfigModelRef(providerId, modelId) {
|
|
183
216
|
if (modelId === undefined) {
|
|
@@ -185,7 +218,61 @@ export function aiConfigModelRef(providerId, modelId) {
|
|
|
185
218
|
}
|
|
186
219
|
const provider = normalizeAIConfigProviderId(providerId);
|
|
187
220
|
const model = normalizeAIConfigModelStorageId(modelId, provider);
|
|
188
|
-
return provider && model ? `/settings/
|
|
221
|
+
return provider && model ? `/settings/providers/${provider}.ttl#${model}` : model;
|
|
222
|
+
}
|
|
223
|
+
export function selectAIConfigCredential(providerId, credentialRows, providerRows = []) {
|
|
224
|
+
const provider = normalizeAIConfigProviderId(providerId);
|
|
225
|
+
if (!provider)
|
|
226
|
+
return undefined;
|
|
227
|
+
const candidates = credentialRows.filter((row) => {
|
|
228
|
+
const rowProvider = normalizeOptionalText(row.provider) ?? normalizeOptionalText(row.id);
|
|
229
|
+
return sameAIConfigProviderFamily(rowProvider, provider)
|
|
230
|
+
&& (normalizeOptionalText(row.service)?.toLowerCase() ?? 'ai') === 'ai'
|
|
231
|
+
&& (normalizeOptionalText(row.status)?.toLowerCase() ?? 'active') === 'active'
|
|
232
|
+
&& Boolean(normalizeOptionalText(row.apiKey));
|
|
233
|
+
});
|
|
234
|
+
if (candidates.length === 0)
|
|
235
|
+
return undefined;
|
|
236
|
+
const sortByRotation = (left, right) => {
|
|
237
|
+
const leftLastUsed = normalizeOptionalTimestamp(left.lastUsedAt);
|
|
238
|
+
const rightLastUsed = normalizeOptionalTimestamp(right.lastUsedAt);
|
|
239
|
+
if (leftLastUsed !== rightLastUsed)
|
|
240
|
+
return leftLastUsed - rightLastUsed;
|
|
241
|
+
const leftFailCount = normalizeOptionalInteger(left.failCount);
|
|
242
|
+
const rightFailCount = normalizeOptionalInteger(right.failCount);
|
|
243
|
+
if (leftFailCount !== rightFailCount)
|
|
244
|
+
return leftFailCount - rightFailCount;
|
|
245
|
+
return normalizeAIConfigResourceId(String(left.id ?? left['@id'] ?? ''))
|
|
246
|
+
.localeCompare(normalizeAIConfigResourceId(String(right.id ?? right['@id'] ?? '')));
|
|
247
|
+
};
|
|
248
|
+
const defaults = candidates.filter((row) => normalizeOptionalBoolean(row.isDefault));
|
|
249
|
+
const credential = [...(defaults.length > 0 ? defaults : candidates)].sort(sortByRotation)[0];
|
|
250
|
+
const providerRow = providerRows.find((row) => sameAIConfigProviderFamily(aiConfigProviderRowId(row), provider));
|
|
251
|
+
const apiKey = normalizeOptionalText(credential.apiKey);
|
|
252
|
+
if (!apiKey)
|
|
253
|
+
return undefined;
|
|
254
|
+
return {
|
|
255
|
+
providerId: provider,
|
|
256
|
+
credential,
|
|
257
|
+
credentialId: normalizeAIConfigResourceId(normalizeOptionalText(credential.id) ?? normalizeOptionalText(credential['@id'])),
|
|
258
|
+
credentialLabel: normalizeOptionalText(credential.label),
|
|
259
|
+
apiKey,
|
|
260
|
+
baseUrl: normalizeOptionalText(credential.baseUrl)
|
|
261
|
+
?? normalizeOptionalText(providerRow?.baseUrl)
|
|
262
|
+
?? getAIConfigDefaultBaseUrl(provider),
|
|
263
|
+
proxyUrl: normalizeOptionalText(credential.proxyUrl) ?? normalizeOptionalText(providerRow?.proxyUrl),
|
|
264
|
+
isDefault: normalizeOptionalBoolean(credential.isDefault),
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
// Compatibility aliases for older app/CLI call sites. New code should prefer
|
|
268
|
+
// `aiConfigProviderRef` / `aiConfigModelRef`, which match current resource schemas.
|
|
269
|
+
export function aiConfigProviderUri(providerId) {
|
|
270
|
+
return aiConfigProviderRef(providerId);
|
|
271
|
+
}
|
|
272
|
+
export function aiConfigModelUri(modelId, providerId) {
|
|
273
|
+
return providerId
|
|
274
|
+
? aiConfigModelRef(providerId, modelId)
|
|
275
|
+
: normalizeAIConfigResourceId(modelId);
|
|
189
276
|
}
|
|
190
277
|
export function buildAIConfigProviderStateMap(options) {
|
|
191
278
|
const catalog = options.catalog ?? AI_CONFIG_PROVIDER_CATALOG;
|
|
@@ -194,23 +281,22 @@ export function buildAIConfigProviderStateMap(options) {
|
|
|
194
281
|
const knownIds = collectKnownProviderIds(catalog);
|
|
195
282
|
const providerMap = new Map();
|
|
196
283
|
for (const row of options.providerRows) {
|
|
197
|
-
const providerId =
|
|
284
|
+
const providerId = aiConfigProviderRowId(row);
|
|
198
285
|
if (!providerId)
|
|
199
286
|
continue;
|
|
200
287
|
const previous = providerMap.get(providerId) ?? {};
|
|
201
288
|
providerMap.set(providerId, { ...previous, ...row });
|
|
202
289
|
}
|
|
203
|
-
const
|
|
290
|
+
const credentialProviderIds = new Set();
|
|
204
291
|
for (const row of options.credentialRows) {
|
|
205
|
-
const providerId =
|
|
292
|
+
const providerId = aiConfigCredentialProviderId(row);
|
|
206
293
|
if (!providerId)
|
|
207
294
|
continue;
|
|
208
|
-
|
|
209
|
-
credentialMap.set(providerId, { ...previous, ...row });
|
|
295
|
+
credentialProviderIds.add(providerId);
|
|
210
296
|
}
|
|
211
297
|
const modelMap = new Map();
|
|
212
298
|
for (const row of options.modelRows) {
|
|
213
|
-
const providerId =
|
|
299
|
+
const providerId = aiConfigModelProviderId(row);
|
|
214
300
|
if (!providerId)
|
|
215
301
|
continue;
|
|
216
302
|
const modelId = normalizeAIConfigModelStorageId(String(row.id ?? row['@id'] ?? ''), providerId);
|
|
@@ -231,17 +317,17 @@ export function buildAIConfigProviderStateMap(options) {
|
|
|
231
317
|
providerIds.add(entry.id);
|
|
232
318
|
for (const providerId of providerMap.keys())
|
|
233
319
|
providerIds.add(providerId);
|
|
234
|
-
for (const providerId of
|
|
320
|
+
for (const providerId of credentialProviderIds)
|
|
235
321
|
providerIds.add(providerId);
|
|
236
322
|
for (const providerId of modelMap.keys())
|
|
237
323
|
providerIds.add(providerId);
|
|
238
324
|
for (const providerId of providerIds) {
|
|
239
|
-
if (!knownIds.has(providerId) && !providerMap.has(providerId) && !
|
|
325
|
+
if (!knownIds.has(providerId) && !providerMap.has(providerId) && !credentialProviderIds.has(providerId) && !modelMap.has(providerId)) {
|
|
240
326
|
continue;
|
|
241
327
|
}
|
|
242
328
|
const metadata = resolveCatalogEntry(providerId, catalog) ?? getAIConfigProviderMetadata(providerId);
|
|
243
329
|
const providerRow = providerMap.get(providerId);
|
|
244
|
-
const
|
|
330
|
+
const credentialSelection = selectAIConfigCredential(providerId, options.credentialRows, options.providerRows);
|
|
245
331
|
const persistedModels = modelMap.get(providerId) ?? [];
|
|
246
332
|
const models = persistedModels.length > 0 || !fallbackToCatalogModels
|
|
247
333
|
? persistedModels
|
|
@@ -254,11 +340,12 @@ export function buildAIConfigProviderStateMap(options) {
|
|
|
254
340
|
const selectedModelId = normalizeAIConfigModelStorageId(typeof providerRow?.hasModel === 'string' ? providerRow.hasModel : '', providerId) || preferredSelectedModelId(models);
|
|
255
341
|
states[providerId] = {
|
|
256
342
|
id: providerId,
|
|
257
|
-
enabled: (
|
|
258
|
-
apiKey:
|
|
259
|
-
baseUrl: (typeof
|
|
260
|
-
|
|
261
|
-
|
|
343
|
+
enabled: Boolean(credentialSelection),
|
|
344
|
+
apiKey: credentialSelection?.apiKey,
|
|
345
|
+
baseUrl: credentialSelection?.baseUrl || (typeof providerRow?.baseUrl === 'string' && providerRow.baseUrl) || metadata.defaultBaseUrl,
|
|
346
|
+
credentialId: credentialSelection?.credentialId,
|
|
347
|
+
credentialLabel: credentialSelection?.credentialLabel,
|
|
348
|
+
credentialIsDefault: credentialSelection?.isDefault,
|
|
262
349
|
models,
|
|
263
350
|
selectedModelId: selectedModelId || undefined,
|
|
264
351
|
};
|
|
@@ -268,9 +355,10 @@ export function buildAIConfigProviderStateMap(options) {
|
|
|
268
355
|
export function buildAIConfigMutationPlan(input) {
|
|
269
356
|
const providerId = normalizeAIConfigProviderId(input.providerId);
|
|
270
357
|
const metadata = getAIConfigProviderMetadata(providerId);
|
|
271
|
-
const existingProvider = input.currentProviderRows.find((row) => sameAIConfigProviderFamily(
|
|
272
|
-
const existingCredential = input.currentCredentialRows
|
|
273
|
-
|
|
358
|
+
const existingProvider = input.currentProviderRows.find((row) => sameAIConfigProviderFamily(aiConfigProviderRowId(row), providerId));
|
|
359
|
+
const existingCredential = selectAIConfigCredential(providerId, input.currentCredentialRows, input.currentProviderRows)?.credential
|
|
360
|
+
?? input.currentCredentialRows.find((row) => sameAIConfigProviderFamily(aiConfigCredentialProviderId(row), providerId));
|
|
361
|
+
const existingModels = input.currentModelRows.filter((row) => sameAIConfigProviderFamily(aiConfigModelProviderId(row), providerId));
|
|
274
362
|
const hasConfigUpdate = input.updates.enabled !== undefined || input.updates.apiKey !== undefined || input.updates.baseUrl !== undefined;
|
|
275
363
|
let providerPayload;
|
|
276
364
|
let credentialPayload;
|
|
@@ -309,6 +397,7 @@ export function buildAIConfigMutationPlan(input) {
|
|
|
309
397
|
label: typeof existingCredential?.label === 'string' && existingCredential.label
|
|
310
398
|
? existingCredential.label
|
|
311
399
|
: `${metadata.displayName} Key`,
|
|
400
|
+
isDefault: existingCredential?.isDefault === undefined ? true : Boolean(existingCredential.isDefault),
|
|
312
401
|
};
|
|
313
402
|
}
|
|
314
403
|
if (input.updates.models !== undefined) {
|
|
@@ -348,3 +437,24 @@ export function buildAIConfigMutationPlan(input) {
|
|
|
348
437
|
modelDeleteIds,
|
|
349
438
|
};
|
|
350
439
|
}
|
|
440
|
+
export function buildAIConfigDisconnectPlan(input) {
|
|
441
|
+
const providerId = normalizeAIConfigProviderId(input.providerId);
|
|
442
|
+
const credentialDeleteIds = [];
|
|
443
|
+
const seen = new Set();
|
|
444
|
+
for (const row of input.currentCredentialRows) {
|
|
445
|
+
const rowProvider = normalizeOptionalText(row.provider) ?? normalizeOptionalText(row.id);
|
|
446
|
+
if (!sameAIConfigProviderFamily(rowProvider, providerId)) {
|
|
447
|
+
continue;
|
|
448
|
+
}
|
|
449
|
+
const id = normalizeAIConfigResourceId(normalizeOptionalText(row.id) ?? normalizeOptionalText(row['@id']));
|
|
450
|
+
if (!id || seen.has(id)) {
|
|
451
|
+
continue;
|
|
452
|
+
}
|
|
453
|
+
seen.add(id);
|
|
454
|
+
credentialDeleteIds.push(id);
|
|
455
|
+
}
|
|
456
|
+
return {
|
|
457
|
+
providerId,
|
|
458
|
+
credentialDeleteIds,
|
|
459
|
+
};
|
|
460
|
+
}
|
package/dist/ai-model.schema.js
CHANGED
|
@@ -11,7 +11,7 @@ export const aiModelResource = podTable("aiModel", {
|
|
|
11
11
|
createdAt: timestamp("createdAt").predicate(XPOD_AI.createdAt).notNull().defaultNow(),
|
|
12
12
|
updatedAt: timestamp("updatedAt").predicate(XPOD_AI.updatedAt).notNull().defaultNow(),
|
|
13
13
|
}, {
|
|
14
|
-
base: "/settings/
|
|
14
|
+
base: "/settings/providers/",
|
|
15
15
|
type: XPOD_AI.Model,
|
|
16
16
|
namespace: XPOD_AI,
|
|
17
17
|
subjectTemplate: "{isProvidedBy|id}.ttl#{id}",
|
|
@@ -8,10 +8,10 @@ export const aiProviderResource = podTable("aiProvider", {
|
|
|
8
8
|
hasModel: uri("hasModel").predicate(XPOD_AI.hasModel).link("aiModel"),
|
|
9
9
|
defaultModel: uri("defaultModel").predicate(XPOD_AI.defaultModel).link("aiModel"),
|
|
10
10
|
}, {
|
|
11
|
-
base: "/settings/
|
|
11
|
+
base: "/settings/providers/",
|
|
12
12
|
type: XPOD_AI.Provider,
|
|
13
13
|
namespace: XPOD_AI,
|
|
14
|
-
subjectTemplate: "
|
|
14
|
+
subjectTemplate: "{id}.ttl",
|
|
15
15
|
});
|
|
16
16
|
// Compatibility alias. New model code should prefer `aiProviderResource`.
|
|
17
17
|
export const aiProviderTable = aiProviderResource;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function buildApprovalSubjectPath(approvalId: string, createdAt?: Date | string | number): string;
|
|
1
2
|
export declare function extractApprovalIdFromApprovalRef(approvalRef: string | null | undefined): string | null;
|
|
2
3
|
export declare const approvalResource: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
3
4
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
package/dist/approval.schema.js
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { extractPodResourceTemplateValue, podTable, uri, string, text, timestamp, id } from '@undefineds.co/drizzle-solid';
|
|
2
2
|
import { ODRL, UDFS, DCTerms } from './namespaces.js';
|
|
3
|
+
export function buildApprovalSubjectPath(approvalId, createdAt = new Date()) {
|
|
4
|
+
const date = createdAt instanceof Date ? createdAt : new Date(createdAt);
|
|
5
|
+
const safeDate = Number.isFinite(date.getTime()) ? date : new Date();
|
|
6
|
+
const yyyy = String(safeDate.getUTCFullYear());
|
|
7
|
+
const mm = String(safeDate.getUTCMonth() + 1).padStart(2, '0');
|
|
8
|
+
const dd = String(safeDate.getUTCDate()).padStart(2, '0');
|
|
9
|
+
return `/.data/approvals/${yyyy}/${mm}/${dd}.ttl#${encodeURIComponent(approvalId)}`;
|
|
10
|
+
}
|
|
3
11
|
export function extractApprovalIdFromApprovalRef(approvalRef) {
|
|
12
|
+
if (approvalRef && !/[/:#]/.test(approvalRef)) {
|
|
13
|
+
return approvalRef;
|
|
14
|
+
}
|
|
4
15
|
return extractPodResourceTemplateValue(approvalResource, approvalRef);
|
|
5
16
|
}
|
|
6
17
|
// Approval request resource (separate from Solid inbox notifications).
|
package/dist/audit.schema.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function buildAuditSubjectPath(auditId: string, createdAt?: Date | string | number): string;
|
|
1
2
|
export declare const auditResource: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
2
3
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
3
4
|
action: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, true, false>;
|
package/dist/audit.schema.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { extractPodResourceTemplateValue, podTable, uri, string, timestamp, id } from '@undefineds.co/drizzle-solid';
|
|
2
2
|
import { UDFS, DCTerms } from './namespaces.js';
|
|
3
|
+
export function buildAuditSubjectPath(auditId, createdAt = new Date()) {
|
|
4
|
+
const date = createdAt instanceof Date ? createdAt : new Date(createdAt);
|
|
5
|
+
const safeDate = Number.isFinite(date.getTime()) ? date : new Date();
|
|
6
|
+
const yyyy = String(safeDate.getUTCFullYear());
|
|
7
|
+
const mm = String(safeDate.getUTCMonth() + 1).padStart(2, '0');
|
|
8
|
+
const dd = String(safeDate.getUTCDate()).padStart(2, '0');
|
|
9
|
+
return `/.data/audits/${yyyy}/${mm}/${dd}.ttl#${encodeURIComponent(auditId)}`;
|
|
10
|
+
}
|
|
3
11
|
// Append-only audit entry resource (separate from Solid inbox notifications).
|
|
4
12
|
// Audit entries are independent events; session/chat/thread are optional relations,
|
|
5
13
|
// not storage ownership boundaries.
|
|
@@ -30,6 +38,9 @@ export const auditResource = podTable('audit', {
|
|
|
30
38
|
subjectTemplate: '{yyyy}/{MM}/{dd}.ttl#{id}',
|
|
31
39
|
});
|
|
32
40
|
export function extractAuditIdFromAuditRef(auditRef) {
|
|
41
|
+
if (auditRef && !/[/:#]/.test(auditRef)) {
|
|
42
|
+
return auditRef;
|
|
43
|
+
}
|
|
33
44
|
return extractPodResourceTemplateValue(auditResource, auditRef);
|
|
34
45
|
}
|
|
35
46
|
// Compatibility alias. New model code should prefer `auditResource`.
|
package/dist/chat.schema.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface ChatMetadata {
|
|
|
11
11
|
* where a runtime executes.
|
|
12
12
|
* - Runtime/workspace/place/session context belongs on Thread.
|
|
13
13
|
* - Direct LinX CLI entry should use a chat representing the AI secretary.
|
|
14
|
-
* -
|
|
14
|
+
* - Auto-mode entry should use a chat representing the controlled agent/tool, such as
|
|
15
15
|
* Codex, Claude Code, or a concrete AI identity when available.
|
|
16
16
|
*
|
|
17
17
|
* Storage structure (aligned with xpod):
|
package/dist/chat.schema.js
CHANGED
|
@@ -9,7 +9,7 @@ import { UDFS, DCTerms, SCHEMA, MEETING, WF } from './namespaces.js';
|
|
|
9
9
|
* where a runtime executes.
|
|
10
10
|
* - Runtime/workspace/place/session context belongs on Thread.
|
|
11
11
|
* - Direct LinX CLI entry should use a chat representing the AI secretary.
|
|
12
|
-
* -
|
|
12
|
+
* - Auto-mode entry should use a chat representing the controlled agent/tool, such as
|
|
13
13
|
* Codex, Claude Code, or a concrete AI identity when available.
|
|
14
14
|
*
|
|
15
15
|
* Storage structure (aligned with xpod):
|
|
@@ -7,6 +7,7 @@ export declare const credentialResource: import("@undefineds.co/drizzle-solid/di
|
|
|
7
7
|
baseUrl: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
8
8
|
proxyUrl: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
9
9
|
label: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
10
|
+
isDefault: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
|
10
11
|
lastUsedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
11
12
|
failCount: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"integer", null, false, true>;
|
|
12
13
|
rateLimitResetAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
@@ -25,6 +26,7 @@ export declare const credentialTable: import("@undefineds.co/drizzle-solid/dist/
|
|
|
25
26
|
baseUrl: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
26
27
|
proxyUrl: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
27
28
|
label: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
29
|
+
isDefault: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
|
28
30
|
lastUsedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
29
31
|
failCount: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"integer", null, false, true>;
|
|
30
32
|
rateLimitResetAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
@@ -43,6 +45,7 @@ export declare const apiKeyCredentialResource: import("@undefineds.co/drizzle-so
|
|
|
43
45
|
baseUrl: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
44
46
|
proxyUrl: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
45
47
|
label: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
48
|
+
isDefault: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
|
46
49
|
lastUsedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
47
50
|
failCount: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"integer", null, false, true>;
|
|
48
51
|
rateLimitResetAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
@@ -61,6 +64,7 @@ export declare const apiKeyCredentialTable: import("@undefineds.co/drizzle-solid
|
|
|
61
64
|
baseUrl: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
62
65
|
proxyUrl: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
63
66
|
label: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
67
|
+
isDefault: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
|
64
68
|
lastUsedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
65
69
|
failCount: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"integer", null, false, true>;
|
|
66
70
|
rateLimitResetAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
@@ -79,6 +83,7 @@ export declare const oauthCredentialResource: import("@undefineds.co/drizzle-sol
|
|
|
79
83
|
baseUrl: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
80
84
|
proxyUrl: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
81
85
|
label: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
86
|
+
isDefault: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
|
82
87
|
lastUsedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
83
88
|
failCount: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"integer", null, false, true>;
|
|
84
89
|
rateLimitResetAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
@@ -97,6 +102,7 @@ export declare const oauthCredentialTable: import("@undefineds.co/drizzle-solid/
|
|
|
97
102
|
baseUrl: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
98
103
|
proxyUrl: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
99
104
|
label: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"string", null, false, false>;
|
|
105
|
+
isDefault: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"boolean", null, false, true>;
|
|
100
106
|
lastUsedAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
101
107
|
failCount: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"integer", null, false, true>;
|
|
102
108
|
rateLimitResetAt: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"datetime", null, false, false>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { id, integer, podTable, string, timestamp, uri } from "@undefineds.co/drizzle-solid";
|
|
1
|
+
import { boolean, id, integer, podTable, string, timestamp, uri } from "@undefineds.co/drizzle-solid";
|
|
2
2
|
import { XPOD_CREDENTIAL } from "./namespaces.js";
|
|
3
3
|
export const credentialResource = podTable("credential", {
|
|
4
4
|
id: id("id"),
|
|
@@ -9,6 +9,7 @@ export const credentialResource = podTable("credential", {
|
|
|
9
9
|
baseUrl: string("baseUrl").predicate(XPOD_CREDENTIAL.baseUrl),
|
|
10
10
|
proxyUrl: string("proxyUrl").predicate(XPOD_CREDENTIAL.proxyUrl),
|
|
11
11
|
label: string("label").predicate(XPOD_CREDENTIAL.label),
|
|
12
|
+
isDefault: boolean("isDefault").predicate(XPOD_CREDENTIAL.isDefault).default(false),
|
|
12
13
|
lastUsedAt: timestamp("lastUsedAt").predicate(XPOD_CREDENTIAL.lastUsedAt),
|
|
13
14
|
failCount: integer("failCount").predicate(XPOD_CREDENTIAL.failCount).default(0),
|
|
14
15
|
rateLimitResetAt: timestamp("rateLimitResetAt").predicate(XPOD_CREDENTIAL.rateLimitResetAt),
|
package/dist/grant.schema.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare function buildGrantSubjectPath(grantId: string): string;
|
|
1
2
|
export declare const grantResource: import("@undefineds.co/drizzle-solid/dist/core/schema").PodTableWithColumns<import("@undefineds.co/drizzle-solid/dist/core/schema").ResolvedColumns<{
|
|
2
3
|
id: import("@undefineds.co/drizzle-solid/dist/core/schema").PodStringColumn<false, false>;
|
|
3
4
|
rdfType: import("@undefineds.co/drizzle-solid/dist/core/schema").ColumnBuilder<"array", "uri", true, true>;
|
package/dist/grant.schema.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { podTable, uri, string, text, timestamp, id } from '@undefineds.co/drizzle-solid';
|
|
2
2
|
import { RDF, ODRL, UDFS, DCTerms } from './namespaces.js';
|
|
3
|
+
export function buildGrantSubjectPath(grantId) {
|
|
4
|
+
return `/settings/autonomy/grants/${encodeURIComponent(grantId)}.ttl`;
|
|
5
|
+
}
|
|
3
6
|
// Persistent delegation grant resource generated by "do not ask again" decisions.
|
|
4
7
|
// This is the durable "delegation" layer (distinct from one-off approvals and append-only audit entries).
|
|
5
8
|
export const grantResource = podTable('grant', {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { UDFS, UDFS_NAMESPACE, SIOC, DCTerms, SCHEMA, RDF, RDFS, ACL, ODRL, OWL, FOAF, MEETING, AS, VCARD, WF, LDP, XPOD_CREDENTIAL, XPOD_AI, } from "./namespaces";
|
|
2
2
|
export * from "./vocab";
|
|
3
3
|
export * from './profile';
|
|
4
4
|
export * from './profile.repository';
|
|
@@ -21,12 +21,12 @@ export { settingsResource, settingsTable, SETTING_KEYS, type SettingKey, type Se
|
|
|
21
21
|
export { agentResource, agentTable, type AgentRow, type AgentInsert, type AgentUpdate, } from './agent.schema';
|
|
22
22
|
export { agentRepository } from './agent.repository';
|
|
23
23
|
export { DEFAULT_AGENT_PROVIDERS, type AgentProviderMetadata, type AgentModelOption, } from './agent.providers';
|
|
24
|
-
export { sessionResource, sessionTable, buildRuntimeSessionIri, extractRuntimeSessionId, type SessionType, type SessionStatus, type SessionRow, type SessionInsert, type SessionUpdate, } from './session';
|
|
24
|
+
export { sessionResource, sessionTable, buildSessionResourceId, buildSessionSubjectPath, buildRuntimeSessionIri, extractSessionIdFromSessionRef, extractRuntimeSessionId, type SessionType, type SessionStatus, type SessionRow, type SessionInsert, type SessionUpdate, } from './session';
|
|
25
25
|
export { sessionRepository } from './session.repository';
|
|
26
|
-
export { approvalResource, approvalTable, extractApprovalIdFromApprovalRef, type ApprovalRow, type ApprovalInsert, type ApprovalUpdate, } from './approval.schema';
|
|
27
|
-
export { auditResource, auditTable, extractAuditIdFromAuditRef, type AuditRow, type AuditInsert, type AuditUpdate, } from './audit.schema';
|
|
26
|
+
export { approvalResource, approvalTable, buildApprovalSubjectPath, extractApprovalIdFromApprovalRef, type ApprovalRow, type ApprovalInsert, type ApprovalUpdate, } from './approval.schema';
|
|
27
|
+
export { auditResource, auditTable, buildAuditSubjectPath, extractAuditIdFromAuditRef, type AuditRow, type AuditInsert, type AuditUpdate, } from './audit.schema';
|
|
28
28
|
export { buildAuditDetailRecord, buildAuditPresentation, createResolvedAuthTimestampsIndex, formatAuditActorRole, formatInboxStatusLabel, type AuditPresentation, } from './audit.presentation';
|
|
29
|
-
export { grantResource, grantTable, type GrantRow, type GrantInsert, type GrantUpdate, } from './grant.schema';
|
|
29
|
+
export { grantResource, grantTable, buildGrantSubjectPath, type GrantRow, type GrantInsert, type GrantUpdate, } from './grant.schema';
|
|
30
30
|
export { inboxNotificationResource, inboxNotificationTable, type InboxNotificationRow, type InboxNotificationInsert, type InboxNotificationUpdate, } from './inbox-notification.schema';
|
|
31
31
|
export { ApprovalVocab, AuditVocab, GrantVocab, InboxNotificationVocab } from './vocab/sidecar.vocab';
|
|
32
32
|
export * from './sidecar/sidecar-events';
|
|
@@ -37,8 +37,7 @@ export { apiKeyCredentialResource, apiKeyCredentialTable, credentialResource, cr
|
|
|
37
37
|
export { aiProviderResource, aiProviderTable, type AIProviderRow, type AIProviderInsert, type AIProviderUpdate, } from "./ai-provider.schema";
|
|
38
38
|
export { aiModelResource, aiModelTable, type AIModelRow, type AIModelInsert, type AIModelUpdate, } from "./ai-model.schema";
|
|
39
39
|
export { agentStatusResource, agentStatusTable, aiConfigResource, aiConfigTable, indexedFileResource, indexedFileTable, vectorStoreResource, vectorStoreTable, type AgentStatusRow, type AgentStatusInsert, type AgentStatusUpdate, type AIConfigRow, type AIConfigInsert, type AIConfigUpdate as AIConfigResourceUpdate, type IndexedFileRow, type IndexedFileInsert, type IndexedFileUpdate, type VectorStoreRow, type VectorStoreInsert, type VectorStoreUpdate, } from './ai-runtime.schema';
|
|
40
|
-
export { aiConfigModelRef, aiConfigProviderRef, buildAIConfigMutationPlan, buildAIConfigProviderStateMap, getAIConfigDefaultBaseUrl, getAIConfigProviderCatalog, getAIConfigProviderFamilyIds, getAIConfigProviderMetadata, getDefaultAIConfigCredentialId, normalizeAIConfigProviderId, normalizeAIConfigModelId, normalizeAIConfigResourceId, sameAIConfigProviderFamily, type AIConfigModel, type AIConfigMutationPlan, type AIConfigProviderCatalogEntry, type AIConfigProviderState, type AIConfigUpdate, type BuildAIConfigProviderStateMapOptions, } from './ai-config';
|
|
41
|
-
export { buildAcpPermissionResponse, buildWatchThreadMetadata, buildWatchTranscriptMessages, buildWatchUserInputResponse, createWatchSessionId, detectWatchAuthFailure, formatWatchAutoFallbackMessage, formatWatchBackendAuthMessage, extractWatchSessionIdFromJsonLine, getWatchArchiveRelativePaths, getWatchAuthLoginCommand, looksLikeWatchAuthFailureText, normalizeAcpInteractionRequest, normalizeAcpRequest, normalizeAcpSessionNotification, normalizeCodexAppServerNotification, normalizeCodexAppServerRequest, normalizeWatchCredentialSource, parseWatchClaudeAuthStatus, parseWatchJsonLine, parseWatchJsonProtocolLine, resolveWatchAutoApprovalDecision, resolveWatchCredentialSourceResolution, resolveWatchInteractionAutoResponse, resolveWatchQuestionAnswer, shouldAttemptCloudCredentialProbe, WATCH_EVENTS_FILE_NAME, WATCH_HOME_DIRNAME, WATCH_SESSIONS_DIRNAME, WATCH_SESSION_FILE_NAME, type WatchApprovalDecision, type WatchApprovalRequest, type CreateWatchSessionIdOptions, type WatchAuthFailure, type WatchAuthState, type WatchAuthStatus, type WatchArchiveRelativePaths, type WatchBackend, type WatchCloudCredentialProbe, type WatchCloudCredentialProbeStatus, type WatchCredentialSource, type WatchCredentialSourceResolution, type WatchEventLogEntry, type WatchMode, type WatchNormalizedEvent, type WatchOutputStream, type WatchResolvedCredentialSource, type WatchRuntime, type WatchSessionRecord, type WatchSessionStatus, type WatchThreadMetadata, type WatchTranscriptMessage, type WatchTranscriptMessageRole, type WatchTranscriptMessageSource, } from './watch';
|
|
40
|
+
export { aiConfigModelRef, aiConfigModelUri, aiConfigProviderRef, aiConfigProviderUri, buildAIConfigDisconnectPlan, buildAIConfigMutationPlan, buildAIConfigProviderStateMap, getAIConfigDefaultBaseUrl, getAIConfigProviderCatalog, getAIConfigProviderFamilyIds, getAIConfigProviderMetadata, getDefaultAIConfigCredentialId, normalizeAIConfigProviderId, normalizeAIConfigModelId, normalizeAIConfigResourceId, sameAIConfigProviderFamily, selectAIConfigCredential, type AIConfigModel, type AIConfigCredentialSelection, type AIConfigDisconnectPlan, type AIConfigMutationPlan, type AIConfigProviderCatalogEntry, type AIConfigProviderState, type AIConfigUpdate, type BuildAIConfigProviderStateMapOptions, } from './ai-config';
|
|
42
41
|
export { applySolidComunicaPatches, } from './comunica-patches';
|
|
43
42
|
export { createRepositoryDescriptor, definePodRepository, initSolidResources, initSolidTables, type AnyPodResource, type AnyPodTable, type PodRepositoryDescriptor, type RepositoryCacheOptions, type RepositoryInvalidations, type RepositoryScope, type SolidDatabase, } from './repository';
|
|
44
43
|
export { importJobSchema } from './import';
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
// ============================================
|
|
2
2
|
// 命名空间和词汇表
|
|
3
3
|
// ============================================
|
|
4
|
-
export {
|
|
5
|
-
// Legacy + Wave A aliases
|
|
6
|
-
LINQ, UDFS, UDFS_NAMESPACE,
|
|
7
|
-
// Wave A contracts
|
|
8
|
-
LINX_CHAT, LINX_MSG,
|
|
4
|
+
export { UDFS, UDFS_NAMESPACE,
|
|
9
5
|
// Standard vocabs
|
|
10
6
|
SIOC, DCTerms, SCHEMA, RDF, RDFS, ACL, ODRL, OWL, FOAF, MEETING, AS, VCARD, WF, LDP,
|
|
11
7
|
// xpod vocabs
|
|
@@ -50,13 +46,13 @@ export { DEFAULT_AGENT_PROVIDERS, } from './agent.providers.js';
|
|
|
50
46
|
// 其他模型
|
|
51
47
|
// ============================================
|
|
52
48
|
// Session - 会话管理
|
|
53
|
-
export { sessionResource, sessionTable, buildRuntimeSessionIri, extractRuntimeSessionId, } from './session/index.js';
|
|
49
|
+
export { sessionResource, sessionTable, buildSessionResourceId, buildSessionSubjectPath, buildRuntimeSessionIri, extractSessionIdFromSessionRef, extractRuntimeSessionId, } from './session/index.js';
|
|
54
50
|
export { sessionRepository } from './session.repository.js';
|
|
55
51
|
// Approval / Audit / Grant / Inbox Notification
|
|
56
|
-
export { approvalResource, approvalTable, extractApprovalIdFromApprovalRef, } from './approval.schema.js';
|
|
57
|
-
export { auditResource, auditTable, extractAuditIdFromAuditRef, } from './audit.schema.js';
|
|
52
|
+
export { approvalResource, approvalTable, buildApprovalSubjectPath, extractApprovalIdFromApprovalRef, } from './approval.schema.js';
|
|
53
|
+
export { auditResource, auditTable, buildAuditSubjectPath, extractAuditIdFromAuditRef, } from './audit.schema.js';
|
|
58
54
|
export { buildAuditDetailRecord, buildAuditPresentation, createResolvedAuthTimestampsIndex, formatAuditActorRole, formatInboxStatusLabel, } from './audit.presentation.js';
|
|
59
|
-
export { grantResource, grantTable, } from './grant.schema.js';
|
|
55
|
+
export { grantResource, grantTable, buildGrantSubjectPath, } from './grant.schema.js';
|
|
60
56
|
export { inboxNotificationResource, inboxNotificationTable, } from './inbox-notification.schema.js';
|
|
61
57
|
// Sidecar vocab + runtime contracts
|
|
62
58
|
export { ApprovalVocab, AuditVocab, GrantVocab, InboxNotificationVocab } from './vocab/sidecar.vocab.js';
|
|
@@ -71,8 +67,7 @@ export { apiKeyCredentialResource, apiKeyCredentialTable, credentialResource, cr
|
|
|
71
67
|
export { aiProviderResource, aiProviderTable, } from "./ai-provider.schema.js";
|
|
72
68
|
export { aiModelResource, aiModelTable, } from "./ai-model.schema.js";
|
|
73
69
|
export { agentStatusResource, agentStatusTable, aiConfigResource, aiConfigTable, indexedFileResource, indexedFileTable, vectorStoreResource, vectorStoreTable, } from './ai-runtime.schema.js';
|
|
74
|
-
export { aiConfigModelRef, aiConfigProviderRef, buildAIConfigMutationPlan, buildAIConfigProviderStateMap, getAIConfigDefaultBaseUrl, getAIConfigProviderCatalog, getAIConfigProviderFamilyIds, getAIConfigProviderMetadata, getDefaultAIConfigCredentialId, normalizeAIConfigProviderId, normalizeAIConfigModelId, normalizeAIConfigResourceId, sameAIConfigProviderFamily, } from './ai-config/index.js';
|
|
75
|
-
export { buildAcpPermissionResponse, buildWatchThreadMetadata, buildWatchTranscriptMessages, buildWatchUserInputResponse, createWatchSessionId, detectWatchAuthFailure, formatWatchAutoFallbackMessage, formatWatchBackendAuthMessage, extractWatchSessionIdFromJsonLine, getWatchArchiveRelativePaths, getWatchAuthLoginCommand, looksLikeWatchAuthFailureText, normalizeAcpInteractionRequest, normalizeAcpRequest, normalizeAcpSessionNotification, normalizeCodexAppServerNotification, normalizeCodexAppServerRequest, normalizeWatchCredentialSource, parseWatchClaudeAuthStatus, parseWatchJsonLine, parseWatchJsonProtocolLine, resolveWatchAutoApprovalDecision, resolveWatchCredentialSourceResolution, resolveWatchInteractionAutoResponse, resolveWatchQuestionAnswer, shouldAttemptCloudCredentialProbe, WATCH_EVENTS_FILE_NAME, WATCH_HOME_DIRNAME, WATCH_SESSIONS_DIRNAME, WATCH_SESSION_FILE_NAME, } from './watch/index.js';
|
|
70
|
+
export { aiConfigModelRef, aiConfigModelUri, aiConfigProviderRef, aiConfigProviderUri, buildAIConfigDisconnectPlan, buildAIConfigMutationPlan, buildAIConfigProviderStateMap, getAIConfigDefaultBaseUrl, getAIConfigProviderCatalog, getAIConfigProviderFamilyIds, getAIConfigProviderMetadata, getDefaultAIConfigCredentialId, normalizeAIConfigProviderId, normalizeAIConfigModelId, normalizeAIConfigResourceId, sameAIConfigProviderFamily, selectAIConfigCredential, } from './ai-config/index.js';
|
|
76
71
|
export { applySolidComunicaPatches, } from './comunica-patches.js';
|
|
77
72
|
export { createRepositoryDescriptor, definePodRepository, initSolidResources, initSolidTables, } from './repository.js';
|
|
78
73
|
// Import Job - 导入任务
|
package/dist/message.schema.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { podTable, uri, string, text, timestamp, id } from '@undefineds.co/drizzle-solid';
|
|
2
|
-
import { UDFS, DCTerms, FOAF,
|
|
2
|
+
import { UDFS, DCTerms, FOAF, MEETING, SCHEMA, SIOC, WF } from './namespaces.js';
|
|
3
3
|
import { chatResource } from './chat.schema.js';
|
|
4
4
|
import { threadResource } from './thread.schema.js';
|
|
5
5
|
/**
|
|
@@ -34,14 +34,14 @@ export const messageResource = podTable('chat_message', {
|
|
|
34
34
|
replacedBy: string('replacedBy').predicate(DCTerms.isReplacedBy),
|
|
35
35
|
deletedAt: timestamp('deletedAt').predicate(SCHEMA.dateDeleted),
|
|
36
36
|
// Group message extensions
|
|
37
|
-
senderName: string('senderName').predicate(
|
|
38
|
-
senderAvatarUrl: uri('senderAvatarUrl').predicate(
|
|
39
|
-
mentions: uri('mentions').array().predicate(
|
|
40
|
-
replyTo: uri('replyTo').predicate(
|
|
37
|
+
senderName: string('senderName').predicate(UDFS.senderName),
|
|
38
|
+
senderAvatarUrl: uri('senderAvatarUrl').predicate(UDFS.senderAvatarUrl),
|
|
39
|
+
mentions: uri('mentions').array().predicate(UDFS.mentions),
|
|
40
|
+
replyTo: uri('replyTo').predicate(UDFS.replyTo),
|
|
41
41
|
// Multi-AI routing
|
|
42
|
-
routedBy: uri('routedBy').predicate(
|
|
43
|
-
routeTargetAgentId: string('routeTargetAgentId').predicate(
|
|
44
|
-
coordinationId: string('coordinationId').predicate(
|
|
42
|
+
routedBy: uri('routedBy').predicate(UDFS.routedBy),
|
|
43
|
+
routeTargetAgentId: string('routeTargetAgentId').predicate(UDFS.routeTargetAgentId),
|
|
44
|
+
coordinationId: string('coordinationId').predicate(UDFS.coordinationId),
|
|
45
45
|
createdAt: timestamp('createdAt').predicate(DCTerms.created).notNull().defaultNow(),
|
|
46
46
|
updatedAt: timestamp('updatedAt').predicate(DCTerms.modified),
|
|
47
47
|
}, {
|
package/dist/namespaces.d.ts
CHANGED
|
@@ -171,8 +171,5 @@ export declare const WF: NamespaceObject;
|
|
|
171
171
|
export declare const AS: NamespaceObject;
|
|
172
172
|
export declare const UDFS: NamespaceObject;
|
|
173
173
|
export declare const UDFS_NAMESPACE: string;
|
|
174
|
-
export declare const LINQ: NamespaceObject;
|
|
175
|
-
export declare const LINX_CHAT: NamespaceObject;
|
|
176
|
-
export declare const LINX_MSG: NamespaceObject;
|
|
177
174
|
export declare const XPOD_CREDENTIAL: NamespaceObject;
|
|
178
175
|
export declare const XPOD_AI: NamespaceObject;
|