@adecore/plan 0.17.0-beta.1 → 0.17.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +38 -23
- package/package.json +1 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,35 +1,50 @@
|
|
|
1
1
|
# @adecore/plan
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@adecore/plan)
|
|
4
|
+
[](https://adecore.dev/plan/)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
A plan that a person and an agent work through together: steps, sub-steps, sections and notes, with rules for who may check what. Every change is a batch of operations that applies as a whole or is refused with a code and a reason. Plans read and write as a Markdown task list. No storage, no clock and no UI: the app brings those.
|
|
7
|
+
|
|
8
|
+
**[Documentation with live demos](https://adecore.dev/plan/)**
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
bun add @adecore/plan
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Use
|
|
6
17
|
|
|
7
18
|
```ts
|
|
8
19
|
import { applyPlanOps, createPlan, parsePlanMarkdown } from '@adecore/plan';
|
|
9
20
|
|
|
10
|
-
const parsed = parsePlanMarkdown('#
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
19
|
-
if (!created.ok) {
|
|
20
|
-
throw new Error(created.message);
|
|
21
|
-
}
|
|
22
|
-
const checked = applyPlanOps(created.plan, [{ op: 'set', ids: ['review'], state: 'done' }], {
|
|
23
|
-
actor: 'person',
|
|
24
|
-
now: '2026-01-01T00:01:00.000Z'
|
|
25
|
-
});
|
|
26
|
-
if (!checked.ok) {
|
|
27
|
-
throw new Error(checked.message);
|
|
21
|
+
const parsed = parsePlanMarkdown('# Ship the release\n\n- [ ] Run the tests\n');
|
|
22
|
+
const created = parsed.ok ? createPlan(parsed.draft, { id: 'release', now: new Date().toISOString() }) : parsed;
|
|
23
|
+
|
|
24
|
+
if (created.ok) {
|
|
25
|
+
const [step] = created.minted;
|
|
26
|
+
const result = applyPlanOps(created.plan, [{ op: 'set', ids: [step!], state: 'done' }], {
|
|
27
|
+
actor: 'person',
|
|
28
|
+
now: new Date().toISOString()
|
|
29
|
+
});
|
|
28
30
|
}
|
|
29
31
|
```
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
## Entry points
|
|
34
|
+
|
|
35
|
+
| Import | What it holds |
|
|
36
|
+
|---|---|
|
|
37
|
+
| `@adecore/plan` | Creating, validating and changing plans, permissions, progress, Markdown and text |
|
|
38
|
+
| `@adecore/plan/protocol` | The Zod schemas and types of a plan and its operations |
|
|
39
|
+
|
|
40
|
+
## Documentation
|
|
41
|
+
|
|
42
|
+
| Page | What it covers |
|
|
43
|
+
|---|---|
|
|
44
|
+
| [Plans](https://adecore.dev/plan/plans) | The tree, states, progress and creating a plan |
|
|
45
|
+
| [Operations](https://adecore.dev/plan/operations) | `applyPlanOps`, permissions, refusals and a store |
|
|
46
|
+
| [Markdown and text](https://adecore.dev/plan/markdown) | The Markdown format and the text an agent reads |
|
|
32
47
|
|
|
33
|
-
|
|
48
|
+
## License
|
|
34
49
|
|
|
35
|
-
|
|
50
|
+
FSL-1.1-MIT, see [LICENSE](./LICENSE).
|