@inflexa-ai/harness 0.47.0 → 0.48.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.
- package/README.md +1 -1
- package/dist/agents/conversation-agent.d.ts +6 -0
- package/dist/agents/conversation-agent.js +2 -0
- package/dist/agents/report-session-agent.d.ts +3 -0
- package/dist/agents/report-session-agent.js +13 -12
- package/dist/index.d.ts +5 -3
- package/dist/index.js +3 -2
- package/dist/lib/hooks.d.ts +1 -1
- package/dist/loop/chat-stream.js +2 -1
- package/dist/loop/types.d.ts +5 -0
- package/dist/prompts/report-session.d.ts +1 -1
- package/dist/prompts/report-session.js +7 -5
- package/dist/runtime/assemble.d.ts +13 -4
- package/dist/runtime/assemble.js +2 -0
- package/dist/runtime/dbos.d.ts +6 -0
- package/dist/runtime/dbos.js +14 -2
- package/dist/state/artifacts.d.ts +4 -1
- package/dist/state/artifacts.js +4 -1
- package/dist/state/index.d.ts +4 -4
- package/dist/state/index.js +2 -2
- package/dist/state/plans.d.ts +27 -0
- package/dist/state/plans.js +57 -3
- package/dist/state/step-executions.d.ts +13 -0
- package/dist/state/step-executions.js +22 -0
- package/dist/tools/report-authoring/authoring-tools.d.ts +2 -2
- package/dist/tools/report-authoring/authoring-tools.js +31 -6
- package/dist/tools/report-session/script-tools.d.ts +3 -0
- package/dist/tools/report-session/script-tools.js +10 -1
- package/dist/tools/script/archive.d.ts +34 -0
- package/dist/tools/script/archive.js +182 -0
- package/dist/tools/script/file-tools.d.ts +10 -4
- package/dist/tools/script/file-tools.js +156 -42
- package/dist/tools/script/metrics.d.ts +10 -1
- package/dist/tools/script/metrics.js +17 -2
- package/dist/tools/script/run-script.js +91 -4
- package/dist/tools/script/scratch.d.ts +3 -0
- package/dist/tools/script/scratch.js +7 -4
- package/dist/tools/workspace/mutator.d.ts +3 -0
- package/dist/tools/workspace/mutator.js +11 -1
- package/dist/workspace/session-files.d.ts +35 -0
- package/dist/workspace/session-files.js +16 -0
- package/package.json +2 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The files that a session writes outside a run, and the host hook that keeps a copy of each.
|
|
3
|
+
*
|
|
4
|
+
* A run registers its step files through `ArtifactRegistry`. A chat thread and a report session write files too:
|
|
5
|
+
* the scripts and the derived files of `run_script`, and the files of `write_file` and `edit_file`. A host that
|
|
6
|
+
* keeps the files of an analysis elsewhere binds `syncSessionFile`, and each write reaches it with its bytes. The
|
|
7
|
+
* call runs inside the tool step of the write, thus a step that runs again after a crash calls the hook again with
|
|
8
|
+
* the same file.
|
|
9
|
+
*/
|
|
10
|
+
import type { ResultAsync } from "neverthrow";
|
|
11
|
+
import type { AgentSession } from "../auth/types.js";
|
|
12
|
+
import { type NoticeFailure } from "../lib/hooks.js";
|
|
13
|
+
import type { Logger } from "../lib/logger.js";
|
|
14
|
+
/** Who owns a session file. A file in the scratch directory of a thread belongs to that thread. */
|
|
15
|
+
export type SessionFileOwner = {
|
|
16
|
+
readonly kind: "thread";
|
|
17
|
+
readonly threadId: string;
|
|
18
|
+
} | {
|
|
19
|
+
readonly kind: "analysis";
|
|
20
|
+
};
|
|
21
|
+
export type SessionFileWrite = {
|
|
22
|
+
/** The session of the tool call that wrote the file. */
|
|
23
|
+
readonly session: AgentSession;
|
|
24
|
+
readonly owner: SessionFileOwner;
|
|
25
|
+
/** The analysis-relative path, and the hash and the size of the bytes. */
|
|
26
|
+
readonly path: string;
|
|
27
|
+
readonly hash: string;
|
|
28
|
+
readonly size: number;
|
|
29
|
+
/** The exact bytes that landed. */
|
|
30
|
+
readonly content: Uint8Array;
|
|
31
|
+
};
|
|
32
|
+
/** A notice: a failure is logged, and the write stays done. */
|
|
33
|
+
export type SyncSessionFile = (write: SessionFileWrite) => ResultAsync<void, NoticeFailure>;
|
|
34
|
+
/** Give one landed write to the hook of the host. An unbound hook does nothing. */
|
|
35
|
+
export declare function syncWrittenFile(sync: SyncSessionFile | undefined, logger: Logger, write: SessionFileWrite): Promise<void>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The files that a session writes outside a run, and the host hook that keeps a copy of each.
|
|
3
|
+
*
|
|
4
|
+
* A run registers its step files through `ArtifactRegistry`. A chat thread and a report session write files too:
|
|
5
|
+
* the scripts and the derived files of `run_script`, and the files of `write_file` and `edit_file`. A host that
|
|
6
|
+
* keeps the files of an analysis elsewhere binds `syncSessionFile`, and each write reaches it with its bytes. The
|
|
7
|
+
* call runs inside the tool step of the write, thus a step that runs again after a crash calls the hook again with
|
|
8
|
+
* the same file.
|
|
9
|
+
*/
|
|
10
|
+
import { deliverNotice } from "../lib/hooks.js";
|
|
11
|
+
/** Give one landed write to the hook of the host. An unbound hook does nothing. */
|
|
12
|
+
export async function syncWrittenFile(sync, logger, write) {
|
|
13
|
+
if (sync === undefined)
|
|
14
|
+
return;
|
|
15
|
+
await deliverNotice(logger.with({ analysisId: write.session.scope.analysisId, path: write.path }), "syncSessionFile", sync(write));
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inflexa-ai/harness",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.48.1",
|
|
4
4
|
"description": "Host-agnostic bioinformatics agent harness — an agent loop on the AI SDK, DBOS-durable workflows, sandboxed compute.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -83,6 +83,7 @@
|
|
|
83
83
|
"dockerode": "^4.0.12",
|
|
84
84
|
"echarts": "6.1.0",
|
|
85
85
|
"fast-xml-parser": "^5.10.1",
|
|
86
|
+
"fflate": "^0.8.3",
|
|
86
87
|
"hono": "^4.12.34",
|
|
87
88
|
"hyparquet": "^1.28.1",
|
|
88
89
|
"js-tiktoken": "^1.0.21",
|