rosettify 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +126 -0
- package/README.md +9 -0
- package/dist/bin/rosettify.d.ts +3 -0
- package/dist/bin/rosettify.d.ts.map +1 -0
- package/dist/bin/rosettify.js +22 -0
- package/dist/bin/rosettify.js.map +1 -0
- package/dist/commands/help/index.d.ts +6 -0
- package/dist/commands/help/index.d.ts.map +1 -0
- package/dist/commands/help/index.js +97 -0
- package/dist/commands/help/index.js.map +1 -0
- package/dist/commands/plan/core.d.ts +141 -0
- package/dist/commands/plan/core.d.ts.map +1 -0
- package/dist/commands/plan/core.js +280 -0
- package/dist/commands/plan/core.js.map +1 -0
- package/dist/commands/plan/create.d.ts +4 -0
- package/dist/commands/plan/create.d.ts.map +1 -0
- package/dist/commands/plan/create.js +53 -0
- package/dist/commands/plan/create.js.map +1 -0
- package/dist/commands/plan/help-content.d.ts +136 -0
- package/dist/commands/plan/help-content.d.ts.map +1 -0
- package/dist/commands/plan/help-content.js +125 -0
- package/dist/commands/plan/help-content.js.map +1 -0
- package/dist/commands/plan/index.d.ts +4 -0
- package/dist/commands/plan/index.d.ts.map +1 -0
- package/dist/commands/plan/index.js +144 -0
- package/dist/commands/plan/index.js.map +1 -0
- package/dist/commands/plan/next.d.ts +4 -0
- package/dist/commands/plan/next.d.ts.map +1 -0
- package/dist/commands/plan/next.js +87 -0
- package/dist/commands/plan/next.js.map +1 -0
- package/dist/commands/plan/query.d.ts +4 -0
- package/dist/commands/plan/query.d.ts.map +1 -0
- package/dist/commands/plan/query.js +30 -0
- package/dist/commands/plan/query.js.map +1 -0
- package/dist/commands/plan/show-status.d.ts +4 -0
- package/dist/commands/plan/show-status.d.ts.map +1 -0
- package/dist/commands/plan/show-status.js +94 -0
- package/dist/commands/plan/show-status.js.map +1 -0
- package/dist/commands/plan/update-status.d.ts +4 -0
- package/dist/commands/plan/update-status.d.ts.map +1 -0
- package/dist/commands/plan/update-status.js +37 -0
- package/dist/commands/plan/update-status.js.map +1 -0
- package/dist/commands/plan/upsert.d.ts +4 -0
- package/dist/commands/plan/upsert.d.ts.map +1 -0
- package/dist/commands/plan/upsert.js +175 -0
- package/dist/commands/plan/upsert.js.map +1 -0
- package/dist/frontends/cli.d.ts +2 -0
- package/dist/frontends/cli.d.ts.map +1 -0
- package/dist/frontends/cli.js +201 -0
- package/dist/frontends/cli.js.map +1 -0
- package/dist/frontends/mcp.d.ts +2 -0
- package/dist/frontends/mcp.d.ts.map +1 -0
- package/dist/frontends/mcp.js +41 -0
- package/dist/frontends/mcp.js.map +1 -0
- package/dist/registry/index.d.ts +6 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +16 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/types.d.ts +57 -0
- package/dist/registry/types.d.ts.map +1 -0
- package/dist/registry/types.js +3 -0
- package/dist/registry/types.js.map +1 -0
- package/dist/shared/concurrency.d.ts +25 -0
- package/dist/shared/concurrency.d.ts.map +1 -0
- package/dist/shared/concurrency.js +39 -0
- package/dist/shared/concurrency.js.map +1 -0
- package/dist/shared/constants.d.ts +7 -0
- package/dist/shared/constants.d.ts.map +1 -0
- package/dist/shared/constants.js +8 -0
- package/dist/shared/constants.js.map +1 -0
- package/dist/shared/dispatch.d.ts +4 -0
- package/dist/shared/dispatch.d.ts.map +1 -0
- package/dist/shared/dispatch.js +106 -0
- package/dist/shared/dispatch.js.map +1 -0
- package/dist/shared/envelope.d.ts +5 -0
- package/dist/shared/envelope.d.ts.map +1 -0
- package/dist/shared/envelope.js +10 -0
- package/dist/shared/envelope.js.map +1 -0
- package/dist/shared/logger.d.ts +3 -0
- package/dist/shared/logger.d.ts.map +1 -0
- package/dist/shared/logger.js +9 -0
- package/dist/shared/logger.js.map +1 -0
- package/package.json +51 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship made available under
|
|
36
|
+
the License, as indicated by a copyright notice that is included in
|
|
37
|
+
or attached to the work (an example is provided in the Appendix below).
|
|
38
|
+
|
|
39
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
40
|
+
form, that is based on (or derived from) the Work and for which the
|
|
41
|
+
editorial revisions, annotations, elaborations, or other
|
|
42
|
+
transformations represent, as a whole, an original work of authorship.
|
|
43
|
+
|
|
44
|
+
"Contribution" shall mean, as submitted to the Licensor for inclusion
|
|
45
|
+
in the Work by the copyright owner or by an individual or Legal Entity
|
|
46
|
+
authorized to submit on behalf of the copyright owner.
|
|
47
|
+
|
|
48
|
+
"Contributor" shall mean Licensor and any Legal Entity on behalf of
|
|
49
|
+
whom a Contribution has been received by the Licensor and included
|
|
50
|
+
within the Work.
|
|
51
|
+
|
|
52
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
53
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
54
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
55
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
56
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
57
|
+
Work and such Derivative Works in Source or Object form.
|
|
58
|
+
|
|
59
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
60
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
61
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
62
|
+
(except as stated in this section) patent license to make, have made,
|
|
63
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
64
|
+
where such license applies only to those patent claims licensable
|
|
65
|
+
by such Contributor that are necessarily infringed by their
|
|
66
|
+
Contribution(s) alone or by the combined work.
|
|
67
|
+
|
|
68
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
69
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
70
|
+
modifications, and in Source or Object form, provided that You
|
|
71
|
+
meet the following conditions:
|
|
72
|
+
|
|
73
|
+
(a) You must give any other recipients of the Work or Derivative
|
|
74
|
+
Works a copy of this License; and
|
|
75
|
+
|
|
76
|
+
(b) You must cause any modified files to carry prominent notices
|
|
77
|
+
stating that You changed the files; and
|
|
78
|
+
|
|
79
|
+
(c) You must retain, in all Source and Derivative Works, all
|
|
80
|
+
copyright, patent, trademark, and attribution notices from
|
|
81
|
+
the Source form of the Work, excluding those notices that
|
|
82
|
+
do not pertain to any part of the Derivative Works; and
|
|
83
|
+
|
|
84
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
85
|
+
distribution, You must include a readable copy of the
|
|
86
|
+
attribution notices contained within such NOTICE file.
|
|
87
|
+
|
|
88
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
89
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
90
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
91
|
+
this License, without any additional terms or conditions.
|
|
92
|
+
|
|
93
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
94
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
95
|
+
except as required for reasonable and customary use in describing
|
|
96
|
+
the origin of the Work.
|
|
97
|
+
|
|
98
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed
|
|
99
|
+
to in writing, Licensor provides the Work on an "AS IS" BASIS,
|
|
100
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND.
|
|
101
|
+
|
|
102
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
103
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
104
|
+
shall any Contributor be liable to You for damages.
|
|
105
|
+
|
|
106
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
107
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
108
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
109
|
+
or other liability obligations. However, in accepting such obligations,
|
|
110
|
+
You may offer such obligations only on Your own behalf.
|
|
111
|
+
|
|
112
|
+
END OF TERMS AND CONDITIONS
|
|
113
|
+
|
|
114
|
+
Copyright 2024 Rosetta Authors
|
|
115
|
+
|
|
116
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
117
|
+
you may not use this file except in compliance with the License.
|
|
118
|
+
You may obtain a copy of the License at
|
|
119
|
+
|
|
120
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
121
|
+
|
|
122
|
+
Unless required by applicable law or agreed to in writing, software
|
|
123
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
124
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
125
|
+
See the License for the specific language governing permissions and
|
|
126
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rosettify.d.ts","sourceRoot":"","sources":["../../src/bin/rosettify.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { runCli } from "../frontends/cli.js";
|
|
3
|
+
import { runMcp } from "../frontends/mcp.js";
|
|
4
|
+
const args = process.argv.slice(2);
|
|
5
|
+
if (args.includes("--mcp")) {
|
|
6
|
+
// Remove --mcp from args, verify no command args remain
|
|
7
|
+
const filtered = args.filter((a) => a !== "--mcp");
|
|
8
|
+
if (filtered.length > 0) {
|
|
9
|
+
process.stderr.write(JSON.stringify({
|
|
10
|
+
ok: false,
|
|
11
|
+
error: "--mcp is mutually exclusive with commands",
|
|
12
|
+
result: null,
|
|
13
|
+
include_help: false,
|
|
14
|
+
}) + "\n");
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
await runMcp();
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
await runCli(args);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=rosettify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rosettify.js","sourceRoot":"","sources":["../../src/bin/rosettify.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,IAAI,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;IAC3B,wDAAwD;IACxD,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC;IACnD,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxB,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,IAAI,CAAC,SAAS,CAAC;YACb,EAAE,EAAE,KAAK;YACT,KAAK,EAAE,2CAA2C;YAClD,MAAM,EAAE,IAAI;YACZ,YAAY,EAAE,KAAK;SACpB,CAAC,GAAG,IAAI,CACV,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,MAAM,MAAM,EAAE,CAAC;AACjB,CAAC;KAAM,CAAC;IACN,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ToolDef, HelpTopLevel, HelpCommandDetail, CommandInput } from "../../registry/types.js";
|
|
2
|
+
export interface HelpInput extends CommandInput {
|
|
3
|
+
subcommand?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare const helpToolDef: ToolDef<HelpInput, HelpTopLevel | HelpCommandDetail>;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/help/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAe,YAAY,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAInH,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AA6ED,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,SAAS,EAAE,YAAY,GAAG,iBAAiB,CA2B5E,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { ok } from "../../shared/envelope.js";
|
|
2
|
+
import { logger } from "../../shared/logger.js";
|
|
3
|
+
// Version from package — hardcoded to keep implementation simple
|
|
4
|
+
const VERSION = "0.1.0";
|
|
5
|
+
// Lazy registry to avoid circular imports
|
|
6
|
+
async function getRegistry() {
|
|
7
|
+
const { registry } = await import("../../registry/index.js");
|
|
8
|
+
return registry;
|
|
9
|
+
}
|
|
10
|
+
async function runHelp(input) {
|
|
11
|
+
const { subcommand } = input;
|
|
12
|
+
const registry = await getRegistry();
|
|
13
|
+
// No subcommand (FR-HELP-0001): top-level listing
|
|
14
|
+
if (!subcommand) {
|
|
15
|
+
const commands = [...registry.values()].map((t) => ({
|
|
16
|
+
name: t.name,
|
|
17
|
+
brief: t.brief,
|
|
18
|
+
}));
|
|
19
|
+
const result = {
|
|
20
|
+
tool: "rosettify",
|
|
21
|
+
version: VERSION,
|
|
22
|
+
commands,
|
|
23
|
+
guidance: "use 'help <command>' for details",
|
|
24
|
+
};
|
|
25
|
+
logger.info({}, "help top-level");
|
|
26
|
+
return ok(result);
|
|
27
|
+
}
|
|
28
|
+
// Known subcommand (FR-HELP-0002): return detailed help
|
|
29
|
+
const tool = registry.get(subcommand);
|
|
30
|
+
if (tool) {
|
|
31
|
+
// Check if the command has subcommands (via its help content)
|
|
32
|
+
let subcommands;
|
|
33
|
+
if (subcommand === "plan") {
|
|
34
|
+
try {
|
|
35
|
+
const { planHelpContent } = await import("../plan/help-content.js");
|
|
36
|
+
subcommands = planHelpContent.subcommands.map((s) => ({
|
|
37
|
+
name: s.name,
|
|
38
|
+
brief: s.brief,
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
// ignore
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const result = {
|
|
46
|
+
name: tool.name,
|
|
47
|
+
brief: tool.brief,
|
|
48
|
+
description: tool.description,
|
|
49
|
+
input_schema: tool.inputSchema,
|
|
50
|
+
output_schema: tool.outputSchema,
|
|
51
|
+
...(subcommands ? { subcommands } : {}),
|
|
52
|
+
};
|
|
53
|
+
logger.info({ subcommand }, "help command detail");
|
|
54
|
+
return ok(result);
|
|
55
|
+
}
|
|
56
|
+
// Unknown subcommand: fall back to top-level listing, ok:true, include_help:false
|
|
57
|
+
const commands = [...registry.values()].map((t) => ({
|
|
58
|
+
name: t.name,
|
|
59
|
+
brief: t.brief,
|
|
60
|
+
}));
|
|
61
|
+
const result = {
|
|
62
|
+
tool: "rosettify",
|
|
63
|
+
version: VERSION,
|
|
64
|
+
commands,
|
|
65
|
+
guidance: "use 'help <command>' for details",
|
|
66
|
+
};
|
|
67
|
+
logger.info({ subcommand }, "help unknown subcommand fallback");
|
|
68
|
+
return ok(result);
|
|
69
|
+
}
|
|
70
|
+
export const helpToolDef = {
|
|
71
|
+
name: "help",
|
|
72
|
+
brief: "Show available commands and detailed usage information",
|
|
73
|
+
description: "Returns top-level command listing or detailed help for a specific command.",
|
|
74
|
+
inputSchema: {
|
|
75
|
+
type: "object",
|
|
76
|
+
properties: {
|
|
77
|
+
subcommand: {
|
|
78
|
+
type: "string",
|
|
79
|
+
description: "Command name to get details for",
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
required: [],
|
|
83
|
+
},
|
|
84
|
+
outputSchema: {
|
|
85
|
+
type: "object",
|
|
86
|
+
properties: {
|
|
87
|
+
ok: { type: "boolean" },
|
|
88
|
+
result: {},
|
|
89
|
+
error: { type: "string" },
|
|
90
|
+
include_help: { type: "boolean" },
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
cli: true,
|
|
94
|
+
mcp: true,
|
|
95
|
+
run: runHelp,
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/help/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAMhD,iEAAiE;AACjE,MAAM,OAAO,GAAG,OAAO,CAAC;AA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AAE,QAAQ;gBACd,WAAW,EAAE,iCAAiC;aAC/C;SACF;QACD,QAAQ,EAAE,EAAE;KACb;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;YACvB,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzB,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;SAClC;KACF;IACD,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,IAAI;IACT,GAAG,EAAE,OAAO;CACb,CAAC"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import type { CommandInput } from "../../registry/types.js";
|
|
2
|
+
export declare const VALID_STATUSES: readonly ["open", "in_progress", "complete", "blocked", "failed"];
|
|
3
|
+
export type Status = (typeof VALID_STATUSES)[number];
|
|
4
|
+
export interface Step {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
prompt: string;
|
|
8
|
+
status: Status;
|
|
9
|
+
depends_on: string[];
|
|
10
|
+
subagent?: string;
|
|
11
|
+
role?: string;
|
|
12
|
+
model?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface Phase {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
status: Status;
|
|
19
|
+
depends_on: string[];
|
|
20
|
+
subagent?: string;
|
|
21
|
+
role?: string;
|
|
22
|
+
model?: string;
|
|
23
|
+
steps: Step[];
|
|
24
|
+
}
|
|
25
|
+
export interface Plan {
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
status: Status;
|
|
29
|
+
created_at: string;
|
|
30
|
+
updated_at: string;
|
|
31
|
+
phases: Phase[];
|
|
32
|
+
}
|
|
33
|
+
export interface PlanInput extends CommandInput {
|
|
34
|
+
}
|
|
35
|
+
export interface CreateResult {
|
|
36
|
+
plan_file: string;
|
|
37
|
+
name: string;
|
|
38
|
+
status: Status;
|
|
39
|
+
}
|
|
40
|
+
export interface NextStep {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
prompt: string;
|
|
44
|
+
status: Status;
|
|
45
|
+
depends_on: string[];
|
|
46
|
+
phase_id: string;
|
|
47
|
+
phase_name: string;
|
|
48
|
+
resume?: boolean;
|
|
49
|
+
previously_blocked?: boolean;
|
|
50
|
+
previously_failed?: boolean;
|
|
51
|
+
subagent?: string;
|
|
52
|
+
role?: string;
|
|
53
|
+
model?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface NextResult {
|
|
56
|
+
ready: NextStep[];
|
|
57
|
+
count: number;
|
|
58
|
+
plan_status: Status;
|
|
59
|
+
}
|
|
60
|
+
export interface UpdateStatusResult {
|
|
61
|
+
id: string;
|
|
62
|
+
status: Status;
|
|
63
|
+
plan_status: Status;
|
|
64
|
+
}
|
|
65
|
+
export interface StatusTotals {
|
|
66
|
+
open: number;
|
|
67
|
+
in_progress: number;
|
|
68
|
+
complete: number;
|
|
69
|
+
blocked: number;
|
|
70
|
+
failed: number;
|
|
71
|
+
total: number;
|
|
72
|
+
progress_pct: number;
|
|
73
|
+
}
|
|
74
|
+
export interface PhaseSummaryEntry {
|
|
75
|
+
id: string;
|
|
76
|
+
name: string;
|
|
77
|
+
status: Status;
|
|
78
|
+
steps: Array<{
|
|
79
|
+
id: string;
|
|
80
|
+
name: string;
|
|
81
|
+
status: Status;
|
|
82
|
+
}>;
|
|
83
|
+
}
|
|
84
|
+
export interface ShowStatusPlanResult {
|
|
85
|
+
name: string;
|
|
86
|
+
status: Status;
|
|
87
|
+
phases: StatusTotals;
|
|
88
|
+
steps: StatusTotals;
|
|
89
|
+
phase_summary: PhaseSummaryEntry[];
|
|
90
|
+
}
|
|
91
|
+
export interface ShowStatusPhaseResult {
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
status: Status;
|
|
95
|
+
steps: Array<{
|
|
96
|
+
id: string;
|
|
97
|
+
name: string;
|
|
98
|
+
status: Status;
|
|
99
|
+
}>;
|
|
100
|
+
}
|
|
101
|
+
export interface ShowStatusStepResult {
|
|
102
|
+
id: string;
|
|
103
|
+
name: string;
|
|
104
|
+
status: Status;
|
|
105
|
+
depends_on: string[];
|
|
106
|
+
subagent?: string;
|
|
107
|
+
role?: string;
|
|
108
|
+
model?: string;
|
|
109
|
+
}
|
|
110
|
+
export interface UpsertResult {
|
|
111
|
+
id: string;
|
|
112
|
+
plan_status: Status;
|
|
113
|
+
message?: string;
|
|
114
|
+
}
|
|
115
|
+
export declare function mergePatch(target: Record<string, unknown>, patch: Record<string, unknown>): Record<string, unknown>;
|
|
116
|
+
export type MergeByIdResult<T> = T[] | {
|
|
117
|
+
error: string;
|
|
118
|
+
};
|
|
119
|
+
export declare function mergeById<T extends Record<string, unknown>>(existing: T[], incoming: T[]): MergeByIdResult<T>;
|
|
120
|
+
export declare function computeStatusFromChildren(statuses: Status[]): Status;
|
|
121
|
+
export declare function propagateStatuses(plan: Plan): void;
|
|
122
|
+
export declare function findPhase(plan: Plan, id: string): Phase | undefined;
|
|
123
|
+
export declare function findStep(plan: Plan, id: string): {
|
|
124
|
+
phase: Phase;
|
|
125
|
+
step: Step;
|
|
126
|
+
} | undefined;
|
|
127
|
+
export declare function buildStepStatusMap(plan: Plan): Map<string, Status>;
|
|
128
|
+
export declare function buildPhaseStatusMap(plan: Plan): Map<string, Status>;
|
|
129
|
+
export declare function depsSatisfied(item: {
|
|
130
|
+
depends_on: string[];
|
|
131
|
+
}, statusMap: Map<string, Status>): boolean;
|
|
132
|
+
export declare function validatePlanName(name: string): string | null;
|
|
133
|
+
export declare function validateNonNegativeLimit(limit: number): string | null;
|
|
134
|
+
export declare function validateImmutableId(patchId: string | undefined, targetId: string): string | null;
|
|
135
|
+
export declare function validateUniqueIds(plan: Plan): string | null;
|
|
136
|
+
export declare function detectCycle(graph: Map<string, string[]>): string | null;
|
|
137
|
+
export declare function validateDependencies(plan: Plan): string | null;
|
|
138
|
+
export declare function validateSizeLimits(plan: Plan): string | null;
|
|
139
|
+
export declare function loadPlan(file: string): Plan | null;
|
|
140
|
+
export declare function savePlan(file: string, plan: Plan): void;
|
|
141
|
+
//# sourceMappingURL=core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../src/commands/plan/core.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAa5D,eAAO,MAAM,cAAc,mEAMjB,CAAC;AAEX,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAMrD,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,IAAI,EAAE,CAAC;CACf;AAED,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;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