@caupulican/pi-adaptative 0.86.5 → 0.86.8
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/CHANGELOG.md +19 -1
- package/dist/core/default-tool-surface.d.ts +1 -1
- package/dist/core/default-tool-surface.d.ts.map +1 -1
- package/dist/core/default-tool-surface.js +12 -2
- package/dist/core/default-tool-surface.js.map +1 -1
- package/dist/core/delegation/worker-authority-resolver.d.ts.map +1 -1
- package/dist/core/delegation/worker-authority-resolver.js +3 -0
- package/dist/core/delegation/worker-authority-resolver.js.map +1 -1
- package/dist/core/delegation/worker-delegation-controller.d.ts +1 -0
- package/dist/core/delegation/worker-delegation-controller.d.ts.map +1 -1
- package/dist/core/delegation/worker-delegation-controller.js +50 -0
- package/dist/core/delegation/worker-delegation-controller.js.map +1 -1
- package/dist/core/delegation/worker-execution-policy.d.ts.map +1 -1
- package/dist/core/delegation/worker-execution-policy.js +14 -2
- package/dist/core/delegation/worker-execution-policy.js.map +1 -1
- package/dist/core/goals/goal-continuation-controller.d.ts.map +1 -1
- package/dist/core/goals/goal-continuation-controller.js +15 -0
- package/dist/core/goals/goal-continuation-controller.js.map +1 -1
- package/dist/core/goals/goal-state.d.ts +6 -0
- package/dist/core/goals/goal-state.d.ts.map +1 -1
- package/dist/core/goals/goal-state.js +1 -0
- package/dist/core/goals/goal-state.js.map +1 -1
- package/dist/core/goals/goal-tool-core.d.ts +1 -0
- package/dist/core/goals/goal-tool-core.d.ts.map +1 -1
- package/dist/core/goals/goal-tool-core.js +25 -3
- package/dist/core/goals/goal-tool-core.js.map +1 -1
- package/dist/core/orchestration/lane-tool-manifests.d.ts +2 -2
- package/dist/core/orchestration/lane-tool-manifests.d.ts.map +1 -1
- package/dist/core/orchestration/lane-tool-manifests.js +1 -1
- package/dist/core/orchestration/lane-tool-manifests.js.map +1 -1
- package/dist/core/orchestration/worker-execution-contract.d.ts.map +1 -1
- package/dist/core/orchestration/worker-execution-contract.js +4 -2
- package/dist/core/orchestration/worker-execution-contract.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +1 -7
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/delegate.d.ts +2 -11
- package/dist/core/tools/delegate.d.ts.map +1 -1
- package/dist/core/tools/delegate.js +31 -29
- package/dist/core/tools/delegate.js.map +1 -1
- package/dist/core/tools/goal.d.ts +1 -0
- package/dist/core/tools/goal.d.ts.map +1 -1
- package/dist/core/tools/goal.js +9 -1
- package/dist/core/tools/goal.js.map +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../../src/core/tools/delegate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAEN,KAAK,gCAAgC,EACrC,KAAK,sBAAsB,EAC3B,MAAM,uCAAuC,CAAC;AAE/C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../../src/core/tools/delegate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,M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CAAC,EAAE,sBAAsB,CAAC;IAC5C,yFAAyF;IACzF,MAAM,EAAE,cAAc,CAAC;IACvB,8FAA8F;IAC9F,yBAAyB,CAAC,EAAE,MAAM;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1E;AA4PD,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,wBAAwB,GAAG,cAAc,CA64B3F"}
|
|
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { Type } from "typebox";
|
|
3
3
|
import { normalizeWorkerAgentDependencyTaskIds, } from "../delegation/worker-agent-control.js";
|
|
4
4
|
import { MAX_WORKER_TRANSCRIPT_PAGE_MESSAGES } from "../delegation/worker-conversation-store.js";
|
|
5
|
-
import {
|
|
5
|
+
import { MAX_ORCHESTRATION_COLLECTION_LENGTH, MAX_ORCHESTRATION_DISPATCH_INSTRUCTIONS_LENGTH, MAX_ORCHESTRATION_IDENTIFIER_LENGTH, MAX_ORCHESTRATION_MODEL_ID_LENGTH, MAX_ORCHESTRATION_MODEL_PROVIDER_LENGTH, ORCHESTRATION_THINKING_LEVELS, WORKER_ROLES, } from "../orchestration/contracts.js";
|
|
6
6
|
import { emptyOrchestrationCall, renderOrchestrationToolResult, } from "./orchestration-panel.js";
|
|
7
7
|
export const DELEGATE_ACTIONS = [
|
|
8
8
|
"start",
|
|
@@ -24,37 +24,17 @@ export const DELEGATE_ACTIONS = [
|
|
|
24
24
|
"cancel",
|
|
25
25
|
];
|
|
26
26
|
function createDelegateSchema() {
|
|
27
|
-
const authority = Type.Object({
|
|
27
|
+
const authority = Type.Optional(Type.Object({
|
|
28
28
|
role: Type.Optional(Type.Union(WORKER_ROLES.map((role) => Type.Literal(role)))),
|
|
29
29
|
model: Type.Optional(Type.Object({
|
|
30
30
|
provider: Type.String({ minLength: 1, maxLength: MAX_ORCHESTRATION_MODEL_PROVIDER_LENGTH }),
|
|
31
31
|
modelId: Type.String({ minLength: 1, maxLength: MAX_ORCHESTRATION_MODEL_ID_LENGTH }),
|
|
32
32
|
}, { additionalProperties: false })),
|
|
33
33
|
thinkingLevel: Type.Optional(Type.Union(ORCHESTRATION_THINKING_LEVELS.map((level) => Type.Literal(level)))),
|
|
34
|
-
capabilities: Type.Optional(Type.Array(Type.Union(HARNESS_CAPABILITIES.map((capability) => Type.Literal(capability))), {
|
|
35
|
-
maxItems: MAX_ORCHESTRATION_COLLECTION_LENGTH,
|
|
36
|
-
})),
|
|
37
34
|
toolNames: Type.Optional(Type.Array(Type.String({ minLength: 1, maxLength: MAX_ORCHESTRATION_IDENTIFIER_LENGTH }), {
|
|
38
35
|
maxItems: MAX_ORCHESTRATION_COLLECTION_LENGTH,
|
|
39
36
|
})),
|
|
40
|
-
|
|
41
|
-
maxItems: MAX_WORKER_AUTHORITY_PATHS,
|
|
42
|
-
})),
|
|
43
|
-
writePaths: Type.Optional(Type.Array(Type.String({ minLength: 1, maxLength: MAX_WORKER_AUTHORITY_PATH_LENGTH }), {
|
|
44
|
-
maxItems: MAX_WORKER_AUTHORITY_PATHS,
|
|
45
|
-
})),
|
|
46
|
-
budget: Type.Optional(Type.Object({
|
|
47
|
-
maxTokens: Type.Optional(Type.Integer({
|
|
48
|
-
minimum: 0,
|
|
49
|
-
description: "Budget-counted work tokens (cache reads charge at 10%). Grants below 5000 are rejected as non-viable: a worker's first response alone costs ~3500.",
|
|
50
|
-
})),
|
|
51
|
-
maxWallClockMs: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
52
|
-
maxCostUsd: Type.Optional(Type.Number({ minimum: 0 })),
|
|
53
|
-
maxAttempts: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
54
|
-
maxToolCalls: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
55
|
-
requireApprovalAboveCostUsd: Type.Optional(Type.Number({ minimum: 0 })),
|
|
56
|
-
}, { additionalProperties: false })),
|
|
57
|
-
}, { additionalProperties: false });
|
|
37
|
+
}, { additionalProperties: false }));
|
|
58
38
|
return Type.Object({
|
|
59
39
|
action: Type.Optional(Type.String({
|
|
60
40
|
maxLength: 16,
|
|
@@ -63,9 +43,9 @@ function createDelegateSchema() {
|
|
|
63
43
|
})),
|
|
64
44
|
profileId: Type.Optional(Type.String({
|
|
65
45
|
maxLength: MAX_ORCHESTRATION_IDENTIFIER_LENGTH,
|
|
66
|
-
description: "Optional loaded profile
|
|
46
|
+
description: "Optional loaded profile preset for the worker (e.g. 'builder-validator'). When omitted, authority specifies model and tools directly.",
|
|
67
47
|
})),
|
|
68
|
-
authority
|
|
48
|
+
authority,
|
|
69
49
|
instructions: Type.Optional(Type.String({
|
|
70
50
|
maxLength: MAX_ORCHESTRATION_DISPATCH_INSTRUCTIONS_LENGTH,
|
|
71
51
|
description: "The self-contained task for an autonomous child. It inherits the caller's admitted grant by default and may recursively delegate while that grant retains workflow.delegate. The host bounds depth, direct children, session identities, and queued dispatches.",
|
|
@@ -83,6 +63,14 @@ function createDelegateSchema() {
|
|
|
83
63
|
maxItems: MAX_ORCHESTRATION_COLLECTION_LENGTH,
|
|
84
64
|
description: "Existing same-objective durable task ids that must complete before a start action may run. Discover ids with tasks; forward references and cross-objective edges are rejected.",
|
|
85
65
|
})),
|
|
66
|
+
requirementId: Type.Optional(Type.String({
|
|
67
|
+
maxLength: MAX_ORCHESTRATION_IDENTIFIER_LENGTH,
|
|
68
|
+
description: "Optional goal requirement ID bound to this subagent dispatch.",
|
|
69
|
+
})),
|
|
70
|
+
requirementIds: Type.Optional(Type.Array(Type.String({ minLength: 1, maxLength: MAX_ORCHESTRATION_IDENTIFIER_LENGTH }), {
|
|
71
|
+
maxItems: MAX_ORCHESTRATION_COLLECTION_LENGTH,
|
|
72
|
+
description: "Optional goal requirement IDs bound to this subagent dispatch.",
|
|
73
|
+
})),
|
|
86
74
|
forkTurns: Type.Optional(Type.String({
|
|
87
75
|
minLength: 1,
|
|
88
76
|
maxLength: 16,
|
|
@@ -142,7 +130,17 @@ function isDelegateAction(value) {
|
|
|
142
130
|
return DELEGATE_ACTIONS.some((action) => action === value);
|
|
143
131
|
}
|
|
144
132
|
const EXACT_ACTION_ALLOWED_FIELDS = {
|
|
145
|
-
start: [
|
|
133
|
+
start: [
|
|
134
|
+
"action",
|
|
135
|
+
"profileId",
|
|
136
|
+
"authority",
|
|
137
|
+
"instructions",
|
|
138
|
+
"agentId",
|
|
139
|
+
"dependsOn",
|
|
140
|
+
"forkTurns",
|
|
141
|
+
"requirementId",
|
|
142
|
+
"requirementIds",
|
|
143
|
+
],
|
|
146
144
|
tasks: ["action"],
|
|
147
145
|
list: ["action", "cursor", "maxMessages"],
|
|
148
146
|
transcript: ["action", "agentId", "cursor", "maxMessages"],
|
|
@@ -1147,16 +1145,20 @@ export function createDelegateToolDefinition(deps) {
|
|
|
1147
1145
|
skipReason: "missing_instructions",
|
|
1148
1146
|
});
|
|
1149
1147
|
const profileId = input.profileId?.trim();
|
|
1148
|
+
const requirementIds = [
|
|
1149
|
+
...(input.requirementId?.trim() ? [input.requirementId.trim()] : []),
|
|
1150
|
+
...(input.requirementIds ? input.requirementIds.map((id) => id.trim()).filter(Boolean) : []),
|
|
1151
|
+
];
|
|
1150
1152
|
const request = {
|
|
1151
1153
|
instructions,
|
|
1152
1154
|
...(profileId ? { profileId } : {}),
|
|
1153
1155
|
...(input.authority ? { authority: structuredClone(input.authority) } : {}),
|
|
1154
1156
|
...(input.forkTurns ? { forkTurns: input.forkTurns } : {}),
|
|
1155
|
-
...(dependsOnTaskIds
|
|
1157
|
+
...(dependsOnTaskIds || requirementIds.length > 0
|
|
1156
1158
|
? {
|
|
1157
1159
|
taskContext: {
|
|
1158
|
-
requirementIds
|
|
1159
|
-
dependsOnTaskIds,
|
|
1160
|
+
requirementIds,
|
|
1161
|
+
dependsOnTaskIds: dependsOnTaskIds ?? [],
|
|
1160
1162
|
acceptanceCriterionIds: [],
|
|
1161
1163
|
resourcePointerIds: [],
|
|
1162
1164
|
},
|