@noetic-tools/types 3.2.0 → 3.2.2
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 +3 -3
- package/dist/errors/noetic-error.js +7 -7
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/schemas/workflow.d.ts +131 -61
- package/dist/schemas/workflow.js +129 -76
- package/dist/types/acp.d.ts +525 -0
- package/dist/types/acp.js +101 -0
- package/dist/types/common.d.ts +12 -0
- package/dist/types/context-harness.d.ts +172 -0
- package/dist/types/context.d.ts +7 -174
- package/dist/types/error.d.ts +5 -4
- package/dist/types/harness-result.d.ts +6 -0
- package/dist/types/observability.d.ts +2 -1
- package/dist/types/output-codec.d.ts +6 -6
- package/dist/types/output-codec.js +4 -4
- package/dist/types/runtime.d.ts +32 -11
- package/dist/types/steering.d.ts +2 -1
- package/dist/types/step.d.ts +68 -53
- package/dist/types/tool-context.d.ts +0 -7
- package/dist/util/message-helpers.js +8 -1
- package/package.json +2 -1
- package/dist/deprecated.d.ts +0 -39
- package/dist/types/sub-harness.d.ts +0 -273
- package/dist/types/sub-harness.js +0 -106
- /package/dist/{deprecated.js → types/context-harness.js} +0 -0
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Coding-agent harness contract.
|
|
3
|
-
*
|
|
4
|
-
* A "harness" here is a pluggable backend that drives an external agentic
|
|
5
|
-
* coding tool — Claude Code, Codex, opencode, pi — as a Noetic step. It is the
|
|
6
|
-
* direct analogue of the `ContextLayer` contract: defined in the dependency-free
|
|
7
|
-
* `@noetic-tools/types` foundation so both `@noetic-tools/core` (which executes
|
|
8
|
-
* harness steps) and the per-tool `@noetic-tools/sub-harness-*` packages (which
|
|
9
|
-
* implement them) can depend on it without forming a cycle.
|
|
10
|
-
*
|
|
11
|
-
* Modelled on Vercel's `HarnessV1` spec: a tagged spec version, a small set of
|
|
12
|
-
* descriptive fields, and a single `doStart` entry point that yields a session.
|
|
13
|
-
* Optional capabilities are signalled by the presence of optional methods, not
|
|
14
|
-
* a static capabilities object — an adapter that cannot satisfy a request
|
|
15
|
-
* throws {@link SubHarnessCapabilityError} from the relevant method.
|
|
16
|
-
*/
|
|
17
|
-
import { z } from 'zod';
|
|
18
|
-
//#region Step-kind discriminator
|
|
19
|
-
/**
|
|
20
|
-
* The set of harness step kinds. Each value is a distinct `Step.kind`, so a
|
|
21
|
-
* `step.claudeCode(...)` and a `step.codex(...)` are separate, individually
|
|
22
|
-
* typed step variants — while the interpreter routes all of them through a
|
|
23
|
-
* single shared `executeSubHarness` handler.
|
|
24
|
-
* @public
|
|
25
|
-
*/
|
|
26
|
-
export const SubHarnessKind = {
|
|
27
|
-
ClaudeCode: 'claude-code',
|
|
28
|
-
Codex: 'codex',
|
|
29
|
-
Opencode: 'opencode',
|
|
30
|
-
Pi: 'pi',
|
|
31
|
-
};
|
|
32
|
-
/** @public Ordered list of every harness kind — the single source of truth consumed by the JSON schema and the interpreter. */
|
|
33
|
-
export const SUB_HARNESS_KINDS = [
|
|
34
|
-
SubHarnessKind.ClaudeCode,
|
|
35
|
-
SubHarnessKind.Codex,
|
|
36
|
-
SubHarnessKind.Opencode,
|
|
37
|
-
SubHarnessKind.Pi,
|
|
38
|
-
];
|
|
39
|
-
const HarnessFinishReasonSchema = z.enum([
|
|
40
|
-
'stop',
|
|
41
|
-
'length',
|
|
42
|
-
'aborted',
|
|
43
|
-
'error',
|
|
44
|
-
'tool-calls',
|
|
45
|
-
]);
|
|
46
|
-
const TokenUsageSchema = z.object({
|
|
47
|
-
input: z.number(),
|
|
48
|
-
output: z.number(),
|
|
49
|
-
total: z.number().optional(),
|
|
50
|
-
cached: z.number().optional(),
|
|
51
|
-
});
|
|
52
|
-
/**
|
|
53
|
-
* Runtime validation schema for {@link SubHarnessStreamPart}. Adapters that move
|
|
54
|
-
* events across a process or transport boundary (e.g. a sandbox bridge)
|
|
55
|
-
* validate with this before forwarding.
|
|
56
|
-
* @public
|
|
57
|
-
*/
|
|
58
|
-
export const SubHarnessStreamPartSchema = z.discriminatedUnion('type', [
|
|
59
|
-
z.object({
|
|
60
|
-
type: z.literal('stream-start'),
|
|
61
|
-
}),
|
|
62
|
-
z.object({
|
|
63
|
-
type: z.literal('text-delta'),
|
|
64
|
-
delta: z.string(),
|
|
65
|
-
}),
|
|
66
|
-
z.object({
|
|
67
|
-
type: z.literal('reasoning-delta'),
|
|
68
|
-
delta: z.string(),
|
|
69
|
-
}),
|
|
70
|
-
z.object({
|
|
71
|
-
type: z.literal('tool-call'),
|
|
72
|
-
toolCallId: z.string(),
|
|
73
|
-
toolName: z.string(),
|
|
74
|
-
input: z.unknown(),
|
|
75
|
-
/** True when the underlying agent executed the tool itself (vs. host dispatch). */
|
|
76
|
-
providerExecuted: z.boolean().optional(),
|
|
77
|
-
}),
|
|
78
|
-
z.object({
|
|
79
|
-
type: z.literal('tool-result'),
|
|
80
|
-
toolCallId: z.string(),
|
|
81
|
-
toolName: z.string(),
|
|
82
|
-
output: z.unknown(),
|
|
83
|
-
isError: z.boolean().optional(),
|
|
84
|
-
}),
|
|
85
|
-
z.object({
|
|
86
|
-
type: z.literal('file-change'),
|
|
87
|
-
path: z.string().optional(),
|
|
88
|
-
summary: z.string().optional(),
|
|
89
|
-
}),
|
|
90
|
-
z.object({
|
|
91
|
-
type: z.literal('finish'),
|
|
92
|
-
finishReason: HarnessFinishReasonSchema,
|
|
93
|
-
usage: TokenUsageSchema.optional(),
|
|
94
|
-
cost: z.number().optional(),
|
|
95
|
-
}),
|
|
96
|
-
z.object({
|
|
97
|
-
type: z.literal('error'),
|
|
98
|
-
error: z.string(),
|
|
99
|
-
}),
|
|
100
|
-
/** Adapter-specific passthrough for events with no canonical mapping. */
|
|
101
|
-
z.object({
|
|
102
|
-
type: z.literal('raw'),
|
|
103
|
-
value: z.unknown(),
|
|
104
|
-
}),
|
|
105
|
-
]);
|
|
106
|
-
//#endregion
|
|
File without changes
|