@kvman/kvcoder 0.1.10 → 0.1.11
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/api.d.ts +3 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/calls/call-name.d.ts +8 -0
- package/dist/calls/call-name.d.ts.map +1 -0
- package/dist/calls/call-name.js +38 -0
- package/dist/calls/call-name.js.map +1 -0
- package/dist/calls/line-run.d.ts +1 -4
- package/dist/calls/line-run.d.ts.map +1 -1
- package/dist/calls/line-run.js +2 -2
- package/dist/calls/line-run.js.map +1 -1
- package/dist/calls/run-tool.d.ts +1 -6
- package/dist/calls/run-tool.d.ts.map +1 -1
- package/dist/calls/run-tool.js +3 -6
- package/dist/calls/run-tool.js.map +1 -1
- package/dist/connector-call.d.ts +1 -1
- package/dist/connector-call.d.ts.map +1 -1
- package/dist/connectors/artifact.d.ts +1 -1
- package/dist/connectors/artifact.d.ts.map +1 -1
- package/dist/connectors/artifact.js +1 -1
- package/dist/connectors/artifact.js.map +1 -1
- package/dist/connectors/background.d.ts.map +1 -1
- package/dist/connectors/background.js +9 -3
- package/dist/connectors/background.js.map +1 -1
- package/dist/connectors/binary.js +2 -2
- package/dist/connectors/binary.js.map +1 -1
- package/dist/connectors/builtin-connectors.d.ts +24 -2
- package/dist/connectors/builtin-connectors.d.ts.map +1 -1
- package/dist/connectors/connector-command.d.ts +0 -1
- package/dist/connectors/connector-command.d.ts.map +1 -1
- package/dist/connectors/connector-command.js +1 -1
- package/dist/connectors/connector-command.js.map +1 -1
- package/dist/connectors/delegate.d.ts +17 -0
- package/dist/connectors/delegate.d.ts.map +1 -1
- package/dist/connectors/delegate.js +28 -6
- package/dist/connectors/delegate.js.map +1 -1
- package/dist/connectors/execution-map.d.ts +14 -3
- package/dist/connectors/execution-map.d.ts.map +1 -1
- package/dist/connectors/execution-map.js +43 -12
- package/dist/connectors/execution-map.js.map +1 -1
- package/dist/connectors/shell.js +1 -1
- package/dist/connectors/shell.js.map +1 -1
- package/dist/delegate/approved-run.js +2 -2
- package/dist/delegate/approved-run.js.map +1 -1
- package/dist/delegate/continue-helper.d.ts +18 -0
- package/dist/delegate/continue-helper.d.ts.map +1 -0
- package/dist/delegate/continue-helper.js +64 -0
- package/dist/delegate/continue-helper.js.map +1 -0
- package/dist/delegate/permission.d.ts +5 -5
- package/dist/delegate/runs.d.ts +9 -11
- package/dist/delegate/runs.d.ts.map +1 -1
- package/dist/delegate/runs.js +13 -9
- package/dist/delegate/runs.js.map +1 -1
- package/dist/delegate/workers.d.ts +6 -0
- package/dist/delegate/workers.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/jobs/helper-progress.d.ts +11 -0
- package/dist/jobs/helper-progress.d.ts.map +1 -0
- package/dist/jobs/helper-progress.js +38 -0
- package/dist/jobs/helper-progress.js.map +1 -0
- package/dist/jobs/job-rows.d.ts +3 -1
- package/dist/jobs/job-rows.d.ts.map +1 -1
- package/dist/jobs/job-rows.js +46 -22
- package/dist/jobs/job-rows.js.map +1 -1
- package/dist/jobs/process-report.d.ts +1 -1
- package/dist/jobs/process-report.d.ts.map +1 -1
- package/dist/jobs/process-report.js +11 -6
- package/dist/jobs/process-report.js.map +1 -1
- package/dist/jobs/process-run.d.ts +2 -5
- package/dist/jobs/process-run.d.ts.map +1 -1
- package/dist/jobs/process-run.js +6 -5
- package/dist/jobs/process-run.js.map +1 -1
- package/dist/jobs/register-jobs.js +3 -3
- package/dist/jobs/register-jobs.js.map +1 -1
- package/dist/maps/map-rules.d.ts +4 -2
- package/dist/maps/map-rules.d.ts.map +1 -1
- package/dist/maps/map-rules.js +7 -4
- package/dist/maps/map-rules.js.map +1 -1
- package/dist/maps/map-schema.d.ts +4 -4
- package/dist/maps/map-schema.d.ts.map +1 -1
- package/dist/maps/map-schema.js +10 -3
- package/dist/maps/map-schema.js.map +1 -1
- package/dist/prompt/build-prompt.js +2 -2
- package/dist/prompt/build-prompt.js.map +1 -1
- package/dist/prompt/session-grants.d.ts +3 -3
- package/dist/prompt/working-method.js +12 -12
- package/dist/prompt/working-method.js.map +1 -1
- package/dist/register-settings.d.ts +4 -0
- package/dist/register-settings.d.ts.map +1 -1
- package/dist/schemas/records.d.ts +10 -6
- package/dist/schemas/records.d.ts.map +1 -1
- package/dist/schemas/records.js +7 -4
- package/dist/schemas/records.js.map +1 -1
- package/dist/sessions/new-session.d.ts.map +1 -1
- package/dist/sessions/new-session.js +4 -2
- package/dist/sessions/new-session.js.map +1 -1
- package/dist/sessions/register-sessions.d.ts.map +1 -1
- package/dist/sessions/register-sessions.js +5 -2
- package/dist/sessions/register-sessions.js.map +1 -1
- package/dist/sessions/session-view.d.ts +2 -0
- package/dist/sessions/session-view.d.ts.map +1 -1
- package/dist/store/collections.d.ts +8 -8
- package/dist/thinking-levels.d.ts +6 -0
- package/dist/thinking-levels.d.ts.map +1 -0
- package/dist/thinking-levels.js +13 -0
- package/dist/thinking-levels.js.map +1 -0
- package/dist/turns/cache-retention.d.ts +6 -0
- package/dist/turns/cache-retention.d.ts.map +1 -0
- package/dist/turns/cache-retention.js +7 -0
- package/dist/turns/cache-retention.js.map +1 -0
- package/dist/turns/call-results.d.ts +6 -0
- package/dist/turns/call-results.d.ts.map +1 -0
- package/dist/turns/call-results.js +21 -0
- package/dist/turns/call-results.js.map +1 -0
- package/dist/turns/child-result.d.ts.map +1 -1
- package/dist/turns/child-result.js +4 -2
- package/dist/turns/child-result.js.map +1 -1
- package/dist/turns/compaction.d.ts.map +1 -1
- package/dist/turns/compaction.js +2 -1
- package/dist/turns/compaction.js.map +1 -1
- package/dist/turns/end-turn-state.d.ts.map +1 -1
- package/dist/turns/end-turn-state.js +2 -0
- package/dist/turns/end-turn-state.js.map +1 -1
- package/dist/turns/ended-calls.d.ts +6 -0
- package/dist/turns/ended-calls.d.ts.map +1 -0
- package/dist/turns/ended-calls.js +43 -0
- package/dist/turns/ended-calls.js.map +1 -0
- package/dist/turns/model-context.d.ts.map +1 -1
- package/dist/turns/model-context.js +16 -1
- package/dist/turns/model-context.js.map +1 -1
- package/dist/turns/model-info.d.ts +4 -0
- package/dist/turns/model-info.d.ts.map +1 -1
- package/dist/turns/model-info.js +7 -1
- package/dist/turns/model-info.js.map +1 -1
- package/dist/turns/model-retry.d.ts.map +1 -1
- package/dist/turns/model-retry.js +5 -4
- package/dist/turns/model-retry.js.map +1 -1
- package/dist/turns/run-calls.d.ts.map +1 -1
- package/dist/turns/run-calls.js +21 -5
- package/dist/turns/run-calls.js.map +1 -1
- package/dist/turns/run-command.d.ts.map +1 -1
- package/dist/turns/run-command.js +4 -6
- package/dist/turns/run-command.js.map +1 -1
- package/dist/turns/sent-size.d.ts +6 -2
- package/dist/turns/sent-size.d.ts.map +1 -1
- package/dist/turns/sent-size.js +8 -4
- package/dist/turns/sent-size.js.map +1 -1
- package/dist/turns/settle-calls.d.ts +1 -7
- package/dist/turns/settle-calls.d.ts.map +1 -1
- package/dist/turns/settle-calls.js +2 -19
- package/dist/turns/settle-calls.js.map +1 -1
- package/dist/turns/step.d.ts.map +1 -1
- package/dist/turns/step.js +29 -6
- package/dist/turns/step.js.map +1 -1
- package/dist/web/components/approval.css +1 -1
- package/dist/web/components/call.css +1 -1
- package/dist/web/components/call.js +210 -183
- package/dist/web/components/connectors.css +1 -1
- package/dist/web/components/connectors.js +431 -412
- package/dist/web/components/conversation.css +1 -1
- package/dist/web/components/conversation.js +1000 -893
- package/dist/web/components/mcp-sign-in.css +1 -1
- package/dist/web/components/model.css +1 -1
- package/dist/web/components/model.js +2 -1
- package/dist/web/components/question.css +1 -1
- package/dist/web/components/sessions.css +1 -1
- package/docs/connectors.md +4 -5
- package/locales/ar.json +15 -4
- package/locales/en.json +15 -4
- package/package.json +137 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-run.js","sourceRoot":"","sources":["../../src/jobs/process-run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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AK,CAAC,CAAC;IACjC,KAAK,MAAM,GAAG,IAAI,MAAM,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;QAC7E,IAAI,GAAG,CAAC,GAAG,KAAK,SAAS;YAAE,MAAM,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QAChE,MAAM,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACvC,CAAC;AACH,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from '@kvman/sdk';
|
|
2
2
|
import { findSession, userOnly } from "../sessions/session-lookup.js";
|
|
3
|
-
import { cancelJob, jobDetail, jobRows, linksOf } from "./job-rows.js";
|
|
3
|
+
import { cancelJob, isActive, jobDetail, jobRows, linksOf } from "./job-rows.js";
|
|
4
4
|
// The person's view of a session's background jobs (ADR 0009, 152): list, read, and cancel, for the Running chip.
|
|
5
5
|
const sessionJobSchema = z.object({ sessionId: z.string(), id: z.string() });
|
|
6
6
|
const rowSchema = z.object({
|
|
@@ -26,13 +26,13 @@ export function registerJobs(ctx) {
|
|
|
26
26
|
userOnly(ctx, 'kvcoder.job.list');
|
|
27
27
|
await findSession(ctx, sessionId);
|
|
28
28
|
const rows = await Promise.all((await jobRows(ctx, sessionId)).map((row) => withLinks(ctx, sessionId, row)));
|
|
29
|
-
return [...rows.filter((row) => row.status
|
|
29
|
+
return [...rows.filter((row) => isActive(row.status)), ...rows.filter((row) => !isActive(row.status))];
|
|
30
30
|
},
|
|
31
31
|
});
|
|
32
32
|
ctx.registerQuery('kvcoder.job.get', {
|
|
33
33
|
description: "One background job of a chat with its output: a process's last 100 lines, a subagent's result, or what a program worker's run returned.",
|
|
34
34
|
input: sessionJobSchema,
|
|
35
|
-
output: rowSchema.extend({ output: z.json().exactOptional(), problem: z.json().exactOptional() }),
|
|
35
|
+
output: rowSchema.extend({ output: z.json().exactOptional(), problem: z.json().exactOptional(), progress: z.object({ steps: z.number().int(), lastActivityAt: z.string(), recentCalls: z.array(z.string()) }).exactOptional(), waitingFor: z.array(z.string()).exactOptional() }),
|
|
36
36
|
public: true,
|
|
37
37
|
handle: async ({ sessionId, id }) => {
|
|
38
38
|
userOnly(ctx, 'kvcoder.job.get');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-jobs.js","sourceRoot":"","sources":["../../src/jobs/register-jobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAY,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAe,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"register-jobs.js","sourceRoot":"","sources":["../../src/jobs/register-jobs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAY,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAe,MAAM,eAAe,CAAC;AAE9F,kHAAkH;AAElH,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAC7E,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IACzB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC/C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IAC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.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import type { MapDoc, MapStatus, MapStep } from './map-schema.ts';
|
|
|
3
3
|
export type PlannedStep = {
|
|
4
4
|
id: string;
|
|
5
5
|
title: string;
|
|
6
|
-
description: string;
|
|
7
6
|
after?: string[] | undefined;
|
|
8
7
|
uses?: string | undefined;
|
|
9
8
|
check: string;
|
|
@@ -17,8 +16,10 @@ export type StepChange = {
|
|
|
17
16
|
};
|
|
18
17
|
/** What is wrong with a map's shape, or nothing. */
|
|
19
18
|
export declare function shapeProblem(steps: readonly PlannedStep[]): string | undefined;
|
|
20
|
-
/** The steps of a new map: one whose id the old map had keeps how far it got. */
|
|
19
|
+
/** The steps of a new map: one whose id the old map had keeps its details and how far it got. */
|
|
21
20
|
export declare function plannedSteps(planned: readonly PlannedStep[], old: readonly MapStep[]): MapStep[];
|
|
21
|
+
/** The refusal for a step the map doesn't have, naming the ones it has. */
|
|
22
|
+
export declare const unknownStep: (steps: readonly MapStep[], id: string) => string;
|
|
22
23
|
/** The steps after the changes, applied in order, or the first refusal: then nothing changes. */
|
|
23
24
|
export declare function changedSteps(steps: readonly MapStep[], changes: readonly StepChange[]): MapStep[] | string;
|
|
24
25
|
/** The steps that can start now: not started, with everything before them finished. */
|
|
@@ -31,6 +32,7 @@ export declare function mapProgress(map: Pick<MapDoc, 'goal' | 'steps' | 'notes'
|
|
|
31
32
|
ready: string[];
|
|
32
33
|
waiting: string[];
|
|
33
34
|
failed: string[];
|
|
35
|
+
undetailed: string[];
|
|
34
36
|
notes: number;
|
|
35
37
|
};
|
|
36
38
|
//# sourceMappingURL=map-rules.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-rules.d.ts","sourceRoot":"","sources":["../../src/maps/map-rules.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAKlE,gCAAgC;AAChC,MAAM,MAAM,WAA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U,GAAI,OAAO,SAAS,OAAO,EAAE,KAAG,OAAO,EAAkG,CAAC;AAIjK,oGAAoG;AACpG,wBAAgB,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;;;;;;;;;EAYxE"}
|
package/dist/maps/map-rules.js
CHANGED
|
@@ -30,11 +30,11 @@ export function shapeProblem(steps) {
|
|
|
30
30
|
const stuck = circle(steps);
|
|
31
31
|
return stuck.length === 0 ? undefined : `These steps wait on each other in a circle, so none can start: ${stuck.join(', ')}.`;
|
|
32
32
|
}
|
|
33
|
-
/** The steps of a new map: one whose id the old map had keeps how far it got. */
|
|
33
|
+
/** The steps of a new map: one whose id the old map had keeps its details and how far it got. */
|
|
34
34
|
export function plannedSteps(planned, old) {
|
|
35
35
|
return planned.map((step) => {
|
|
36
36
|
const kept = old.find((candidate) => candidate.id === step.id);
|
|
37
|
-
return { id: step.id, title: step.title,
|
|
37
|
+
return { id: step.id, title: step.title, details: kept?.details ?? null, after: step.after ?? [], uses: step.uses ?? null, check: step.check, status: kept?.status ?? 'todo', evidence: kept?.evidence ?? null, note: kept?.note ?? null };
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
const unfinishedBefore = (steps, step) => step.after.filter((id) => steps.find((candidate) => candidate.id === id)?.status !== 'done' && steps.find((candidate) => candidate.id === id)?.status !== 'skipped');
|
|
@@ -49,9 +49,11 @@ function changed(steps, step, change) {
|
|
|
49
49
|
if (before.length > 0)
|
|
50
50
|
return `${step.id} can't be ${change.status} yet: it comes after ${before.join(', ')}, which ${before.length === 1 ? 'is' : 'are'} not finished.`;
|
|
51
51
|
if (change.status === 'doing')
|
|
52
|
-
return { ...step, status: 'doing', note };
|
|
52
|
+
return step.details === null ? `${step.id} can't be doing yet: it has no details. Write them with execution-map detail first.` : { ...step, status: 'doing', note };
|
|
53
53
|
return change.evidence === undefined ? `${step.id} needs evidence to be done: say what you ran or checked and what it showed.` : { ...step, status: 'done', evidence: change.evidence, note };
|
|
54
54
|
}
|
|
55
|
+
/** The refusal for a step the map doesn't have, naming the ones it has. */
|
|
56
|
+
export const unknownStep = (steps, id) => `The map has no step ${id}. Its steps are: ${steps.map((step) => step.id).join(', ')}.`;
|
|
55
57
|
/** The steps after the changes, applied in order, or the first refusal: then nothing changes. */
|
|
56
58
|
export function changedSteps(steps, changes) {
|
|
57
59
|
let current = [...steps];
|
|
@@ -59,7 +61,7 @@ export function changedSteps(steps, changes) {
|
|
|
59
61
|
const index = current.findIndex((step) => step.id === change.id);
|
|
60
62
|
const step = current[index];
|
|
61
63
|
if (step === undefined)
|
|
62
|
-
return
|
|
64
|
+
return unknownStep(current, change.id);
|
|
63
65
|
const next = changed(current, step, change);
|
|
64
66
|
if (typeof next === 'string')
|
|
65
67
|
return next;
|
|
@@ -80,6 +82,7 @@ export function mapProgress(map) {
|
|
|
80
82
|
ready: named(ready),
|
|
81
83
|
waiting: named(map.steps.filter((step) => step.status === 'todo' && !ready.includes(step))),
|
|
82
84
|
failed: named(map.steps.filter((step) => step.status === 'failed')),
|
|
85
|
+
undetailed: named(map.steps.filter((step) => step.details === null)),
|
|
83
86
|
notes: map.notes.length,
|
|
84
87
|
};
|
|
85
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-rules.js","sourceRoot":"","sources":["../../src/maps/map-rules.ts"],"names":[],"mappings":"AAWA,MAAM,QAAQ,GAAG,CAAC,IAAa,EAAW,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,MAAM,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC;AAEjG,SAAS,MAAM,CAAC,KAA6B;IAC3C,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,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|
5
5
|
title: z.ZodString;
|
|
6
|
-
|
|
6
|
+
details: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
7
7
|
after: z.ZodArray<z.ZodString>;
|
|
8
8
|
uses: z.ZodNullable<z.ZodString>;
|
|
9
9
|
check: z.ZodString;
|
|
@@ -24,10 +24,10 @@ export declare const mapNoteSchema: z.ZodObject<{
|
|
|
24
24
|
export declare const mapDocSchema: z.ZodObject<{
|
|
25
25
|
sessionId: z.ZodString;
|
|
26
26
|
goal: z.ZodString;
|
|
27
|
-
steps: z.ZodArray<z.ZodObject<{
|
|
27
|
+
steps: z.ZodArray<z.ZodPreprocess<z.ZodObject<{
|
|
28
28
|
id: z.ZodString;
|
|
29
29
|
title: z.ZodString;
|
|
30
|
-
|
|
30
|
+
details: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
31
31
|
after: z.ZodArray<z.ZodString>;
|
|
32
32
|
uses: z.ZodNullable<z.ZodString>;
|
|
33
33
|
check: z.ZodString;
|
|
@@ -40,7 +40,7 @@ export declare const mapDocSchema: z.ZodObject<{
|
|
|
40
40
|
}>;
|
|
41
41
|
evidence: z.ZodNullable<z.ZodString>;
|
|
42
42
|
note: z.ZodNullable<z.ZodString>;
|
|
43
|
-
}, z.core.$strip>>;
|
|
43
|
+
}, z.core.$strip>, unknown>>;
|
|
44
44
|
notes: z.ZodArray<z.ZodObject<{
|
|
45
45
|
text: z.ZodString;
|
|
46
46
|
createdAt: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-schema.d.ts","sourceRoot":"","sources":["../../src/maps/map-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAK/B,eAAO,MAAM,WAAW,yDAA0D,CAAC;AAEnF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;iBAWxB,CAAC;
|
|
1
|
+
{"version":3,"file":"map-schema.d.ts","sourceRoot":"","sources":["../../src/maps/map-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAK/B,eAAO,MAAM,WAAW,yDAA0D,CAAC;AAEnF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;iBAWxB,CAAC;AASH,eAAO,MAAM,aAAa;;;iBAAwD,CAAC;AAEnF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQvB,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AACrD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;AACrD,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
package/dist/maps/map-schema.js
CHANGED
|
@@ -5,8 +5,8 @@ export const mapStatuses = ['todo', 'doing', 'done', 'failed', 'skipped'];
|
|
|
5
5
|
export const mapStepSchema = z.object({
|
|
6
6
|
id: z.string(),
|
|
7
7
|
title: z.string(),
|
|
8
|
-
// A step stored before ADR 0072 has none.
|
|
9
|
-
|
|
8
|
+
// A step not yet detailed, or stored before ADR 0072, has none.
|
|
9
|
+
details: z.string().nullable().default(null),
|
|
10
10
|
after: z.array(z.string()),
|
|
11
11
|
uses: z.string().nullable(),
|
|
12
12
|
check: z.string(),
|
|
@@ -14,11 +14,18 @@ export const mapStepSchema = z.object({
|
|
|
14
14
|
evidence: z.string().nullable(),
|
|
15
15
|
note: z.string().nullable(),
|
|
16
16
|
});
|
|
17
|
+
// A step stored before ADR 0086 has its details as `description`; it is read as `details`, and the next save writes that.
|
|
18
|
+
function storedStep(value) {
|
|
19
|
+
if (typeof value !== 'object' || value === null || !('description' in value) || 'details' in value)
|
|
20
|
+
return value;
|
|
21
|
+
const { description, ...rest } = value;
|
|
22
|
+
return { ...rest, details: description };
|
|
23
|
+
}
|
|
17
24
|
export const mapNoteSchema = z.object({ text: z.string(), createdAt: z.string() });
|
|
18
25
|
export const mapDocSchema = z.object({
|
|
19
26
|
sessionId: z.string(),
|
|
20
27
|
goal: z.string(),
|
|
21
|
-
steps: z.array(mapStepSchema),
|
|
28
|
+
steps: z.array(z.preprocess(storedStep, mapStepSchema)),
|
|
22
29
|
notes: z.array(mapNoteSchema),
|
|
23
30
|
version: z.number().int().min(1),
|
|
24
31
|
createdAt: z.string(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-schema.js","sourceRoot":"","sources":["../../src/maps/map-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAE/B,mHAAmH;AACnH,qFAAqF;AAErF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAU,CAAC;AAEnF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,
|
|
1
|
+
{"version":3,"file":"map-schema.js","sourceRoot":"","sources":["../../src/maps/map-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAE/B,mHAAmH;AACnH,qFAAqF;AAErF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAU,CAAC;AAEnF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,gEAAgE;IAChE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAC5C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E,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC"}
|
|
@@ -5,7 +5,7 @@ function languageName(code) {
|
|
|
5
5
|
const name = new Intl.DisplayNames(['en'], { type: 'language' }).of(code);
|
|
6
6
|
return name === undefined || name === code ? code : `${name} (${code})`;
|
|
7
7
|
}
|
|
8
|
-
// The base prompt (ADR 0009, 163 and 166; ADR 0011, 1; ADR 0022): who the agent is, its one tool, connectors, and how it works.
|
|
8
|
+
// The base prompt (ADR 0009, 163 and 166; ADR 0011, 1; ADR 0022; ADR 0089, 1): who the agent is, its one tool, connectors, and how it works.
|
|
9
9
|
function basePrompt(input) {
|
|
10
10
|
const shell = input.shell === 'bash' ? 'bash' : 'PowerShell';
|
|
11
11
|
const identity = [
|
|
@@ -13,7 +13,7 @@ function basePrompt(input) {
|
|
|
13
13
|
`Reply in ${languageName(input.language)} unless the person writes in another language.`,
|
|
14
14
|
'Each message from the person starts with the date and time it was sent, in brackets; the newest one is the current time.',
|
|
15
15
|
].join('\n');
|
|
16
|
-
const tool = 'Your one tool is run: it runs one command of a connector, as {
|
|
16
|
+
const tool = 'Your one tool is run: it runs one command of a connector, as { connector, command, payload }. Below, `fs write` means the connector fs and its command write.';
|
|
17
17
|
const connectors = `Connectors are the only way you act. When a connector other than shell covers a task, use it instead of a shell line: it checks its input, returns structured results, and is shown to the person. Use shell only for what no other connector does. Every connector has the command help. A command listed below with its payload needs no help call; for any other command, or for what a field means, call the connector's help with { "command": "<name>" } before the first use. \`shell exec\`, \`fs write\`, \`fs edit\`, \`mcp call\`, and \`mcp run\` take risky, which you always send and judge for each call from what the call does, not from which command it is. It is false for the ordinary work of the task: creating, editing, or rewriting a file inside the workspace folder that the task needs, whoever made it (\`fs undo\` takes such a change back), running the project's own build, tests, and tools, and a tool that only reads. It is true, and the person is then asked first, only when the call could do what is hard to take back or reaches past the task: anything outside the workspace folder; deleting files, or overwriting them with a shell line; a file that holds secrets, such as .env or a key; rewriting or discarding git history or uncommitted work (push --force, reset --hard, clean); sudo, or an install outside the project; sending something out (a push, a publish, a deploy, a message, a write to a remote service); and the Commands section of AGENTS.md. When you can't tell whether a call can be taken back, it is true. Each \`shell exec\` starts in the workspace folder, so cd doesn't carry over to the next call; the shell is ${shell}.`;
|
|
18
18
|
return [identity, tool, connectors, workingMethod(input.role, input.profile?.method)].join('\n\n');
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-prompt.js","sourceRoot":"","sources":["../../src/prompt/build-prompt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,aAAa,EAA0B,MAAM,qBAAqB,CAAC;AAsB1F,MAAM,OAAO,GAA6C,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;AAEhH,SAAS,YAAY,CAAC,IAAY;IAChC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC1E,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,KAAK,IAAI,GAAG,CAAC;AAC1E,CAAC;AAED,
|
|
1
|
+
{"version":3,"file":"build-prompt.js","sourceRoot":"","sources":["../../src/prompt/build-prompt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,aAAa,EAA0B,MAAM,qBAAqB,CAAC;AAsB1F,MAAM,OAAO,GAA6C,EAAE,KAAK,EAAE,OAAO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,MAAM,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAClH,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;AACvE,CAAC"}
|
|
@@ -43,7 +43,7 @@ export declare function prepareGrants(ctx: Ctx): Promise<{
|
|
|
43
43
|
readOnly: boolean;
|
|
44
44
|
connectors: string[] | null;
|
|
45
45
|
model: string | null;
|
|
46
|
-
thinking: "off" | "minimal" | "low" | "medium" | "high" | null;
|
|
46
|
+
thinking: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null;
|
|
47
47
|
name: string;
|
|
48
48
|
description: string;
|
|
49
49
|
enabled: boolean;
|
|
@@ -77,7 +77,7 @@ export declare function grantsInTx(store: TxRecords, session: Stored<SessionDoc>
|
|
|
77
77
|
readOnly: boolean;
|
|
78
78
|
} | null;
|
|
79
79
|
model: string | null;
|
|
80
|
-
thinking: "off" | "minimal" | "low" | "medium" | "high";
|
|
80
|
+
thinking: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
81
81
|
usageBy: {
|
|
82
82
|
summary: {
|
|
83
83
|
input: number;
|
|
@@ -176,7 +176,7 @@ export declare function grantsInTx(store: TxRecords, session: Stored<SessionDoc>
|
|
|
176
176
|
readOnly: boolean;
|
|
177
177
|
connectors: string[] | null;
|
|
178
178
|
model: string | null;
|
|
179
|
-
thinking: "off" | "minimal" | "low" | "medium" | "high" | null;
|
|
179
|
+
thinking: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | null;
|
|
180
180
|
name: string;
|
|
181
181
|
description: string;
|
|
182
182
|
enabled: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// How the agent works (plan 08 §8.2; ADR 0022, 2 to 4; ADR 0065; ADR 0072; ADR 0074; ADR 0075; ADR 0078; ADR 0081): the lead of a chat sizes up each task and chooses its path from the
|
|
1
|
+
// How the agent works (plan 08 §8.2; ADR 0022, 2 to 4; ADR 0065; ADR 0072; ADR 0074; ADR 0075; ADR 0078; ADR 0081; ADR 0089): the lead of a chat sizes up each task and chooses its path from the
|
|
2
2
|
// named parts; a worker does the one task it was given and answers the lead alone (ADR 0063). Both end with the call-or-final-answer rule.
|
|
3
3
|
const evidence = 'Decide from evidence: every decision and every claim rests on something you read, ran, or were told. When you report a result, say what you checked and what you didn\'t.';
|
|
4
4
|
const simplest = "Use the simplest practical way that follows the project's conventions and sound engineering practice, and don't add what wasn't asked: no extra feature, file, option, or document.";
|
|
@@ -7,19 +7,19 @@ const context = "Spend context with care: every result stays in the conversation
|
|
|
7
7
|
const artifacts = 'Show the person anything long to read or see (a report, a design, an HTML page) in an artifact, not in a reply.';
|
|
8
8
|
const asking = 'To put a question to the person (a choice, a yes or no, a free answer), call `ask`.';
|
|
9
9
|
const checked = "Before you say that something runs or works, check it the way the person would: run it, request its address, or run its test; if you couldn't, say what is unchecked. After you start a server, request its address once before you give it to the person.";
|
|
10
|
-
const
|
|
11
|
-
const callOrFinalAnswer = '
|
|
10
|
+
const narrate = "Talk to the person as you work, the way a colleague thinks aloud. Between calls, when you learn something that changes what you do next, say so in a sentence or two in the reply that makes the next call: what you found, and what you do now (\"The import fails because the path is passed as an id; fixing the importer next.\"). Don't announce routine calls, and don't repeat what a call's card already shows. Write for a person, not a log: plain everyday words, short sentences, and the point first. Leave out connector and command names, payloads, ids, and long output unless they ask; name a file or a technical term only when it helps them, and explain the term in a few words. Use a short list for several items, and no headings or tables in a short reply. Your final answer says what you did and what is left.";
|
|
11
|
+
const callOrFinalAnswer = 'A reply with no tool call is your final answer and ends the turn: when work remains, your reply must contain the call that does the next piece. A reply that only says what you will do ("now I will write the file") ends the turn with nothing done. Never make a call that does nothing, such as `true`, just to keep going.';
|
|
12
12
|
const leadMethod = [
|
|
13
13
|
'How you work. You are the one who decides: connectors and workers are how you act, and the result is yours. No path is fixed: you choose it for each task from what the task is, and you change it when what you find changes it.',
|
|
14
|
-
'Size up the task first. Read the request and look at what it touches, then judge four things: how clear it is (can you say what done looks like?), how much it changes (one place, or several parts that depend on each other), what could go wrong and how hard that is to take back, and whether the person will look at the result (a screen, a page, a report). From that, choose the lightest path that delivers the task well. A question needs an answer from what you read, and no change. A small, clear change needs doing and checking, and nothing more. An unclear request needs its questions answered before any work. Work
|
|
14
|
+
'Size up the task first. Read the request and look at what it touches, then judge four things: how clear it is (can you say what done looks like?), how much it changes (one place, or several parts that depend on each other), what could go wrong and how hard that is to take back, and whether the person will look at the result (a screen, a page, a report). From that, choose the lightest path that delivers the task well. A question needs an answer from what you read, and no change. A small, clear change needs doing and checking, and nothing more. An unclear request needs its questions answered before any work. Work that changes several parts that depend on each other, or that is hard to take back, needs an execution map the person agreed to; other work, even of a few steps, needs no map: do it, and say where you are as you go. Separate parts may need workers, and a result the person looks at needs showing. A task that turns out larger than it looked gets its map then, and one that turns out simple drops what it does not need.',
|
|
15
15
|
'These are the parts of a path. Use only the ones your path has.',
|
|
16
16
|
"Understand. Before you decide anything, find out what the person is trying to achieve, as far as the task needs. Read everything they sent, attached images and files too, then look at what exists: the files, config, tests, and data the request touches, the project's rules, and what already does part of it, so you build on it and not beside it. Work out what the person needs, not only what they typed: answer for yourself what outcome they want and what they will do with it; what done looks like to them, as examples they would check (an exact name, a screen, an output); what the work changes or must keep working (other callers, stored data, settings, users); whether they asked for a goal or for a particular means (a format, a library, a design), and whether that means serves the goal; what they didn't say that changes the result (who uses it, how much data or load, which platforms and languages, privacy and security, and how good is good enough); and which of your connectors and workers help, and what is missing. Never assume or invent names, paths, APIs, or behavior: read a guide, or the current documentation of a library or service, through a connector that reaches it rather than from memory, and when you can't find a fact, say so or ask.",
|
|
17
|
-
"Clarify. Sort what looking left open. A fact that looking would answer: look, don't ask. An ordinary detail that is easy to change: decide it yourself, and say what you chose. A decision only the person can make, or a gap that changes the result, the design, or stored data, such as a request that is unclear, contradicts itself or the code, or would break what exists: ask before any work. When the means they asked for works against their goal, or a clearly better way exists, say so and offer both before you build theirs. Ask in one round when you can, after you looked and before you plan: put
|
|
18
|
-
"Plan. Only after you understood the request, looked at what exists, and have your answers, and before you change anything, plan with `execution-map set`: never in your first reply, because a map made before you looked is a guess. The map is your execution path: the steps that, from what you found, are the best, most practical, and fastest way to deliver what the person asked with the connectors and workers you have. It is the implementation plan the person reads and agrees to, so make it detailed, not an outline. Give the goal, the outcome the person wants in their own terms, then the steps, each with a title,
|
|
19
|
-
'Confirm the plan. The person agrees to the map before you work on it. Once
|
|
20
|
-
"Execute. With a map, the map is how you work, and the person follows the work on it, so it must always say where you are. Every map call returns the steps that are ready: take those, and never work on a step the map does not have. Mark a step doing before your first call on it, in the same reply as that call, and when several are ready, mark each one you start. When several steps are ready together they are branches: mark each doing and start them all in one reply, one `delegate run` each, so they run at the same time. Hand any step whose uses names a worker to that worker with `delegate run`, and check its answer before you mark the step done. For each step, make the smallest change that does it, check it the way its check says, and fix a failure at its cause. As soon as its check passed, mark it done with your evidence, which is what you ran and what it showed, before you start the next step: don't save the marks for the end. A step is not done because you wrote it. Mark a step you can't finish failed with a note that says why, and one that turned out unneeded skipped with a note. When the plan itself changes (a step is missing, one is no longer needed, or the order was wrong), set the map again before you go on: a step whose id stays keeps how far it got. With no map, make the smallest change that does the task, check it, and fix a failure at its cause.",
|
|
17
|
+
"Clarify. Sort what looking left open. A fact that looking would answer: look, don't ask. An ordinary detail that is easy to change: decide it yourself, and say what you chose. A decision only the person can make, or a gap that changes the result, the design, or stored data, such as a request that is unclear, contradicts itself or the code, or would break what exists: ask before any work. When the means they asked for works against their goal, or a clearly better way exists, say so and offer both before you build theirs. Ask in one round when you can, after you looked and before you plan: put every question in the same reply, one `ask` call each, never one question per reply, and use `ask choice` whenever you offer options, your recommended one first and each option saying what it leads to.",
|
|
18
|
+
"Plan. Only when your path needs a map, and only after you understood the request, looked at what exists, and have your answers, and before you change anything, plan with `execution-map set`: never in your first reply, because a map made before you looked is a guess. The map is your execution path: the steps that, from what you found, are the best, most practical, and fastest way to deliver what the person asked with the connectors and workers you have. It is the implementation plan the person reads and agrees to, so make it detailed, not an outline. Give the goal, the outcome the person wants in their own terms, then the steps, each with a title, what it comes after, what it uses, and how you will check it. A step is one stage of the path: what gets done, who does it, and how it is checked. It may cover the few files that change together, but it is always concrete, something you can name before you start it, never a phase such as implement or a whole feature. Choose for each step whoever does it best and fastest, and name it in uses: yourself, with a connector from the list below, for an ordinary or small change; or a worker of the `delegate` connector whose description fits, when the step needs that skill: a designer for a screen or flow whose design is a real choice, an architect for a structure decision that spans several parts, a tester for tests that are a piece of work of their own, a reviewer for a finished change that is risky or wide. A step's details say what it changes and how, naming the files or parts and the approach, in words the person understands without reading the code: write them in Markdown, with a list, a table, or a Mermaid diagram or chart in a fenced mermaid block where it shows the step better than words, and never SVG. Its check is the exact command you will run or the thing you will look at. Shape the map from how the work will really run. Your own steps are one line: each comes after the one before it, in the order you will do them. A branch means delegation: steps side by side on the map run at the same time, each done by a worker. So draw a branch only for a piece of work you hand to a worker: it needs nothing from the other branches, it touches files or parts no other branch touches, it is large enough to be worth a worker that starts with none of this conversation, and its step names that worker in uses. Give the branches that start together the same `after`, or none, and don't split small independent changes into branches: do them in your own line. Where branches meet, add the step that joins them, such as wiring the parts together or the check that needs all of them, after every branch it needs. Leave out any step that nothing needs, and end the map with the project's own checks (its build, lint, and tests), after everything they cover. Set the map's skeleton first, with no details, then write each step's details with `execution-map detail`, one call per step, all in the reply after the set. When you set the map again, a step whose id stays keeps its details: detail again only a step whose approach changed, and each new step.",
|
|
19
|
+
'Confirm the plan. The person agrees to the map before you work on it. Once the first map of the request, or a map you set again with a change to what the person gets (the goal, what done looks like, what stays as it is, stored data, or what could go wrong), has details on every step (its undetailed list is empty), and before you start any step, call `ask choice` with other set to true. Its question first says in a few lines what you understood: the goal, what done looks like, what stays as it is, and the choices you made for the person; then it asks whether to start, with the option that starts first and an option that changes the plan, so the person can write what to change. When they ask for changes, set the map again with them, detail what changed, and ask again; start only after they chose to start. A change inside the plan, such as who does a step, the order, a step split or retried, or a worker reassigned, needs no confirmation: set the map and say what changed in one line. Never ask the person to confirm a choice they have just made. A change of status with `execution-map update` needs no confirmation.',
|
|
20
|
+
"Execute. With a map, the map is how you work, and the person follows the work on it, so it must always say where you are. Every map call returns the steps that are ready: take those, and never work on a step the map does not have. Mark a step doing before your first call on it, in the same reply as that call, and when several are ready, mark each one you start. When several steps are ready together they are branches: mark each doing and start them all in one reply, one `delegate run` each, so they run at the same time. Hand any step whose uses names a worker to that worker with `delegate run`, and check its answer before you mark the step done. For each step, make the smallest change that does it, check it the way its check says, and fix a failure at its cause. As soon as its check passed, mark it done with your evidence, which is what you ran and what it showed, before you start the next step: don't save the marks for the end. A step is not done because you wrote it. Mark a step you can't finish failed with a note that says why, and one that turned out unneeded skipped with a note. When the plan itself changes (a step is missing, one is no longer needed, or the order was wrong), set the map again before you go on: a step whose id stays keeps how far it got and its details. With no map, make the smallest change that does the task, check it, and fix a failure at its cause.",
|
|
21
21
|
'Stay on the task. Do what was asked and nothing else. When you notice a problem the task does not need (a bug somewhere else, a refactor, an improvement), do not look into it: record it with `execution-map note`, or keep it for your final answer when there is no map, and go on.',
|
|
22
|
-
"Delegate. A step goes to a worker of the `delegate` connector when the worker does it better or faster than you would: a specialist whose skill the step needs, separate work that runs beside yours, or a fresh review of a change you finished; its entry lists the workers and what each is for. Don't delegate what a few calls of your own would do, and ask for one review of a piece of work, not several. Several `delegate run` calls in one reply run in parallel. Brief the worker with the goal, the facts it needs, its limits, and what to return. A worker sees none of this conversation and reads again every file it needs, so put the paths, the lines
|
|
22
|
+
"Delegate. A step goes to a worker of the `delegate` connector when the worker does it better or faster than you would: a specialist whose skill the step needs, separate work that runs beside yours, or a fresh review of a change you finished; its entry lists the workers and what each is for. Don't delegate what a few calls of your own would do, and ask for one review of a piece of work, not several. Several `delegate run` calls in one reply run in parallel. Brief the worker with the goal, the facts it needs, its limits, and what to return. A worker sees none of this conversation and reads again every file it needs, so put in the brief the paths, the exact lines it needs quoted when they are short, and what you already found, so it doesn't read again what you hold. Read what a worker returns and check it before you rely on it: its work is your responsibility. A worker cannot ask the person or write an artifact: its questions, and anything worth showing the person, come back in its answer for you to act on.",
|
|
23
23
|
'Show what the person will look at. When the task includes a screen, a page, a layout, or a style, show it in an artifact: the design as an HTML page before you build it when the layout is a real choice, and the running app as a url artifact once it runs. Build it in the language and direction of its content (right to left for Arabic), with sizes that are easy to read, text that stands out clearly from its background, and calm colours; every field and every element that shows text the person typed has dir="auto", so Arabic they type reads right to left on any page. Check it as far as your connectors let you before you show it: when the mcp connector gives you a browser, try the page\'s main actions with one `mcp run`.',
|
|
24
24
|
"Finish. The work is done when it is ready for production: it does what was asked, it handles the errors and edge cases that will happen, it follows the project's conventions, its checks and tests pass, and nothing unfinished or temporary is left behind. Stop what you started in the background and no longer need, and delete the temporary files you or your tools left in the workspace folder, such as logs, snapshots, and scratch files. Leave running what the person will try themselves, such as the app or page you built, with its address in a url artifact when it has one. When you found how this project is built, tested, or run and its AGENTS.md does not say it, add a short Commands section to AGENTS.md with risky set to true: that asks the person, so don't ask them a second time with `ask`. Your final answer, in plain words and as short as the facts allow, says what was done, what you checked and what it showed, what is unchecked, what still runs in the background, and what you noted for later.",
|
|
25
25
|
evidence,
|
|
@@ -29,12 +29,12 @@ const leadMethod = [
|
|
|
29
29
|
artifacts,
|
|
30
30
|
asking,
|
|
31
31
|
checked,
|
|
32
|
-
|
|
32
|
+
narrate,
|
|
33
33
|
callOrFinalAnswer,
|
|
34
34
|
].join('\n');
|
|
35
35
|
const generalSimplest = "Use the simplest way that does what was asked, and don't add what wasn't asked.";
|
|
36
36
|
const generalLeadMethod = [
|
|
37
|
-
"How you work. Understand what the person wants: read everything they sent, attached images and files too, and look at what the task touches. When something only they can decide is unclear, ask it in one round with `ask`: one question per call, all the calls in one reply, and `ask choice` whenever you offer options, your recommended one first. Then do the task with your connectors and workers, check the result, and answer briefly.",
|
|
37
|
+
"How you work. Understand what the person wants: read everything they sent, attached images and files too, and look at what the task touches. When something only they can decide is unclear, ask it in one round with `ask`: one question per call, all the calls in the same reply and never one question per reply, and `ask choice` whenever you offer options, your recommended one first. Then do the task with your connectors and workers, check the result, and answer briefly.",
|
|
38
38
|
evidence,
|
|
39
39
|
generalSimplest,
|
|
40
40
|
together,
|
|
@@ -42,7 +42,7 @@ const generalLeadMethod = [
|
|
|
42
42
|
artifacts,
|
|
43
43
|
asking,
|
|
44
44
|
checked,
|
|
45
|
-
|
|
45
|
+
narrate,
|
|
46
46
|
callOrFinalAnswer,
|
|
47
47
|
].join('\n');
|
|
48
48
|
const workerStart = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"working-method.js","sourceRoot":"","sources":["../../src/prompt/working-method.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"working-method.js","sourceRoot":"","sources":["../../src/prompt/working-method.ts"],"names":[],"mappings":"AAAA,kMAAkM;AAClM,2IAA2I;AAQ3I,MAAM,QAAQ,GAAG,2KAA2K,CAAC;AAC7L,MAAM,QAAQ,GAAG,qLAAqL,CAAC;AACvM,MAAM,QAAQ,GAAG,kZAAkZ,CAAC;AACpa,MAAM,OAAO,GAAG,qbAAqb,CAAC;AACtc,MAAM,SAAS,GAAG,iHAAiH,CAAC;AACpI,MAAM,MAAM,GAAG,qFAAqF,CAAC;AACrG,MAAM,OAAO,GAAG,4PAA4P,CAAC;AAC7Q,MAAM,OAAO,GACX,+yBAA+yB,CAAC;AAClzB,MAAM,iBAAiB,GACrB,iUAAiU,CAAC;AAEpU,MAAM,UAAU,GAAG;IACjB,mOAAmO;IACnO,+gCAA+gC;IAC/gC,iEAAiE;IACjE,4uCAA4uC;IAC5uC,kyBAAkyB;IAClyB,8iGAA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C,CAAC,GAAG,QAAQ,yDAAyD,KAAK,GAAG,CAAC;IACrK,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,uLAAuL,KAAK,GAAG,CAAC;IAC5N,OAAO,0EAA0E,KAAK,mDAAmD,CAAC;AAC5I,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,aAAa,CAAC,IAAU,EAAE,SAAiB,aAAa;IACtE,IAAI,MAAM,KAAK,aAAa;QAAE,OAAO,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC;IACjF,OAAO,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,mBAAmB,CAAC;AACnE,CAAC"}
|
|
@@ -7,6 +7,8 @@ export declare const settingSchemas: {
|
|
|
7
7
|
low: "low";
|
|
8
8
|
medium: "medium";
|
|
9
9
|
high: "high";
|
|
10
|
+
xhigh: "xhigh";
|
|
11
|
+
max: "max";
|
|
10
12
|
}>;
|
|
11
13
|
maxSteps: z.ZodNullable<z.ZodNumber>;
|
|
12
14
|
approval: z.ZodEnum<{
|
|
@@ -50,6 +52,8 @@ export declare const settingSchemas: {
|
|
|
50
52
|
low: "low";
|
|
51
53
|
medium: "medium";
|
|
52
54
|
high: "high";
|
|
55
|
+
xhigh: "xhigh";
|
|
56
|
+
max: "max";
|
|
53
57
|
}>>;
|
|
54
58
|
name: z.ZodString;
|
|
55
59
|
description: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-settings.d.ts","sourceRoot":"","sources":["../src/register-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAezC,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"register-settings.d.ts","sourceRoot":"","sources":["../src/register-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAezC,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAc1B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAe/C;AAED,kFAAkF;AAClF,wBAAsB,YAAY,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,GAAG,SAAS,CAAA;CAAE,CAAC,CAG9G;AAED,oJAAoJ;AACpJ,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAIvE;AAED,yCAAyC;AACzC,wBAAsB,YAAY,CAAC,GAAG,EAAE,GAAG;;;;;;;;;;;;;;;GAU1C;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,CAAC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { z } from '@kvman/sdk';
|
|
2
2
|
import type { JsonValue } from '../connector-call.ts';
|
|
3
3
|
export type { JsonValue };
|
|
4
|
-
/** How hard the model thinks, as kvai takes it. */
|
|
4
|
+
/** How hard the model thinks, as kvai takes it (ADR 0087, 11). */
|
|
5
5
|
export declare const thinkingSchema: z.ZodEnum<{
|
|
6
6
|
off: "off";
|
|
7
7
|
minimal: "minimal";
|
|
8
8
|
low: "low";
|
|
9
9
|
medium: "medium";
|
|
10
10
|
high: "high";
|
|
11
|
+
xhigh: "xhigh";
|
|
12
|
+
max: "max";
|
|
11
13
|
}>;
|
|
12
14
|
/** Tokens and cost, summed. */
|
|
13
15
|
export declare const usageSchema: z.ZodObject<{
|
|
@@ -106,6 +108,8 @@ export declare const sessionDocSchema: z.ZodObject<{
|
|
|
106
108
|
low: "low";
|
|
107
109
|
medium: "medium";
|
|
108
110
|
high: "high";
|
|
111
|
+
xhigh: "xhigh";
|
|
112
|
+
max: "max";
|
|
109
113
|
}>;
|
|
110
114
|
usageBy: z.ZodDefault<z.ZodObject<{
|
|
111
115
|
summary: z.ZodObject<{
|
|
@@ -245,9 +249,9 @@ export declare const pendingSchema: z.ZodObject<{
|
|
|
245
249
|
childSessionId: z.ZodNullable<z.ZodString>;
|
|
246
250
|
runId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
247
251
|
}, z.core.$strip>;
|
|
248
|
-
/** A call the person approves before it runs:
|
|
252
|
+
/** A call the person approves before it runs: the connector command with its payload. */
|
|
249
253
|
export declare const runCallSchema: z.ZodObject<{
|
|
250
|
-
description: z.ZodString
|
|
254
|
+
description: z.ZodExactOptional<z.ZodString>;
|
|
251
255
|
connector: z.ZodString;
|
|
252
256
|
command: z.ZodString;
|
|
253
257
|
payload: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
@@ -258,7 +262,7 @@ export declare const heldResultSchema: z.ZodObject<{
|
|
|
258
262
|
details: z.ZodNullable<z.ZodJSONSchema>;
|
|
259
263
|
isError: z.ZodBoolean;
|
|
260
264
|
run: z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
261
|
-
description: z.ZodString
|
|
265
|
+
description: z.ZodExactOptional<z.ZodString>;
|
|
262
266
|
connector: z.ZodString;
|
|
263
267
|
command: z.ZodString;
|
|
264
268
|
payload: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
@@ -312,7 +316,7 @@ export declare const turnDocSchema: z.ZodObject<{
|
|
|
312
316
|
details: z.ZodNullable<z.ZodJSONSchema>;
|
|
313
317
|
isError: z.ZodBoolean;
|
|
314
318
|
run: z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
315
|
-
description: z.ZodString
|
|
319
|
+
description: z.ZodExactOptional<z.ZodString>;
|
|
316
320
|
connector: z.ZodString;
|
|
317
321
|
command: z.ZodString;
|
|
318
322
|
payload: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
@@ -324,7 +328,7 @@ export declare const turnDocSchema: z.ZodObject<{
|
|
|
324
328
|
deferredCalls: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
325
329
|
toolCallId: z.ZodString;
|
|
326
330
|
call: z.ZodObject<{
|
|
327
|
-
description: z.ZodString
|
|
331
|
+
description: z.ZodExactOptional<z.ZodString>;
|
|
328
332
|
connector: z.ZodString;
|
|
329
333
|
command: z.ZodString;
|
|
330
334
|
payload: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../src/schemas/records.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../src/schemas/records.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,YAAY,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,YAAY,EAAE,SAAS,EAAE,CAAC;AAI1B,kEAAkE;AAClE,eAAO,MAAM,cAAc;;;;;;;;EAAyB,CAAC;AAIrD,+BAA+B;AAC/B,eAAO,MAAM,WAAW;;;;;;iBAAqH,CAAC;AAE9I,uDAAuD;AACvD,eAAO,MAAM,WAAW,aAAa,CAAC;AAEtC,0BAA0B;AAC1B,eAAO,MAAM,YAAY;;;;EAAyC,CAAC;AAEnE,kFAAkF;AAClF,eAAO,MAAM,WAAW;;;iBAAsD,CAAC;AAE/E,wBAAwB;AACxB,eAAO,MAAM,aAAa;;;;;;EAAqE,CAAC;AAEhG,iCAAiC;AACjC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jE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC7D,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC3D,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,YAAY,CAAC,CAAC;AACnD,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC3D,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC;AACjD,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,aAAa,CAAC,CAAC;AACrD,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,YAAY,CAAC,CAAC;AACnD,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
package/dist/schemas/records.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { z } from '@kvman/sdk';
|
|
2
2
|
import { artifactFormats } from "../artifacts/artifact-format.js";
|
|
3
|
+
import { thinkingLevels } from "../thinking-levels.js";
|
|
3
4
|
// kvcoder's records (plan 08 §8.1): sessions, messages, turns, and what waits on the person.
|
|
4
|
-
/** How hard the model thinks, as kvai takes it. */
|
|
5
|
-
export const thinkingSchema = z.enum(
|
|
5
|
+
/** How hard the model thinks, as kvai takes it (ADR 0087, 11). */
|
|
6
|
+
export const thinkingSchema = z.enum(thinkingLevels);
|
|
6
7
|
const tokens = z.number().int().nonnegative();
|
|
7
8
|
/** Tokens and cost, summed. */
|
|
8
9
|
export const usageSchema = z.object({ input: tokens, output: tokens, cacheRead: tokens, cacheWrite: tokens, cost: z.number().nonnegative() });
|
|
@@ -94,8 +95,10 @@ export const pendingSchema = z.object({
|
|
|
94
95
|
// The run of a program worker the call waits on (ADR 0021, 23).
|
|
95
96
|
runId: z.string().nullable().default(null),
|
|
96
97
|
});
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
// A call stored before ADR 0089 also holds the model's description of it, which only its approval card still shows
|
|
99
|
+
// (ADR 0089, 1).
|
|
100
|
+
/** A call the person approves before it runs: the connector command with its payload. */
|
|
101
|
+
export const runCallSchema = z.strictObject({ description: z.string().exactOptional(), connector: z.string(), command: z.string(), payload: z.record(z.string(), z.json()) });
|
|
99
102
|
// An approved call of the old shell tool. It is kept only so a turn stored before `run` still parses; it is never run
|
|
100
103
|
// (ADR 0011, 12).
|
|
101
104
|
const oldShellRunSchema = z.object({ command: z.string(), timeoutMs: z.number().int().positive() });
|