@exulu/backend 5.20.0 → 5.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -2238,6 +2238,43 @@ type ContextLike = {
2238
2238
  } | null | undefined;
2239
2239
  declare function checkMemoryBase(context: ContextLike): MemoryBaseCheck;
2240
2240
 
2241
+ /**
2242
+ * `artifacts.read(name)` — how a tool reads a shared artifact.
2243
+ *
2244
+ * A template that a tool fills (an .xlsx, a .docx) belongs to the customer,
2245
+ * and the customer replaces it in the Artifacts screen. The tool reads it by
2246
+ * NAME through this helper instead of holding an object key, so a replaced
2247
+ * file is picked up on the next call.
2248
+ *
2249
+ * Two things happen here that a tool should not do by hand:
2250
+ *
2251
+ * - The read is checked against the CALLING user, with the same rule the
2252
+ * content route applies. A tool is not a way around an artifact's access
2253
+ * settings.
2254
+ * - The read is recorded on the artifact (`used_by`). That is what the
2255
+ * Artifacts screen shows as "used by" — written by the act of using, so
2256
+ * nobody has to keep it up to date.
2257
+ *
2258
+ * Both callers that run a tool build it: the agent path
2259
+ * (convert-exulu-tools-to-ai-sdk-tools.ts) and POST /tools/:id
2260
+ * (tool-api-route.ts). Same reason as tool-upload.ts.
2261
+ */
2262
+
2263
+ type ArtifactReadResult = {
2264
+ name: string;
2265
+ filename: string;
2266
+ contentType: string | null;
2267
+ bytes: Uint8Array;
2268
+ };
2269
+ declare class ArtifactReadError extends Error {
2270
+ readonly code: "not_found" | "expired" | "forbidden" | "missing_file";
2271
+ constructor(code: "not_found" | "expired" | "forbidden" | "missing_file", message: string);
2272
+ }
2273
+ type ToolArtifacts = {
2274
+ /** Throws ArtifactReadError; never returns partial data. */
2275
+ read: (name: string) => Promise<ArtifactReadResult>;
2276
+ };
2277
+
2241
2278
  /**
2242
2279
  * Switch this process into LiteLLM *client* mode: it connects to an
2243
2280
  * externally-managed proxy (spawned by the Exulu HTTP server process, or a
@@ -3001,4 +3038,4 @@ declare const ExuluPython: {
3001
3038
  instructions: typeof getPythonSetupInstructions;
3002
3039
  };
3003
3040
 
3004
- export { type AuditConfig, type AuditEvent, type AuditLogger, type ChunkerOperation, type ChunkerResponse, type CredentialField, CredentialInvalidError, type JOB_STATUS as EXULU_JOB_STATUS, JOB_STATUS_ENUM as EXULU_JOB_STATUS_ENUM, type STATISTICS_TYPE as EXULU_STATISTICS_TYPE, STATISTICS_TYPE_ENUM as EXULU_STATISTICS_TYPE_ENUM, type ExuluAgent, ExuluApp, type ExuluAuthConfig, ExuluAuthentication, ExuluChunkers, ExuluContext, type ExuluContextEmbedder, type ExuluCredentialsToolContext, ExuluDatabase, ExuluDefaultTools, ExuluDocumentProcessor, ExuluEval, type Item as ExuluItem, ExuluJobs, ExuluModels, type ExuluOauthConfig, type ExuluOauthToolContext, ExuluOtel, ExuluProjects, ExuluPython, queues as ExuluQueues, ExuluReadApi, ExuluRecall, ExuluReranker, ExuluTool, type ExuluUserCredentialsConfig, ExuluVariables, PROJECTION_VERSION, type RoutineHandle, type RoutineRunPatch, type VectorSearchChunkResult, backfillCoordinates, checkMemoryBase, defaultChunker, enableLiteLLMClientMode, fitContextProjection, listFittableContexts, postgresClient, recallMemories };
3041
+ export { ArtifactReadError, type ArtifactReadResult, type AuditConfig, type AuditEvent, type AuditLogger, type ChunkerOperation, type ChunkerResponse, type CredentialField, CredentialInvalidError, type JOB_STATUS as EXULU_JOB_STATUS, JOB_STATUS_ENUM as EXULU_JOB_STATUS_ENUM, type STATISTICS_TYPE as EXULU_STATISTICS_TYPE, STATISTICS_TYPE_ENUM as EXULU_STATISTICS_TYPE_ENUM, type ExuluAgent, ExuluApp, type ExuluAuthConfig, ExuluAuthentication, ExuluChunkers, ExuluContext, type ExuluContextEmbedder, type ExuluCredentialsToolContext, ExuluDatabase, ExuluDefaultTools, ExuluDocumentProcessor, ExuluEval, type Item as ExuluItem, ExuluJobs, ExuluModels, type ExuluOauthConfig, type ExuluOauthToolContext, ExuluOtel, ExuluProjects, ExuluPython, queues as ExuluQueues, ExuluReadApi, ExuluRecall, ExuluReranker, ExuluTool, type ExuluUserCredentialsConfig, ExuluVariables, PROJECTION_VERSION, type RoutineHandle, type RoutineRunPatch, type ToolArtifacts, type VectorSearchChunkResult, backfillCoordinates, checkMemoryBase, defaultChunker, enableLiteLLMClientMode, fitContextProjection, listFittableContexts, postgresClient, recallMemories };
package/dist/index.d.ts CHANGED
@@ -2238,6 +2238,43 @@ type ContextLike = {
2238
2238
  } | null | undefined;
2239
2239
  declare function checkMemoryBase(context: ContextLike): MemoryBaseCheck;
2240
2240
 
2241
+ /**
2242
+ * `artifacts.read(name)` — how a tool reads a shared artifact.
2243
+ *
2244
+ * A template that a tool fills (an .xlsx, a .docx) belongs to the customer,
2245
+ * and the customer replaces it in the Artifacts screen. The tool reads it by
2246
+ * NAME through this helper instead of holding an object key, so a replaced
2247
+ * file is picked up on the next call.
2248
+ *
2249
+ * Two things happen here that a tool should not do by hand:
2250
+ *
2251
+ * - The read is checked against the CALLING user, with the same rule the
2252
+ * content route applies. A tool is not a way around an artifact's access
2253
+ * settings.
2254
+ * - The read is recorded on the artifact (`used_by`). That is what the
2255
+ * Artifacts screen shows as "used by" — written by the act of using, so
2256
+ * nobody has to keep it up to date.
2257
+ *
2258
+ * Both callers that run a tool build it: the agent path
2259
+ * (convert-exulu-tools-to-ai-sdk-tools.ts) and POST /tools/:id
2260
+ * (tool-api-route.ts). Same reason as tool-upload.ts.
2261
+ */
2262
+
2263
+ type ArtifactReadResult = {
2264
+ name: string;
2265
+ filename: string;
2266
+ contentType: string | null;
2267
+ bytes: Uint8Array;
2268
+ };
2269
+ declare class ArtifactReadError extends Error {
2270
+ readonly code: "not_found" | "expired" | "forbidden" | "missing_file";
2271
+ constructor(code: "not_found" | "expired" | "forbidden" | "missing_file", message: string);
2272
+ }
2273
+ type ToolArtifacts = {
2274
+ /** Throws ArtifactReadError; never returns partial data. */
2275
+ read: (name: string) => Promise<ArtifactReadResult>;
2276
+ };
2277
+
2241
2278
  /**
2242
2279
  * Switch this process into LiteLLM *client* mode: it connects to an
2243
2280
  * externally-managed proxy (spawned by the Exulu HTTP server process, or a
@@ -3001,4 +3038,4 @@ declare const ExuluPython: {
3001
3038
  instructions: typeof getPythonSetupInstructions;
3002
3039
  };
3003
3040
 
3004
- export { type AuditConfig, type AuditEvent, type AuditLogger, type ChunkerOperation, type ChunkerResponse, type CredentialField, CredentialInvalidError, type JOB_STATUS as EXULU_JOB_STATUS, JOB_STATUS_ENUM as EXULU_JOB_STATUS_ENUM, type STATISTICS_TYPE as EXULU_STATISTICS_TYPE, STATISTICS_TYPE_ENUM as EXULU_STATISTICS_TYPE_ENUM, type ExuluAgent, ExuluApp, type ExuluAuthConfig, ExuluAuthentication, ExuluChunkers, ExuluContext, type ExuluContextEmbedder, type ExuluCredentialsToolContext, ExuluDatabase, ExuluDefaultTools, ExuluDocumentProcessor, ExuluEval, type Item as ExuluItem, ExuluJobs, ExuluModels, type ExuluOauthConfig, type ExuluOauthToolContext, ExuluOtel, ExuluProjects, ExuluPython, queues as ExuluQueues, ExuluReadApi, ExuluRecall, ExuluReranker, ExuluTool, type ExuluUserCredentialsConfig, ExuluVariables, PROJECTION_VERSION, type RoutineHandle, type RoutineRunPatch, type VectorSearchChunkResult, backfillCoordinates, checkMemoryBase, defaultChunker, enableLiteLLMClientMode, fitContextProjection, listFittableContexts, postgresClient, recallMemories };
3041
+ export { ArtifactReadError, type ArtifactReadResult, type AuditConfig, type AuditEvent, type AuditLogger, type ChunkerOperation, type ChunkerResponse, type CredentialField, CredentialInvalidError, type JOB_STATUS as EXULU_JOB_STATUS, JOB_STATUS_ENUM as EXULU_JOB_STATUS_ENUM, type STATISTICS_TYPE as EXULU_STATISTICS_TYPE, STATISTICS_TYPE_ENUM as EXULU_STATISTICS_TYPE_ENUM, type ExuluAgent, ExuluApp, type ExuluAuthConfig, ExuluAuthentication, ExuluChunkers, ExuluContext, type ExuluContextEmbedder, type ExuluCredentialsToolContext, ExuluDatabase, ExuluDefaultTools, ExuluDocumentProcessor, ExuluEval, type Item as ExuluItem, ExuluJobs, ExuluModels, type ExuluOauthConfig, type ExuluOauthToolContext, ExuluOtel, ExuluProjects, ExuluPython, queues as ExuluQueues, ExuluReadApi, ExuluRecall, ExuluReranker, ExuluTool, type ExuluUserCredentialsConfig, ExuluVariables, PROJECTION_VERSION, type RoutineHandle, type RoutineRunPatch, type ToolArtifacts, type VectorSearchChunkResult, backfillCoordinates, checkMemoryBase, defaultChunker, enableLiteLLMClientMode, fitContextProjection, listFittableContexts, postgresClient, recallMemories };