zeitlich 0.2.15 → 0.2.16
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 +50 -0
- package/dist/adapters/sandbox/daytona/index.cjs +52 -23
- package/dist/adapters/sandbox/daytona/index.cjs.map +1 -1
- package/dist/adapters/sandbox/daytona/index.d.cts +10 -2
- package/dist/adapters/sandbox/daytona/index.d.ts +10 -2
- package/dist/adapters/sandbox/daytona/index.js +52 -23
- package/dist/adapters/sandbox/daytona/index.js.map +1 -1
- package/dist/adapters/sandbox/inmemory/index.cjs +21 -16
- package/dist/adapters/sandbox/inmemory/index.cjs.map +1 -1
- package/dist/adapters/sandbox/inmemory/index.d.cts +1 -1
- package/dist/adapters/sandbox/inmemory/index.d.ts +1 -1
- package/dist/adapters/sandbox/inmemory/index.js +21 -16
- package/dist/adapters/sandbox/inmemory/index.js.map +1 -1
- package/dist/adapters/sandbox/virtual/index.cjs +38 -38
- package/dist/adapters/sandbox/virtual/index.cjs.map +1 -1
- package/dist/adapters/sandbox/virtual/index.d.cts +6 -6
- package/dist/adapters/sandbox/virtual/index.d.ts +6 -6
- package/dist/adapters/sandbox/virtual/index.js +37 -37
- package/dist/adapters/sandbox/virtual/index.js.map +1 -1
- package/dist/adapters/thread/google-genai/index.d.cts +2 -2
- package/dist/adapters/thread/google-genai/index.d.ts +2 -2
- package/dist/adapters/thread/langchain/index.d.cts +2 -2
- package/dist/adapters/thread/langchain/index.d.ts +2 -2
- package/dist/index.cjs +2 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/{types-CDubRtad.d.cts → types-BMRzfELQ.d.cts} +2 -0
- package/dist/{types-CDubRtad.d.ts → types-BMRzfELQ.d.ts} +2 -0
- package/dist/{types-CwwgQ_9H.d.ts → types-BSOte_8s.d.ts} +6 -2
- package/dist/{types-BVP87m_W.d.cts → types-DCi2qXjN.d.cts} +6 -2
- package/dist/{types-Dje1TdH6.d.cts → types-Drli9aCK.d.cts} +1 -1
- package/dist/{types-BWvIYK28.d.ts → types-XPtivmSJ.d.ts} +1 -1
- package/dist/workflow.cjs +2 -3
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.d.cts +6 -6
- package/dist/workflow.d.ts +6 -6
- package/dist/workflow.js +2 -3
- package/dist/workflow.js.map +1 -1
- package/package.json +1 -1
- package/src/adapters/sandbox/daytona/filesystem.ts +43 -19
- package/src/adapters/sandbox/daytona/index.ts +16 -3
- package/src/adapters/sandbox/daytona/types.ts +4 -0
- package/src/adapters/sandbox/inmemory/index.ts +22 -16
- package/src/adapters/sandbox/virtual/filesystem.ts +29 -31
- package/src/adapters/sandbox/virtual/index.ts +5 -3
- package/src/adapters/sandbox/virtual/provider.ts +5 -2
- package/src/adapters/sandbox/virtual/types.ts +3 -0
- package/src/adapters/sandbox/virtual/with-virtual-sandbox.ts +4 -3
- package/src/lib/sandbox/tree.integration.test.ts +153 -0
- package/src/lib/sandbox/types.ts +2 -0
- package/src/lib/session/session-edge-cases.integration.test.ts +962 -0
- package/src/lib/session/session.integration.test.ts +852 -0
- package/src/lib/session/session.ts +5 -4
- package/src/lib/skills/skills.integration.test.ts +308 -0
- package/src/lib/state/manager.integration.test.ts +342 -0
- package/src/lib/subagent/subagent.integration.test.ts +467 -0
- package/src/lib/thread/id.test.ts +50 -0
- package/src/lib/tool-router/auto-append-sandbox.integration.test.ts +344 -0
- package/src/lib/tool-router/router-edge-cases.integration.test.ts +623 -0
- package/src/lib/tool-router/router.integration.test.ts +699 -0
- package/src/lib/types.test.ts +29 -0
|
@@ -20,6 +20,8 @@ interface FileStat {
|
|
|
20
20
|
* {@link SandboxNotSupportedError}.
|
|
21
21
|
*/
|
|
22
22
|
interface SandboxFileSystem {
|
|
23
|
+
/** Base directory used when resolving relative paths. */
|
|
24
|
+
readonly workspaceBase: string;
|
|
23
25
|
readFile(path: string): Promise<string>;
|
|
24
26
|
readFileBuffer(path: string): Promise<Uint8Array>;
|
|
25
27
|
writeFile(path: string, content: string | Uint8Array): Promise<void>;
|
|
@@ -20,6 +20,8 @@ interface FileStat {
|
|
|
20
20
|
* {@link SandboxNotSupportedError}.
|
|
21
21
|
*/
|
|
22
22
|
interface SandboxFileSystem {
|
|
23
|
+
/** Base directory used when resolving relative paths. */
|
|
24
|
+
readonly workspaceBase: string;
|
|
23
25
|
readFile(path: string): Promise<string>;
|
|
24
26
|
readFileBuffer(path: string): Promise<Uint8Array>;
|
|
25
27
|
writeFile(path: string, content: string | Uint8Array): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SandboxFileSystem, F as FileStat, D as DirentEntry, S as Sandbox, d as SandboxCreateOptions } from './types-
|
|
1
|
+
import { a as SandboxFileSystem, F as FileStat, D as DirentEntry, S as Sandbox, d as SandboxCreateOptions } from './types-BMRzfELQ.js';
|
|
2
2
|
import { R as RouterContext } from './types-BMXzv7TN.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -11,10 +11,11 @@ import { R as RouterContext } from './types-BMXzv7TN.js';
|
|
|
11
11
|
declare class VirtualSandboxFileSystem<TCtx = unknown, TMeta = FileEntryMetadata> implements SandboxFileSystem {
|
|
12
12
|
private resolver;
|
|
13
13
|
private ctx;
|
|
14
|
+
readonly workspaceBase: string;
|
|
14
15
|
private entries;
|
|
15
16
|
private directories;
|
|
16
17
|
private mutations;
|
|
17
|
-
constructor(tree: FileEntry<TMeta>[], resolver: FileResolver<TCtx, TMeta>, ctx: TCtx);
|
|
18
|
+
constructor(tree: FileEntry<TMeta>[], resolver: FileResolver<TCtx, TMeta>, ctx: TCtx, workspaceBase?: string);
|
|
18
19
|
/** Return all mutations accumulated during this invocation. */
|
|
19
20
|
getMutations(): TreeMutation<TMeta>[];
|
|
20
21
|
/** Look up a file entry by virtual path. */
|
|
@@ -93,6 +94,8 @@ interface FileResolver<TCtx = unknown, TMeta = FileEntryMetadata> {
|
|
|
93
94
|
*/
|
|
94
95
|
interface VirtualSandboxCreateOptions<TCtx> extends SandboxCreateOptions {
|
|
95
96
|
resolverContext: TCtx;
|
|
97
|
+
/** Base path for resolving relative filesystem paths (default "/"). */
|
|
98
|
+
workspaceBase?: string;
|
|
96
99
|
}
|
|
97
100
|
/**
|
|
98
101
|
* The portion of workflow `AgentState` that the virtual sandbox reads via
|
|
@@ -103,6 +106,7 @@ interface VirtualSandboxState<TCtx = unknown, TMeta = FileEntryMetadata> {
|
|
|
103
106
|
sandboxId: string;
|
|
104
107
|
fileTree: FileEntry<TMeta>[];
|
|
105
108
|
resolverContext: TCtx;
|
|
109
|
+
workspaceBase?: string;
|
|
106
110
|
}
|
|
107
111
|
/**
|
|
108
112
|
* A {@link Sandbox} whose filesystem is backed by a {@link VirtualSandboxFileSystem}.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as SandboxFileSystem, F as FileStat, D as DirentEntry, S as Sandbox, d as SandboxCreateOptions } from './types-
|
|
1
|
+
import { a as SandboxFileSystem, F as FileStat, D as DirentEntry, S as Sandbox, d as SandboxCreateOptions } from './types-BMRzfELQ.cjs';
|
|
2
2
|
import { R as RouterContext } from './types-BMXzv7TN.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -11,10 +11,11 @@ import { R as RouterContext } from './types-BMXzv7TN.cjs';
|
|
|
11
11
|
declare class VirtualSandboxFileSystem<TCtx = unknown, TMeta = FileEntryMetadata> implements SandboxFileSystem {
|
|
12
12
|
private resolver;
|
|
13
13
|
private ctx;
|
|
14
|
+
readonly workspaceBase: string;
|
|
14
15
|
private entries;
|
|
15
16
|
private directories;
|
|
16
17
|
private mutations;
|
|
17
|
-
constructor(tree: FileEntry<TMeta>[], resolver: FileResolver<TCtx, TMeta>, ctx: TCtx);
|
|
18
|
+
constructor(tree: FileEntry<TMeta>[], resolver: FileResolver<TCtx, TMeta>, ctx: TCtx, workspaceBase?: string);
|
|
18
19
|
/** Return all mutations accumulated during this invocation. */
|
|
19
20
|
getMutations(): TreeMutation<TMeta>[];
|
|
20
21
|
/** Look up a file entry by virtual path. */
|
|
@@ -93,6 +94,8 @@ interface FileResolver<TCtx = unknown, TMeta = FileEntryMetadata> {
|
|
|
93
94
|
*/
|
|
94
95
|
interface VirtualSandboxCreateOptions<TCtx> extends SandboxCreateOptions {
|
|
95
96
|
resolverContext: TCtx;
|
|
97
|
+
/** Base path for resolving relative filesystem paths (default "/"). */
|
|
98
|
+
workspaceBase?: string;
|
|
96
99
|
}
|
|
97
100
|
/**
|
|
98
101
|
* The portion of workflow `AgentState` that the virtual sandbox reads via
|
|
@@ -103,6 +106,7 @@ interface VirtualSandboxState<TCtx = unknown, TMeta = FileEntryMetadata> {
|
|
|
103
106
|
sandboxId: string;
|
|
104
107
|
fileTree: FileEntry<TMeta>[];
|
|
105
108
|
resolverContext: TCtx;
|
|
109
|
+
workspaceBase?: string;
|
|
106
110
|
}
|
|
107
111
|
/**
|
|
108
112
|
* A {@link Sandbox} whose filesystem is backed by a {@link VirtualSandboxFileSystem}.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Duration } from '@temporalio/common';
|
|
2
2
|
import { a as ToolMap, b as ToolRouterHooks, M as MessageContent, S as SessionExitReason, c as ToolHandlerResponse, P as PreToolUseHookResult, d as PostToolUseFailureHookResult, e as RawToolCall, f as TokenUsage, B as BaseAgentState, g as RunAgentConfig, h as AgentStatus, W as WorkflowTask, i as ToolDefinition, j as ToolResultConfig, k as ToolCallResultUnion, I as InferToolResults } from './types-BMXzv7TN.cjs';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { g as SandboxOps } from './types-
|
|
4
|
+
import { g as SandboxOps } from './types-BMRzfELQ.cjs';
|
|
5
5
|
import { QueryDefinition } from '@temporalio/workflow';
|
|
6
6
|
import { UpdateDefinition } from '@temporalio/common/lib/interfaces';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Duration } from '@temporalio/common';
|
|
2
2
|
import { a as ToolMap, b as ToolRouterHooks, M as MessageContent, S as SessionExitReason, c as ToolHandlerResponse, P as PreToolUseHookResult, d as PostToolUseFailureHookResult, e as RawToolCall, f as TokenUsage, B as BaseAgentState, g as RunAgentConfig, h as AgentStatus, W as WorkflowTask, i as ToolDefinition, j as ToolResultConfig, k as ToolCallResultUnion, I as InferToolResults } from './types-BMXzv7TN.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { g as SandboxOps } from './types-
|
|
4
|
+
import { g as SandboxOps } from './types-BMRzfELQ.js';
|
|
5
5
|
import { QueryDefinition } from '@temporalio/workflow';
|
|
6
6
|
import { UpdateDefinition } from '@temporalio/common/lib/interfaces';
|
|
7
7
|
|
package/dist/workflow.cjs
CHANGED
|
@@ -559,9 +559,7 @@ var createSession = async ({
|
|
|
559
559
|
const result = await sandboxOps.createSandbox({ id: threadId });
|
|
560
560
|
sandboxId = result.sandboxId;
|
|
561
561
|
if (result.stateUpdate) {
|
|
562
|
-
stateManager.mergeUpdate(
|
|
563
|
-
result.stateUpdate
|
|
564
|
-
);
|
|
562
|
+
stateManager.mergeUpdate(result.stateUpdate);
|
|
565
563
|
}
|
|
566
564
|
}
|
|
567
565
|
if (hooks.onSessionStart) {
|
|
@@ -646,6 +644,7 @@ var createSession = async ({
|
|
|
646
644
|
);
|
|
647
645
|
if (!conditionMet) {
|
|
648
646
|
stateManager.cancel();
|
|
647
|
+
exitReason = "cancelled";
|
|
649
648
|
await workflow.condition(() => false, "2s");
|
|
650
649
|
break;
|
|
651
650
|
}
|