@operad-io/dev 0.1.0 → 0.2.0
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/README.md +1 -1
- package/dev.schema.json +41 -28
- package/package.json +9 -6
- package/skills/setup/SKILL.md +57 -0
- package/src/access-grants.ts +59 -0
- package/src/actions.ts +78 -17
- package/src/announce.ts +128 -16
- package/src/chat.ts +512 -36
- package/src/check-host.ts +111 -0
- package/src/check-load.ts +67 -0
- package/src/check.ts +17 -12
- package/src/clock.ts +29 -0
- package/src/commands.ts +103 -34
- package/src/create-actions.ts +210 -0
- package/src/flaky.ts +45 -29
- package/src/flow-compiler.ts +155 -68
- package/src/followups.ts +20 -22
- package/src/gate.ts +192 -73
- package/src/git.ts +47 -0
- package/src/index.ts +46 -6
- package/src/integrate.ts +121 -43
- package/src/integration-queue.ts +176 -25
- package/src/lock.ts +101 -5
- package/src/mainclone.ts +44 -5
- package/src/model-error.ts +70 -0
- package/src/model.ts +50 -35
- package/src/notcode.ts +51 -15
- package/src/places.ts +2 -2
- package/src/prepare.ts +7 -2
- package/src/project-flows.ts +135 -4
- package/src/project-settings.ts +81 -0
- package/src/register-requests.ts +87 -0
- package/src/repository-key.ts +4 -0
- package/src/rerun.ts +23 -7
- package/src/retry.ts +2 -12
- package/src/rework.ts +8 -0
- package/src/schedule.ts +317 -86
- package/src/service.ts +177 -148
- package/src/settings.ts +305 -60
- package/src/standing.ts +23 -6
- package/src/step-edge.ts +22 -0
- package/src/steps.ts +469 -123
- package/src/throughput.ts +4 -21
- package/src/timeouts.ts +10 -2
- package/src/views.ts +147 -81
- package/src/waits.ts +59 -0
package/src/standing.ts
CHANGED
|
@@ -6,9 +6,11 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import type { StandingContext, StandingItem } from "@operad-io/engine";
|
|
9
|
-
import {
|
|
9
|
+
import { idOfKey, listAll, planData, storeKey, taskData } from "./model.ts";
|
|
10
10
|
import { listRepositories } from "./service.ts";
|
|
11
|
-
import {
|
|
11
|
+
import { registerStanding } from "./register-requests.ts";
|
|
12
|
+
import { hasValidSettings, readDevSettings, settingsProblem } from "./settings.ts";
|
|
13
|
+
import { checkHostWarning } from "./check-host.ts";
|
|
12
14
|
|
|
13
15
|
/** A plugin dev starts steps of, so it cannot start work without it. */
|
|
14
16
|
export interface RequiredPlugin {
|
|
@@ -38,7 +40,21 @@ export async function devStanding(ctx: StandingContext): Promise<readonly Standi
|
|
|
38
40
|
const items: StandingItem[] = [];
|
|
39
41
|
for (const repository of await listRepositories(ctx.store)) {
|
|
40
42
|
const problem = settingsProblem(repository.path);
|
|
41
|
-
if (problem === undefined)
|
|
43
|
+
if (problem === undefined) {
|
|
44
|
+
try {
|
|
45
|
+
const warning = checkHostWarning(
|
|
46
|
+
repository.name,
|
|
47
|
+
await readDevSettings(repository.path),
|
|
48
|
+
ctx.settings,
|
|
49
|
+
);
|
|
50
|
+
if (warning !== undefined) {
|
|
51
|
+
items.push({ id: `check-host:${repository.name}`, prompt: warning });
|
|
52
|
+
}
|
|
53
|
+
} catch {
|
|
54
|
+
// A settings file that cannot be read has its own item below.
|
|
55
|
+
}
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
42
58
|
items.push({
|
|
43
59
|
id: `settings:${repository.name}`,
|
|
44
60
|
prompt: hasValidSettings(repository.path)
|
|
@@ -58,7 +74,7 @@ export async function devStanding(ctx: StandingContext): Promise<readonly Standi
|
|
|
58
74
|
const plan = await ctx.store.get("plan", planKey);
|
|
59
75
|
if (plan !== undefined && planData(plan.data).status === "draft") {
|
|
60
76
|
const draft = drafts.get(planKey) ?? { titles: [], tasks: [], byDev: false };
|
|
61
|
-
draft.titles.push(`${
|
|
77
|
+
draft.titles.push(`${idOfKey(object.id)}`);
|
|
62
78
|
draft.tasks.push({ type: "task", id: object.id });
|
|
63
79
|
draft.byDev = draft.byDev || task.openedBy === "dev";
|
|
64
80
|
drafts.set(planKey, draft);
|
|
@@ -67,7 +83,7 @@ export async function devStanding(ctx: StandingContext): Promise<readonly Standi
|
|
|
67
83
|
const by = task.openedBy === "dev" ? "dev" : "a person";
|
|
68
84
|
items.push({
|
|
69
85
|
id: `task:${object.id}`,
|
|
70
|
-
prompt: `task ${
|
|
86
|
+
prompt: `task ${idOfKey(object.id)} is proposed by ${by} and waits for you: ${task.title}`,
|
|
71
87
|
object: { type: "task", id: object.id },
|
|
72
88
|
// A person who added the task knows of it; the lead is told of dev's own.
|
|
73
89
|
announce: task.openedBy === "dev",
|
|
@@ -76,12 +92,13 @@ export async function devStanding(ctx: StandingContext): Promise<readonly Standi
|
|
|
76
92
|
for (const [planKey, draft] of drafts) {
|
|
77
93
|
items.push({
|
|
78
94
|
id: `plan:${planKey}`,
|
|
79
|
-
prompt: `plan ${
|
|
95
|
+
prompt: `plan ${idOfKey(planKey)} is a draft whose tasks wait for you: ${draft.titles.join(", ")}; confirm the plan to start them`,
|
|
80
96
|
object: { type: "plan", id: planKey },
|
|
81
97
|
covers: draft.tasks,
|
|
82
98
|
announce: draft.byDev,
|
|
83
99
|
});
|
|
84
100
|
}
|
|
85
101
|
for (const plugin of missingPlugins(ctx.loaded)) items.push(pluginItem(plugin));
|
|
102
|
+
items.push(...registerStanding(ctx.home));
|
|
86
103
|
return items;
|
|
87
104
|
}
|
package/src/step-edge.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { isRecord } from "@operad-io/engine";
|
|
2
|
+
|
|
3
|
+
/** The edge a task took into a step that handles a stop, as the flow names it. */
|
|
4
|
+
export interface EdgeParams {
|
|
5
|
+
readonly from: string;
|
|
6
|
+
readonly result: string;
|
|
7
|
+
/** The choices the wait that follows offers; present when this step asks for it. */
|
|
8
|
+
readonly choices?: readonly string[] | undefined;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Reads an edge's params, defaulting a missing or malformed value to empty. */
|
|
12
|
+
export function edgeParamsOf(params: unknown): EdgeParams {
|
|
13
|
+
const record = isRecord(params) ? params : {};
|
|
14
|
+
const from = typeof record.from === "string" ? record.from : "";
|
|
15
|
+
const result = typeof record.result === "string" ? record.result : "";
|
|
16
|
+
const choices =
|
|
17
|
+
Array.isArray(record.choices) &&
|
|
18
|
+
record.choices.every((choice): choice is string => typeof choice === "string")
|
|
19
|
+
? record.choices
|
|
20
|
+
: undefined;
|
|
21
|
+
return { from, result, ...(choices === undefined ? {} : { choices }) };
|
|
22
|
+
}
|