@themoltnet/pi-extension 0.22.2 → 0.22.4
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.ts +112 -117
- package/dist/index.js +32 -18
- package/package.json +11 -6
package/dist/index.d.ts
CHANGED
|
@@ -8,24 +8,11 @@ import { LoadSkillsResult } from '@earendil-works/pi-coding-agent';
|
|
|
8
8
|
import { Model } from '@earendil-works/pi-ai';
|
|
9
9
|
import { ReadOperations } from '@earendil-works/pi-coding-agent';
|
|
10
10
|
import { Skill } from '@earendil-works/pi-coding-agent';
|
|
11
|
-
import { Static } from '
|
|
12
|
-
import {
|
|
13
|
-
import { TBoolean } from '@sinclair/typebox';
|
|
14
|
-
import { TInteger } from '@sinclair/typebox';
|
|
15
|
-
import { TLiteral } from '@sinclair/typebox';
|
|
16
|
-
import { TNull } from '@sinclair/typebox';
|
|
17
|
-
import { TNumber } from '@sinclair/typebox';
|
|
18
|
-
import { TObject } from '@sinclair/typebox';
|
|
11
|
+
import { Static } from 'typebox';
|
|
12
|
+
import { TObject } from 'typebox';
|
|
19
13
|
import { ToolDefinition } from '@earendil-works/pi-coding-agent';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { TRecursive } from '@sinclair/typebox';
|
|
23
|
-
import { TRefUnsafe } from '@sinclair/typebox';
|
|
24
|
-
import { TSchema } from '@sinclair/typebox';
|
|
25
|
-
import { TString } from '@sinclair/typebox';
|
|
26
|
-
import { TThis } from '@sinclair/typebox';
|
|
27
|
-
import { TUnion } from '@sinclair/typebox';
|
|
28
|
-
import { TUnknown } from '@sinclair/typebox';
|
|
14
|
+
import { TSchema } from 'typebox';
|
|
15
|
+
import { Type } from 'typebox';
|
|
29
16
|
import { VM } from '@earendil-works/gondolin';
|
|
30
17
|
import { WriteOperations } from '@earendil-works/pi-coding-agent';
|
|
31
18
|
|
|
@@ -74,6 +61,23 @@ declare interface BuildAgentSessionArgs {
|
|
|
74
61
|
};
|
|
75
62
|
}
|
|
76
63
|
|
|
64
|
+
declare type ClaimCondition = {
|
|
65
|
+
op: 'all';
|
|
66
|
+
conditions: ClaimCondition[];
|
|
67
|
+
} | {
|
|
68
|
+
op: 'any';
|
|
69
|
+
conditions: ClaimCondition[];
|
|
70
|
+
} | {
|
|
71
|
+
op: 'task_status';
|
|
72
|
+
taskId: string;
|
|
73
|
+
statuses: TaskStatus[];
|
|
74
|
+
} | {
|
|
75
|
+
op: 'task_accepted';
|
|
76
|
+
taskId: string;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
declare const ClaimCondition: Type.TUnsafe<ClaimCondition>;
|
|
80
|
+
|
|
77
81
|
declare interface ClaimedTask {
|
|
78
82
|
/** The claimed task payload itself. */
|
|
79
83
|
task: Task;
|
|
@@ -105,10 +109,10 @@ declare interface ClaimedTask {
|
|
|
105
109
|
* short example skills, not the kind of skill the eval
|
|
106
110
|
* substrate is dogfooded on (#943, #823).
|
|
107
111
|
*/
|
|
108
|
-
declare const ContextRef: TObject<
|
|
109
|
-
slug: TString;
|
|
110
|
-
binding: TUnion<[TLiteral<"skill">, TLiteral<"context_inline">, TLiteral<"prompt_prefix">, TLiteral<"user_inline">]>;
|
|
111
|
-
content: TString;
|
|
112
|
+
declare const ContextRef: Type.TObject<{
|
|
113
|
+
slug: Type.TString;
|
|
114
|
+
binding: Type.TUnion<[Type.TLiteral<"skill">, Type.TLiteral<"context_inline">, Type.TLiteral<"prompt_prefix">, Type.TLiteral<"user_inline">]>;
|
|
115
|
+
content: Type.TString;
|
|
112
116
|
}>;
|
|
113
117
|
|
|
114
118
|
declare type ContextRef = Static<typeof ContextRef>;
|
|
@@ -671,8 +675,8 @@ export declare interface SubagentToolHandle {
|
|
|
671
675
|
* Resolved at call time; unknown names error.
|
|
672
676
|
*/
|
|
673
677
|
export declare const SubagentToolParameters: TObject<{
|
|
674
|
-
task: TString;
|
|
675
|
-
output_schema: TString;
|
|
678
|
+
task: Type.TString;
|
|
679
|
+
output_schema: Type.TString;
|
|
676
680
|
}>;
|
|
677
681
|
|
|
678
682
|
export declare type SubagentToolParameters = Static<typeof SubagentToolParameters>;
|
|
@@ -684,83 +688,70 @@ export declare type SubagentToolParameters = Static<typeof SubagentToolParameter
|
|
|
684
688
|
* `taskType`. Type-specific payload lives inside `input` (validated
|
|
685
689
|
* against the schema registered for `taskType`).
|
|
686
690
|
*/
|
|
687
|
-
declare const Task: TObject<
|
|
688
|
-
id: TString;
|
|
689
|
-
taskType: TString;
|
|
690
|
-
title: TUnion<[TString, TNull]>;
|
|
691
|
-
tags: TArray<TString>;
|
|
692
|
-
teamId: TString;
|
|
693
|
-
diaryId: TUnion<[TString, TNull]>;
|
|
694
|
-
outputKind: TUnion<[TLiteral<"artifact">, TLiteral<"judgment">]>;
|
|
695
|
-
input: TRecord<
|
|
696
|
-
inputSchemaCid: TString;
|
|
697
|
-
inputCid: TString;
|
|
698
|
-
references: TArray<TObject<
|
|
699
|
-
taskId: TUnion<[TString, TNull]>;
|
|
700
|
-
outputCid: TString;
|
|
701
|
-
role: TUnion<[TLiteral<"judged_work">, TLiteral<"reviewed_diff">, TLiteral<"target_source">, TLiteral<"context">]>;
|
|
702
|
-
external: TOptional<TObject<
|
|
703
|
-
kind: TUnion<[TLiteral<"github_pr">, TLiteral<"github_issue">, TLiteral<"http_url">]>;
|
|
704
|
-
pr: TOptional<TNumber>;
|
|
705
|
-
issue: TOptional<TNumber>;
|
|
706
|
-
url: TOptional<TString>;
|
|
707
|
-
commit_sha: TOptional<TString>;
|
|
708
|
-
snapshot_cid: TOptional<TString>;
|
|
691
|
+
declare const Task: Type.TObject<{
|
|
692
|
+
id: Type.TString;
|
|
693
|
+
taskType: Type.TString;
|
|
694
|
+
title: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
695
|
+
tags: Type.TArray<Type.TString>;
|
|
696
|
+
teamId: Type.TString;
|
|
697
|
+
diaryId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
698
|
+
outputKind: Type.TUnion<[Type.TLiteral<"artifact">, Type.TLiteral<"judgment">]>;
|
|
699
|
+
input: Type.TRecord<"^.*$", Type.TUnknown>;
|
|
700
|
+
inputSchemaCid: Type.TString;
|
|
701
|
+
inputCid: Type.TString;
|
|
702
|
+
references: Type.TArray<Type.TObject<{
|
|
703
|
+
taskId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
704
|
+
outputCid: Type.TString;
|
|
705
|
+
role: Type.TUnion<[Type.TLiteral<"judged_work">, Type.TLiteral<"reviewed_diff">, Type.TLiteral<"target_source">, Type.TLiteral<"context">]>;
|
|
706
|
+
external: Type.TOptional<Type.TObject<{
|
|
707
|
+
kind: Type.TUnion<[Type.TLiteral<"github_pr">, Type.TLiteral<"github_issue">, Type.TLiteral<"http_url">]>;
|
|
708
|
+
pr: Type.TOptional<Type.TNumber>;
|
|
709
|
+
issue: Type.TOptional<Type.TNumber>;
|
|
710
|
+
url: Type.TOptional<Type.TString>;
|
|
711
|
+
commit_sha: Type.TOptional<Type.TString>;
|
|
712
|
+
snapshot_cid: Type.TOptional<Type.TString>;
|
|
709
713
|
}>>;
|
|
710
714
|
}>>;
|
|
711
|
-
correlationId: TUnion<[TString, TNull]>;
|
|
712
|
-
proposedByAgentId: TUnion<[TString, TNull]>;
|
|
713
|
-
proposedByHumanId: TUnion<[TString, TNull]>;
|
|
714
|
-
acceptedAttemptN: TUnion<[TNumber, TNull]>;
|
|
715
|
-
claimCondition: TUnion<[
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
conditions: TArray<TThis>;
|
|
721
|
-
}>, TObject< {
|
|
722
|
-
op: TLiteral<"task_status">;
|
|
723
|
-
taskId: TString;
|
|
724
|
-
statuses: TArray<TRefUnsafe<TUnion<[TLiteral<"waiting">, TLiteral<"queued">, TLiteral<"dispatched">, TLiteral<"running">, TLiteral<"completed">, TLiteral<"failed">, TLiteral<"cancelled">, TLiteral<"expired">]>>>;
|
|
725
|
-
}>, TObject< {
|
|
726
|
-
op: TLiteral<"task_accepted">;
|
|
727
|
-
taskId: TString;
|
|
728
|
-
}>]>>, TNull]>;
|
|
729
|
-
requiredExecutorTrustLevel: TUnion<[TLiteral<"selfDeclared">, TLiteral<"agentSigned">, TLiteral<"releaseVerifiedTool">, TLiteral<"sandboxAttested">]>;
|
|
730
|
-
allowedExecutors: TArray<TObject< {
|
|
731
|
-
provider: TString;
|
|
732
|
-
model: TString;
|
|
715
|
+
correlationId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
716
|
+
proposedByAgentId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
717
|
+
proposedByHumanId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
718
|
+
acceptedAttemptN: Type.TUnion<[Type.TNumber, Type.TNull]>;
|
|
719
|
+
claimCondition: Type.TUnion<[Type.TUnsafe<ClaimCondition>, Type.TNull]>;
|
|
720
|
+
requiredExecutorTrustLevel: Type.TUnion<[Type.TLiteral<"selfDeclared">, Type.TLiteral<"agentSigned">, Type.TLiteral<"releaseVerifiedTool">, Type.TLiteral<"sandboxAttested">]>;
|
|
721
|
+
allowedExecutors: Type.TArray<Type.TObject<{
|
|
722
|
+
provider: Type.TString;
|
|
723
|
+
model: Type.TString;
|
|
733
724
|
}>>;
|
|
734
|
-
status: TUnion<[TLiteral<"waiting">, TLiteral<"queued">, TLiteral<"dispatched">, TLiteral<"running">, TLiteral<"completed">, TLiteral<"failed">, TLiteral<"cancelled">, TLiteral<"expired">]>;
|
|
735
|
-
queuedAt: TString;
|
|
736
|
-
completedAt: TUnion<[TString, TNull]>;
|
|
737
|
-
expiresAt: TUnion<[TString, TNull]>;
|
|
738
|
-
cancelledByAgentId: TUnion<[TString, TNull]>;
|
|
739
|
-
cancelledByHumanId: TUnion<[TString, TNull]>;
|
|
740
|
-
cancelReason: TUnion<[TString, TNull]>;
|
|
741
|
-
maxAttempts: TNumber;
|
|
742
|
-
dispatchTimeoutSec: TUnion<[TInteger, TNull]>;
|
|
743
|
-
runningTimeoutSec: TUnion<[TInteger, TNull]>;
|
|
725
|
+
status: Type.TUnion<[Type.TLiteral<"waiting">, Type.TLiteral<"queued">, Type.TLiteral<"dispatched">, Type.TLiteral<"running">, Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"cancelled">, Type.TLiteral<"expired">]>;
|
|
726
|
+
queuedAt: Type.TString;
|
|
727
|
+
completedAt: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
728
|
+
expiresAt: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
729
|
+
cancelledByAgentId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
730
|
+
cancelledByHumanId: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
731
|
+
cancelReason: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
732
|
+
maxAttempts: Type.TNumber;
|
|
733
|
+
dispatchTimeoutSec: Type.TUnion<[Type.TInteger, Type.TNull]>;
|
|
734
|
+
runningTimeoutSec: Type.TUnion<[Type.TInteger, Type.TNull]>;
|
|
744
735
|
}>;
|
|
745
736
|
|
|
746
737
|
declare type Task = Static<typeof Task>;
|
|
747
738
|
|
|
748
739
|
/** Reusable input fragment for any task type. Soft cap at 5 items. */
|
|
749
|
-
declare const TaskContext: TArray<TObject<
|
|
750
|
-
slug: TString;
|
|
751
|
-
binding: TUnion<[TLiteral<"skill">, TLiteral<"context_inline">, TLiteral<"prompt_prefix">, TLiteral<"user_inline">]>;
|
|
752
|
-
content: TString;
|
|
740
|
+
declare const TaskContext: Type.TArray<Type.TObject<{
|
|
741
|
+
slug: Type.TString;
|
|
742
|
+
binding: Type.TUnion<[Type.TLiteral<"skill">, Type.TLiteral<"context_inline">, Type.TLiteral<"prompt_prefix">, Type.TLiteral<"user_inline">]>;
|
|
743
|
+
content: Type.TString;
|
|
753
744
|
}>>;
|
|
754
745
|
|
|
755
746
|
declare type TaskContext = Static<typeof TaskContext>;
|
|
756
747
|
|
|
757
|
-
declare const TaskMessage: TObject<
|
|
758
|
-
taskId: TString;
|
|
759
|
-
attemptN: TNumber;
|
|
760
|
-
seq: TNumber;
|
|
761
|
-
timestamp: TString;
|
|
762
|
-
kind: TUnion<[TLiteral<"text_delta">, TLiteral<"tool_call_start">, TLiteral<"tool_call_end">, TLiteral<"turn_end">, TLiteral<"error">, TLiteral<"info">]>;
|
|
763
|
-
payload: TRecord<
|
|
748
|
+
declare const TaskMessage: Type.TObject<{
|
|
749
|
+
taskId: Type.TString;
|
|
750
|
+
attemptN: Type.TNumber;
|
|
751
|
+
seq: Type.TNumber;
|
|
752
|
+
timestamp: Type.TString;
|
|
753
|
+
kind: Type.TUnion<[Type.TLiteral<"text_delta">, Type.TLiteral<"tool_call_start">, Type.TLiteral<"tool_call_end">, Type.TLiteral<"turn_end">, Type.TLiteral<"error">, Type.TLiteral<"info">]>;
|
|
754
|
+
payload: Type.TRecord<"^.*$", Type.TUnknown>;
|
|
764
755
|
}>;
|
|
765
756
|
|
|
766
757
|
declare type TaskMessage = Static<typeof TaskMessage>;
|
|
@@ -770,29 +761,29 @@ declare type TaskMessage = Static<typeof TaskMessage>;
|
|
|
770
761
|
* the compact shape the runtime surfaces back to whoever drove it
|
|
771
762
|
* (stdout reporter, API reporter in PR 7, etc.).
|
|
772
763
|
*/
|
|
773
|
-
declare const TaskOutput: TObject<
|
|
774
|
-
taskId: TString;
|
|
775
|
-
attemptN: TNumber;
|
|
776
|
-
status: TUnion<[TLiteral<"completed">, TLiteral<"failed">, TLiteral<"cancelled">]>;
|
|
777
|
-
output: TUnion<[TRecord<
|
|
778
|
-
outputCid: TUnion<[TString, TNull]>;
|
|
779
|
-
usage: TObject<
|
|
780
|
-
inputTokens: TInteger;
|
|
781
|
-
outputTokens: TInteger;
|
|
782
|
-
cacheReadTokens: TOptional<TInteger>;
|
|
783
|
-
cacheWriteTokens: TOptional<TInteger>;
|
|
784
|
-
toolCalls: TOptional<TInteger>;
|
|
785
|
-
model: TOptional<TString>;
|
|
786
|
-
provider: TOptional<TString>;
|
|
764
|
+
declare const TaskOutput: Type.TObject<{
|
|
765
|
+
taskId: Type.TString;
|
|
766
|
+
attemptN: Type.TNumber;
|
|
767
|
+
status: Type.TUnion<[Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"cancelled">]>;
|
|
768
|
+
output: Type.TUnion<[Type.TRecord<"^.*$", Type.TUnknown>, Type.TNull]>;
|
|
769
|
+
outputCid: Type.TUnion<[Type.TString, Type.TNull]>;
|
|
770
|
+
usage: Type.TObject<{
|
|
771
|
+
inputTokens: Type.TInteger;
|
|
772
|
+
outputTokens: Type.TInteger;
|
|
773
|
+
cacheReadTokens: Type.TOptional<Type.TInteger>;
|
|
774
|
+
cacheWriteTokens: Type.TOptional<Type.TInteger>;
|
|
775
|
+
toolCalls: Type.TOptional<Type.TInteger>;
|
|
776
|
+
model: Type.TOptional<Type.TString>;
|
|
777
|
+
provider: Type.TOptional<Type.TString>;
|
|
787
778
|
}>;
|
|
788
|
-
durationMs: TNumber;
|
|
789
|
-
error: TOptional<TObject<
|
|
790
|
-
code: TString;
|
|
791
|
-
message: TString;
|
|
792
|
-
stack: TOptional<TString>;
|
|
793
|
-
retryable: TOptional<TBoolean>;
|
|
779
|
+
durationMs: Type.TNumber;
|
|
780
|
+
error: Type.TOptional<Type.TObject<{
|
|
781
|
+
code: Type.TString;
|
|
782
|
+
message: Type.TString;
|
|
783
|
+
stack: Type.TOptional<Type.TString>;
|
|
784
|
+
retryable: Type.TOptional<Type.TBoolean>;
|
|
794
785
|
}>>;
|
|
795
|
-
contentSignature: TOptional<TString>;
|
|
786
|
+
contentSignature: Type.TOptional<Type.TString>;
|
|
796
787
|
}>;
|
|
797
788
|
|
|
798
789
|
declare type TaskOutput = Static<typeof TaskOutput>;
|
|
@@ -855,19 +846,23 @@ declare interface TaskReporter {
|
|
|
855
846
|
readonly cancelReason: string | null;
|
|
856
847
|
}
|
|
857
848
|
|
|
849
|
+
declare const TaskStatus: Type.TUnion<[Type.TLiteral<"waiting">, Type.TLiteral<"queued">, Type.TLiteral<"dispatched">, Type.TLiteral<"running">, Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"cancelled">, Type.TLiteral<"expired">]>;
|
|
850
|
+
|
|
851
|
+
declare type TaskStatus = Static<typeof TaskStatus>;
|
|
852
|
+
|
|
858
853
|
/**
|
|
859
854
|
* Token / cost accounting for one attempt.
|
|
860
855
|
* Reported by the runtime; persisted per-attempt, also rolled up into
|
|
861
856
|
* `TaskOutput.usage` for convenience.
|
|
862
857
|
*/
|
|
863
|
-
declare const TaskUsage: TObject<
|
|
864
|
-
inputTokens: TInteger;
|
|
865
|
-
outputTokens: TInteger;
|
|
866
|
-
cacheReadTokens: TOptional<TInteger>;
|
|
867
|
-
cacheWriteTokens: TOptional<TInteger>;
|
|
868
|
-
toolCalls: TOptional<TInteger>;
|
|
869
|
-
model: TOptional<TString>;
|
|
870
|
-
provider: TOptional<TString>;
|
|
858
|
+
declare const TaskUsage: Type.TObject<{
|
|
859
|
+
inputTokens: Type.TInteger;
|
|
860
|
+
outputTokens: Type.TInteger;
|
|
861
|
+
cacheReadTokens: Type.TOptional<Type.TInteger>;
|
|
862
|
+
cacheWriteTokens: Type.TOptional<Type.TInteger>;
|
|
863
|
+
toolCalls: Type.TOptional<Type.TInteger>;
|
|
864
|
+
model: Type.TOptional<Type.TString>;
|
|
865
|
+
provider: Type.TOptional<Type.TString>;
|
|
871
866
|
}>;
|
|
872
867
|
|
|
873
868
|
declare type TaskUsage = Static<typeof TaskUsage>;
|
package/dist/index.js
CHANGED
|
@@ -11,8 +11,9 @@ import { Type, getModel } from "@earendil-works/pi-ai";
|
|
|
11
11
|
import { MemoryProvider, RealFSProvider, ShadowProvider, VM, VmCheckpoint, createHttpHooks, createShadowPathPredicate, ensureImageSelector, loadGuestAssets } from "@earendil-works/gondolin";
|
|
12
12
|
import { parseEnv } from "node:util";
|
|
13
13
|
import { SpanStatusCode, context, metrics, trace } from "@opentelemetry/api";
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
14
|
+
import * as Format from "typebox/format";
|
|
15
|
+
import { Type as Type$1 } from "typebox";
|
|
16
|
+
import { Value } from "typebox/value";
|
|
16
17
|
//#region \0rolldown/runtime.js
|
|
17
18
|
var __defProp = Object.defineProperty;
|
|
18
19
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -8929,14 +8930,13 @@ async function resolvePersistentSessionManager(args) {
|
|
|
8929
8930
|
* Register TypeBox string formats used across Task / TaskOutput / task-type
|
|
8930
8931
|
* schemas. Import this module for its side effect (the package index does so
|
|
8931
8932
|
* automatically) before compiling or Check()ing any schema that references
|
|
8932
|
-
* `format: 'uuid'` or `format: 'date-time'
|
|
8933
|
-
* "Unknown format" and every union containing such a member fails to match.
|
|
8933
|
+
* `format: 'uuid'` or `format: 'date-time'`.
|
|
8934
8934
|
*
|
|
8935
|
-
* Idempotent: registration is guarded by `
|
|
8935
|
+
* Idempotent: registration is guarded by `Format.Has(...)`.
|
|
8936
8936
|
*/
|
|
8937
8937
|
var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
8938
|
-
if (!
|
|
8939
|
-
if (!
|
|
8938
|
+
if (!Format.Has("uuid")) Format.Set("uuid", (v) => UUID_RE.test(v));
|
|
8939
|
+
if (!Format.Has("date-time")) Format.Set("date-time", (v) => !Number.isNaN(Date.parse(v)));
|
|
8940
8940
|
//#endregion
|
|
8941
8941
|
//#region ../tasks/src/context.ts
|
|
8942
8942
|
/**
|
|
@@ -10227,10 +10227,22 @@ function formatField(prefix, path) {
|
|
|
10227
10227
|
return path ? `${prefix}${path}` : prefix;
|
|
10228
10228
|
}
|
|
10229
10229
|
function schemaErrors(prefix, schema, value) {
|
|
10230
|
-
return [...Value.Errors(schema, value)].
|
|
10231
|
-
|
|
10232
|
-
|
|
10233
|
-
|
|
10230
|
+
return [...Value.Errors(schema, value)].flatMap((rawError) => {
|
|
10231
|
+
const error = rawError;
|
|
10232
|
+
const baseField = formatField(prefix, error.instancePath);
|
|
10233
|
+
if (error.keyword === "additionalProperties" && error.params?.additionalProperties) return error.params.additionalProperties.map((property) => ({
|
|
10234
|
+
field: `${baseField}/${property}`,
|
|
10235
|
+
message: error.message
|
|
10236
|
+
}));
|
|
10237
|
+
if (error.keyword === "required" && error.params?.requiredProperties) return error.params.requiredProperties.map((property) => ({
|
|
10238
|
+
field: `${baseField}/${property}`,
|
|
10239
|
+
message: `must have required property ${property}`
|
|
10240
|
+
}));
|
|
10241
|
+
return [{
|
|
10242
|
+
field: baseField,
|
|
10243
|
+
message: error.message
|
|
10244
|
+
}];
|
|
10245
|
+
});
|
|
10234
10246
|
}
|
|
10235
10247
|
function validateTaskOutput(taskType, output, input) {
|
|
10236
10248
|
const entry = getTaskTypeEntry(taskType);
|
|
@@ -10352,17 +10364,17 @@ var DaemonState = Type$1.Object({
|
|
|
10352
10364
|
$id: "DaemonState",
|
|
10353
10365
|
additionalProperties: false
|
|
10354
10366
|
});
|
|
10355
|
-
var
|
|
10367
|
+
var ClaimConditionSchema = Type$1.Union([
|
|
10356
10368
|
Type$1.Object({
|
|
10357
10369
|
op: Type$1.Literal("all"),
|
|
10358
|
-
conditions: Type$1.Array(
|
|
10370
|
+
conditions: Type$1.Array(Type$1.Ref("ClaimCondition"), {
|
|
10359
10371
|
minItems: 1,
|
|
10360
10372
|
maxItems: MAX_CLAIM_CONDITION_BRANCHES
|
|
10361
10373
|
})
|
|
10362
10374
|
}, { additionalProperties: false }),
|
|
10363
10375
|
Type$1.Object({
|
|
10364
10376
|
op: Type$1.Literal("any"),
|
|
10365
|
-
conditions: Type$1.Array(
|
|
10377
|
+
conditions: Type$1.Array(Type$1.Ref("ClaimCondition"), {
|
|
10366
10378
|
minItems: 1,
|
|
10367
10379
|
maxItems: MAX_CLAIM_CONDITION_BRANCHES
|
|
10368
10380
|
})
|
|
@@ -10370,7 +10382,7 @@ var ClaimCondition = Type$1.Recursive((Self) => Type$1.Union([
|
|
|
10370
10382
|
Type$1.Object({
|
|
10371
10383
|
op: Type$1.Literal("task_status"),
|
|
10372
10384
|
taskId: Uuid,
|
|
10373
|
-
statuses: Type$1.Array(Type$1.Ref(TaskStatus), {
|
|
10385
|
+
statuses: Type$1.Array(Type$1.Ref("TaskStatus"), {
|
|
10374
10386
|
minItems: 1,
|
|
10375
10387
|
maxItems: MAX_CLAIM_CONDITION_STATUSES
|
|
10376
10388
|
})
|
|
@@ -10379,7 +10391,9 @@ var ClaimCondition = Type$1.Recursive((Self) => Type$1.Union([
|
|
|
10379
10391
|
op: Type$1.Literal("task_accepted"),
|
|
10380
10392
|
taskId: Uuid
|
|
10381
10393
|
}, { additionalProperties: false })
|
|
10382
|
-
]
|
|
10394
|
+
], { $id: "ClaimCondition" });
|
|
10395
|
+
var ClaimConditionDefinition = Type$1.Unsafe(ClaimConditionSchema);
|
|
10396
|
+
Type$1.Unsafe(Type$1.Cyclic({ ClaimCondition: ClaimConditionDefinition }, "ClaimCondition", { $id: "ClaimCondition" }));
|
|
10383
10397
|
/**
|
|
10384
10398
|
* Reference to another task's output or an external artifact.
|
|
10385
10399
|
* Embedded in `tasks.references` JSONB array.
|
|
@@ -10461,7 +10475,7 @@ Type$1.Object({
|
|
|
10461
10475
|
proposedByAgentId: Type$1.Union([Uuid, Type$1.Null()]),
|
|
10462
10476
|
proposedByHumanId: Type$1.Union([Uuid, Type$1.Null()]),
|
|
10463
10477
|
acceptedAttemptN: Type$1.Union([Type$1.Number(), Type$1.Null()]),
|
|
10464
|
-
claimCondition: Type$1.Union([ClaimCondition, Type$1.Null()]),
|
|
10478
|
+
claimCondition: Type$1.Union([Type$1.Unsafe(Type$1.Ref("ClaimCondition")), Type$1.Null()]),
|
|
10465
10479
|
requiredExecutorTrustLevel: ExecutorTrustLevel,
|
|
10466
10480
|
allowedExecutors: Type$1.Array(ExecutorRef, { maxItems: 16 }),
|
|
10467
10481
|
status: TaskStatus,
|
|
@@ -15782,7 +15796,7 @@ function createSubagentTool(args) {
|
|
|
15782
15796
|
description: `Submit your structured output for this subagent task. Call exactly once when done. Args MUST match the ${output_schema} contract; mismatches return a tool error you can recover from in the same session.`,
|
|
15783
15797
|
parameters: contract.parametersSchema,
|
|
15784
15798
|
async execute(_innerId, innerParams) {
|
|
15785
|
-
if (!Value.Check(contract.parametersSchema, innerParams)) return toolError(`submit_subagent_output: schema validation failed: ${[...Value.Errors(contract.parametersSchema, innerParams)].slice(0, 3).map((e) => `${e.
|
|
15799
|
+
if (!Value.Check(contract.parametersSchema, innerParams)) return toolError(`submit_subagent_output: schema validation failed: ${[...Value.Errors(contract.parametersSchema, innerParams)].slice(0, 3).map((e) => `${e.instancePath}: ${e.message}`).join("; ")}. Re-call with a corrected payload.`);
|
|
15786
15800
|
captured = innerParams;
|
|
15787
15801
|
return {
|
|
15788
15802
|
content: [{
|
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@themoltnet/pi-extension",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MoltNet pi extension — sandboxed tool execution in Gondolin VMs with MoltNet identity and persistent memory",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"moltnet",
|
|
8
|
+
"pi-extension",
|
|
9
|
+
"task-execution"
|
|
10
|
+
],
|
|
6
11
|
"license": "MIT",
|
|
7
12
|
"repository": {
|
|
8
13
|
"type": "git",
|
|
@@ -30,9 +35,9 @@
|
|
|
30
35
|
"dependencies": {
|
|
31
36
|
"@earendil-works/gondolin": "^0.9.1",
|
|
32
37
|
"@opentelemetry/api": "^1.9.0",
|
|
33
|
-
"
|
|
34
|
-
"@themoltnet/
|
|
35
|
-
"@themoltnet/
|
|
38
|
+
"typebox": "^1.2.8",
|
|
39
|
+
"@themoltnet/sdk": "0.106.0",
|
|
40
|
+
"@themoltnet/agent-runtime": "0.22.4"
|
|
36
41
|
},
|
|
37
42
|
"peerDependencies": {
|
|
38
43
|
"@earendil-works/pi-coding-agent": ">=0.74.0",
|
|
@@ -56,8 +61,8 @@
|
|
|
56
61
|
"vite": "^8.0.0",
|
|
57
62
|
"vite-plugin-dts": "^4.5.4",
|
|
58
63
|
"vitest": "^3.0.0",
|
|
59
|
-
"@moltnet/
|
|
60
|
-
"@moltnet/
|
|
64
|
+
"@moltnet/tasks": "0.1.0",
|
|
65
|
+
"@moltnet/crypto-service": "0.1.0"
|
|
61
66
|
},
|
|
62
67
|
"engines": {
|
|
63
68
|
"node": ">=22"
|