@danypops/papyrus 0.55.0 → 0.57.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/package.json +14 -1
- package/src/artifact/artifact-relationship-view.ts +1 -1
- package/src/artifact/artifact-scope-store.ts +32 -26
- package/src/artifact/in-memory-artifact-scope-store.ts +82 -43
- package/src/artifact/index.ts +3 -0
- package/src/artifact/sqlite-artifact-scope-store.ts +105 -56
- package/src/cli/docs-command.ts +71 -0
- package/src/cli/gates-command.ts +1 -1
- package/src/cli/note-command.ts +1 -1
- package/src/cli/playbooks-command.ts +71 -0
- package/src/cli/rules-command.ts +71 -0
- package/src/cli/scope-groups-command.ts +197 -0
- package/src/cli/task-command.ts +1 -1
- package/src/cli.ts +7 -0
- package/src/constants.ts +10 -2
- package/src/db.ts +117 -7
- package/src/{stores → discussion}/discussion-round-store.ts +1 -1
- package/src/discussion/discussion-service.ts +2 -2
- package/src/discussion/index.ts +1 -0
- package/src/{stores → discussion}/sqlite-discussion-round-store.ts +2 -2
- package/src/display-graph/graph-renderer.ts +5 -0
- package/src/docs/docs-service.ts +55 -20
- package/src/domain-service-shared.ts +90 -2
- package/src/{domain → gate}/gate-execution.ts +1 -1
- package/src/{stores → gate}/gate-runner.ts +1 -1
- package/src/{stores → gate}/sqlite-gate-runner.ts +3 -3
- package/src/graph-projection/graph-projection-service.ts +2 -2
- package/src/{stores → graph-projection}/graph-projection-store.ts +1 -1
- package/src/{stores → graph-projection}/sqlite-graph-projection-store.ts +2 -2
- package/src/handlers/discuss.ts +1 -1
- package/src/handlers/docs.ts +57 -2
- package/src/handlers/playbooks.ts +49 -8
- package/src/handlers/projects.ts +1 -1
- package/src/handlers/registry.ts +10 -5
- package/src/handlers/rules.ts +66 -2
- package/src/handlers/scope-groups.ts +100 -0
- package/src/handlers/task-classifiers.ts +1 -1
- package/src/handlers/tasks.ts +4 -4
- package/src/index.ts +9 -9
- package/src/log/log-service.ts +2 -2
- package/src/{stores → log}/log-store.ts +1 -1
- package/src/{stores → log}/sqlite-log-store.ts +2 -2
- package/src/modules/docs.ts +21 -1
- package/src/modules/graph-projection.ts +2 -2
- package/src/modules/logs.ts +1 -1
- package/src/modules/notes.ts +1 -1
- package/src/modules/playbooks.ts +24 -3
- package/src/modules/projects.ts +3 -3
- package/src/modules/rules.ts +21 -1
- package/src/modules/scope-groups.ts +92 -0
- package/src/modules/tasks.ts +3 -3
- package/src/note/index.ts +1 -0
- package/src/{stores → note}/note-event-store.ts +1 -1
- package/src/note/note-service.ts +2 -2
- package/src/{stores → note}/sqlite-note-event-store.ts +2 -2
- package/src/ops.ts +1 -1
- package/src/playbook/index.ts +2 -0
- package/src/playbook/playbook-definition.ts +2 -2
- package/src/playbook/playbook-execution.ts +1 -1
- package/src/playbook/playbook-service.ts +61 -26
- package/src/playbook/workflow-execution.ts +8 -8
- package/src/{stores → project-registry}/in-memory-project-registry-store.ts +2 -2
- package/src/{ports → project-registry}/project-registry-store.ts +1 -1
- package/src/{stores → project-registry}/sqlite-project-registry-store.ts +3 -3
- package/src/rules/rules-service.ts +56 -24
- package/src/scope-group/delete-scope-group.ts +17 -0
- package/src/scope-group/in-memory-scope-group-store.ts +173 -0
- package/src/scope-group/scope-group-store.ts +28 -0
- package/src/scope-group/scope-group.ts +79 -0
- package/src/scope-group/sqlite-scope-group-store.ts +223 -0
- package/src/service.ts +46 -21
- package/src/session-identity/session-identity-service.ts +2 -2
- package/src/{stores → session-identity}/sqlite-session-identity-store.ts +1 -1
- package/src/task/index.ts +13 -0
- package/src/task/task-context.ts +1 -1
- package/src/task/task-edges.ts +2 -2
- package/src/task/task-focus-coordinator.ts +3 -3
- package/src/task/task-graph-view.ts +1 -1
- package/src/task/task-lease-coordinator.ts +2 -2
- package/src/task/task-mutation-coordinator.ts +1 -1
- package/src/task/task-project-scope.ts +5 -5
- package/src/task/task-relationship-view.ts +1 -1
- package/src/task/task-service.ts +24 -24
- package/src/{stores → task-create-request}/sqlite-task-create-request-store.ts +1 -1
- package/src/{stores → task-event}/sqlite-task-event-store.ts +2 -2
- package/src/{stores → task-event}/task-event-store.ts +1 -1
- package/src/{stores → task-focus}/sqlite-task-focus-store.ts +1 -1
- package/src/{stores → task-lease}/sqlite-task-lease-store.ts +2 -2
- package/src/{stores → task-lease}/task-lease-store.ts +1 -1
- package/src/{stores → task-mutation-request}/sqlite-task-mutation-request-store.ts +5 -1
- package/src/{stores → task-scope}/sqlite-task-scope-store.ts +3 -3
- package/src/{stores → task-scope}/task-scope-store.ts +3 -3
- package/src/{domain → task-scope}/task-scope.ts +1 -1
- package/src/stores/graph-renderer.ts +0 -5
- /package/src/{domain → discussion}/discussion.ts +0 -0
- /package/src/{domain → display-graph}/display-graph.ts +0 -0
- /package/src/{domain → gate}/gate.ts +0 -0
- /package/src/{domain → graph-projection}/graph-projection.ts +0 -0
- /package/src/{domain → log}/log-entry.ts +0 -0
- /package/src/{domain → note}/note-event.ts +0 -0
- /package/src/{domain → playbook}/blueprint-definition.ts +0 -0
- /package/src/{domain → project-registry}/project-registry.ts +0 -0
- /package/src/{stores → session-identity}/session-identity-store.ts +0 -0
- /package/src/{domain → session-identity}/session-identity.ts +0 -0
- /package/src/{domain → task}/checklist.ts +0 -0
- /package/src/{stores → task-create-request}/task-create-request-store.ts +0 -0
- /package/src/{domain → task-event}/task-event.ts +0 -0
- /package/src/{stores → task-focus}/task-focus-store.ts +0 -0
- /package/src/{domain → task-lease}/task-lease.ts +0 -0
- /package/src/{stores → task-mutation-request}/task-mutation-request-store.ts +0 -0
|
@@ -24,11 +24,12 @@ import type { ArtifactStore } from "../artifact/artifact-store.ts";
|
|
|
24
24
|
import { playbooksOperations } from "../modules/playbooks.ts";
|
|
25
25
|
import type { PlaybookInvocationResult, PlaybookMissingArguments } from "../playbook/playbook-execution.ts";
|
|
26
26
|
import { listPlaybooks } from "../playbook/playbook-service.ts";
|
|
27
|
-
import type { ProjectRegistryStore } from "../
|
|
27
|
+
import type { ProjectRegistryStore } from "../project-registry/project-registry-store.ts";
|
|
28
|
+
import type { ScopeGroupStore } from "../scope-group/scope-group-store.ts";
|
|
28
29
|
import type { SessionIdentity } from "../session-identity/session-identity-service.ts";
|
|
29
|
-
import type { TaskEventStore } from "../stores/task-event-store.ts";
|
|
30
|
-
import type { TaskScopeStore } from "../stores/task-scope-store.ts";
|
|
31
30
|
import type { Tasks } from "../task/task-service.ts";
|
|
31
|
+
import type { TaskEventStore } from "../task-event/task-event-store.ts";
|
|
32
|
+
import type { TaskScopeStore } from "../task-scope/task-scope-store.ts";
|
|
32
33
|
import {
|
|
33
34
|
booleanProp,
|
|
34
35
|
buildWorkflowRunContent,
|
|
@@ -58,6 +59,7 @@ export interface PlaybooksVehicleDeps {
|
|
|
58
59
|
tasks: Tasks;
|
|
59
60
|
sessionIdentity: SessionIdentity;
|
|
60
61
|
projectRegistry: ProjectRegistryStore;
|
|
62
|
+
scopeGroups: ScopeGroupStore;
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
/** Unscoped resolution -- a Playbook is commonly cross-project (e.g. a lab-deploy playbook), matching the hand-rolled tool's own resolutionRequest choice. */
|
|
@@ -68,12 +70,11 @@ function resolvePlaybookId(artifacts: ArtifactStore, scopes: ArtifactScopeStore,
|
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
export function registerPlaybooksVehicleOperations(registry: VehicleRegistry, deps: PlaybooksVehicleDeps): void {
|
|
71
|
-
const { artifacts, events, scopes, artifactScopes, tasks, sessionIdentity, projectRegistry } = deps;
|
|
73
|
+
const { artifacts, events, scopes, artifactScopes, tasks, sessionIdentity, projectRegistry, scopeGroups } = deps;
|
|
72
74
|
const moduleOperations = new Map(
|
|
73
|
-
playbooksOperations({ artifacts, events, scopes, artifactScopes, tasks, sessionIdentity, registry: projectRegistry }).map(
|
|
74
|
-
op.name,
|
|
75
|
-
|
|
76
|
-
]),
|
|
75
|
+
playbooksOperations({ artifacts, events, scopes, artifactScopes, tasks, sessionIdentity, registry: projectRegistry, scopeGroups }).map(
|
|
76
|
+
(op) => [op.name, op],
|
|
77
|
+
),
|
|
77
78
|
);
|
|
78
79
|
/**
|
|
79
80
|
* Every playbooks.* action funnels through here. invoke's own module handler re-runs
|
|
@@ -263,6 +264,46 @@ export function registerPlaybooksVehicleOperations(registry: VehicleRegistry, de
|
|
|
263
264
|
(input) => ({ ...input, id: resolvePlaybookId(artifacts, artifactScopes, input.id, input.name) }),
|
|
264
265
|
);
|
|
265
266
|
|
|
267
|
+
define(
|
|
268
|
+
"set_none",
|
|
269
|
+
"Fully hides a Playbook -- never applicable, never injected via before_agent_start, regardless of project. The only way back is set_global, add_project, add_group, or replace_projects/replace_groups.",
|
|
270
|
+
"local-write",
|
|
271
|
+
{ id: stringProp, name: stringProp },
|
|
272
|
+
[],
|
|
273
|
+
(input) => ({ ...input, id: resolvePlaybookId(artifacts, artifactScopes, input.id, input.name) }),
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
define(
|
|
277
|
+
"add_group",
|
|
278
|
+
"Adds one scope group (a named, reusable, possibly-nested collection of projects and/or other groups) to a Playbook's explicit scope, switching it from global/none to project-bound if it wasn't already. Idempotent if the group is already a member.",
|
|
279
|
+
"local-write",
|
|
280
|
+
{ id: stringProp, name: stringProp, group: { ...stringProp, description: "Exact scope group id, name, or alias to add." } },
|
|
281
|
+
["group"],
|
|
282
|
+
(input) => ({ ...input, id: resolvePlaybookId(artifacts, artifactScopes, input.id, input.name) }),
|
|
283
|
+
);
|
|
284
|
+
|
|
285
|
+
define(
|
|
286
|
+
"remove_group",
|
|
287
|
+
"Removes one scope group from a Playbook's explicit scope. Rejected while it is the Playbook's only remaining scope member -- call set_global or set_none first.",
|
|
288
|
+
"local-write",
|
|
289
|
+
{ id: stringProp, name: stringProp, group: { ...stringProp, description: "Exact scope group id, name, or alias to remove." } },
|
|
290
|
+
["group"],
|
|
291
|
+
(input) => ({ ...input, id: resolvePlaybookId(artifacts, artifactScopes, input.id, input.name) }),
|
|
292
|
+
);
|
|
293
|
+
|
|
294
|
+
define(
|
|
295
|
+
"replace_groups",
|
|
296
|
+
"Replaces a Playbook's entire scope-group membership with exactly this bounded, non-empty list of scope group references (id/name/alias). Use set_global/set_none instead to clear scoping entirely.",
|
|
297
|
+
"local-write",
|
|
298
|
+
{
|
|
299
|
+
id: stringProp,
|
|
300
|
+
name: stringProp,
|
|
301
|
+
groups: { type: "array", description: "Non-empty list of exact scope group id/name/alias references." },
|
|
302
|
+
},
|
|
303
|
+
["groups"],
|
|
304
|
+
(input) => ({ ...input, id: resolvePlaybookId(artifacts, artifactScopes, input.id, input.name) }),
|
|
305
|
+
);
|
|
306
|
+
|
|
266
307
|
define(
|
|
267
308
|
"update",
|
|
268
309
|
"Changes a Playbook's title/body/labels/trigger/steps (at least one required). `steps` accepts the exact same shape playbooks.create does and REPLACES the entire step list -- the way to fix a mistake or generalize a Playbook's steps after creation instead of the create-new+supersedes+disable workaround. Refused for a read-only external projection.",
|
package/src/handlers/projects.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { VehicleRegistry } from "@danypops/vehicle-server";
|
|
8
8
|
import { projectsOperations } from "../modules/projects.ts";
|
|
9
|
-
import type { ProjectRegistryStore } from "../
|
|
9
|
+
import type { ProjectRegistryStore } from "../project-registry/project-registry-store.ts";
|
|
10
10
|
import { createOperationDefiner, numberProp, stringProp } from "./shared.ts";
|
|
11
11
|
|
|
12
12
|
const OWNER = "projects";
|
package/src/handlers/registry.ts
CHANGED
|
@@ -13,11 +13,12 @@ import type { AuthorityRegistry } from "../authority-registry.ts";
|
|
|
13
13
|
import { PAPYRUS_VEHICLE_NAME } from "../constants.ts";
|
|
14
14
|
import type { Discussions } from "../discussion/discussion-service.ts";
|
|
15
15
|
import type { Notes } from "../note/note-service.ts";
|
|
16
|
-
import type { ProjectRegistryStore } from "../
|
|
16
|
+
import type { ProjectRegistryStore } from "../project-registry/project-registry-store.ts";
|
|
17
|
+
import type { ScopeGroupStore } from "../scope-group/scope-group-store.ts";
|
|
17
18
|
import type { SessionIdentity } from "../session-identity/session-identity-service.ts";
|
|
18
|
-
import type { TaskEventStore } from "../stores/task-event-store.ts";
|
|
19
|
-
import type { TaskScopeStore } from "../stores/task-scope-store.ts";
|
|
20
19
|
import type { Tasks } from "../task/task-service.ts";
|
|
20
|
+
import type { TaskEventStore } from "../task-event/task-event-store.ts";
|
|
21
|
+
import type { TaskScopeStore } from "../task-scope/task-scope-store.ts";
|
|
21
22
|
import { registerArtifactTrashOperations } from "./artifact-trash.ts";
|
|
22
23
|
import { registerDiscussVehicleOperations } from "./discuss.ts";
|
|
23
24
|
import { registerDocsVehicleOperations } from "./docs.ts";
|
|
@@ -25,6 +26,7 @@ import { registerNotesVehicleOperations } from "./notes.ts";
|
|
|
25
26
|
import { registerPlaybooksVehicleOperations } from "./playbooks.ts";
|
|
26
27
|
import { registerProjectsVehicleOperations } from "./projects.ts";
|
|
27
28
|
import { registerRulesVehicleOperations } from "./rules.ts";
|
|
29
|
+
import { registerScopeGroupsVehicleOperations } from "./scope-groups.ts";
|
|
28
30
|
import { registerTasksVehicleOperations } from "./tasks.ts";
|
|
29
31
|
|
|
30
32
|
export interface PapyrusVehicleDeps {
|
|
@@ -38,6 +40,7 @@ export interface PapyrusVehicleDeps {
|
|
|
38
40
|
discussions: Discussions;
|
|
39
41
|
sessionIdentity: SessionIdentity;
|
|
40
42
|
projectRegistry: ProjectRegistryStore;
|
|
43
|
+
scopeGroups: ScopeGroupStore;
|
|
41
44
|
}
|
|
42
45
|
|
|
43
46
|
export function createPapyrusVehicleRegistry(deps: PapyrusVehicleDeps): VehicleRegistry {
|
|
@@ -52,8 +55,8 @@ export function createPapyrusVehicleRegistry(deps: PapyrusVehicleDeps): VehicleR
|
|
|
52
55
|
// session_id, a correlation id, not a secret -- see session-identity-service.ts).
|
|
53
56
|
registry.setExposeHandlerFailureDetails(true);
|
|
54
57
|
registerNotesVehicleOperations(registry, deps.notes, deps.artifacts);
|
|
55
|
-
registerRulesVehicleOperations(registry, deps.artifacts, deps.scopes, deps.projectRegistry);
|
|
56
|
-
registerDocsVehicleOperations(registry, deps.artifacts, deps.scopes, deps.authority, deps.projectRegistry);
|
|
58
|
+
registerRulesVehicleOperations(registry, deps.artifacts, deps.scopes, deps.projectRegistry, deps.scopeGroups);
|
|
59
|
+
registerDocsVehicleOperations(registry, deps.artifacts, deps.scopes, deps.authority, deps.projectRegistry, deps.scopeGroups);
|
|
57
60
|
registerPlaybooksVehicleOperations(registry, {
|
|
58
61
|
artifacts: deps.artifacts,
|
|
59
62
|
events: deps.events,
|
|
@@ -62,9 +65,11 @@ export function createPapyrusVehicleRegistry(deps: PapyrusVehicleDeps): VehicleR
|
|
|
62
65
|
tasks: deps.tasks,
|
|
63
66
|
sessionIdentity: deps.sessionIdentity,
|
|
64
67
|
projectRegistry: deps.projectRegistry,
|
|
68
|
+
scopeGroups: deps.scopeGroups,
|
|
65
69
|
});
|
|
66
70
|
registerTasksVehicleOperations(registry, { tasks: deps.tasks, artifacts: deps.artifacts, sessionIdentity: deps.sessionIdentity });
|
|
67
71
|
registerProjectsVehicleOperations(registry, deps.projectRegistry);
|
|
72
|
+
registerScopeGroupsVehicleOperations(registry, deps.scopeGroups, deps.projectRegistry, deps.scopes);
|
|
68
73
|
registerDiscussVehicleOperations(registry, deps.discussions, deps.artifacts);
|
|
69
74
|
registerArtifactTrashOperations(registry, deps.artifacts);
|
|
70
75
|
return registry;
|
package/src/handlers/rules.ts
CHANGED
|
@@ -8,8 +8,9 @@ import type { VehicleRegistry } from "@danypops/vehicle-server";
|
|
|
8
8
|
import type { ArtifactScopeStore } from "../artifact/artifact-scope-store.ts";
|
|
9
9
|
import type { ArtifactStore } from "../artifact/artifact-store.ts";
|
|
10
10
|
import { rulesOperations } from "../modules/rules.ts";
|
|
11
|
-
import type { ProjectRegistryStore } from "../
|
|
11
|
+
import type { ProjectRegistryStore } from "../project-registry/project-registry-store.ts";
|
|
12
12
|
import { listRules } from "../rules/rules-service.ts";
|
|
13
|
+
import type { ScopeGroupStore } from "../scope-group/scope-group-store.ts";
|
|
13
14
|
import { booleanProp, createOperationDefiner, numberProp, resolveArtifactIdWidened, stringProp, validationError } from "./shared.ts";
|
|
14
15
|
|
|
15
16
|
const OWNER = "rules";
|
|
@@ -57,8 +58,9 @@ export function registerRulesVehicleOperations(
|
|
|
57
58
|
artifacts: ArtifactStore,
|
|
58
59
|
scopes: ArtifactScopeStore,
|
|
59
60
|
projectRegistry: ProjectRegistryStore,
|
|
61
|
+
scopeGroups: ScopeGroupStore,
|
|
60
62
|
): void {
|
|
61
|
-
const moduleOperations = new Map(rulesOperations(artifacts, scopes, projectRegistry).map((op) => [op.name, op]));
|
|
63
|
+
const moduleOperations = new Map(rulesOperations(artifacts, scopes, projectRegistry, scopeGroups).map((op) => [op.name, op]));
|
|
62
64
|
const call = (name: string, input: Record<string, unknown>): unknown => moduleOperations.get(name)!.execute(input);
|
|
63
65
|
const define = createOperationDefiner(registry, OWNER, "rules", ["rules:read", "rules:write"], call);
|
|
64
66
|
|
|
@@ -240,6 +242,68 @@ export function registerRulesVehicleOperations(
|
|
|
240
242
|
(input) => ({ ...input, id: resolveRuleId(artifacts, scopes, input.project_root as string | undefined, input.id, input.name) }),
|
|
241
243
|
);
|
|
242
244
|
|
|
245
|
+
define(
|
|
246
|
+
"set_none",
|
|
247
|
+
"Fully hides a Rule -- never applicable, never injected into the agent system prompt, regardless of project. The only way back is set_global, add_project, add_group, or replace_projects/replace_groups.",
|
|
248
|
+
"local-write",
|
|
249
|
+
{ id: stringProp, name: stringProp, project_root: stringProp, actor: stringProp, source: stringProp, session_id: stringProp },
|
|
250
|
+
[],
|
|
251
|
+
(input) => ({ ...input, id: resolveRuleId(artifacts, scopes, input.project_root as string | undefined, input.id, input.name) }),
|
|
252
|
+
);
|
|
253
|
+
|
|
254
|
+
define(
|
|
255
|
+
"add_group",
|
|
256
|
+
"Adds one scope group (a named, reusable, possibly-nested collection of projects and/or other groups) to a Rule's explicit scope, switching it from global/none to project-bound if it wasn't already. Idempotent if the group is already a member.",
|
|
257
|
+
"local-write",
|
|
258
|
+
{
|
|
259
|
+
id: stringProp,
|
|
260
|
+
name: stringProp,
|
|
261
|
+
group: { ...stringProp, description: "Exact scope group id, name, or alias to add." },
|
|
262
|
+
project_root: stringProp,
|
|
263
|
+
actor: stringProp,
|
|
264
|
+
source: stringProp,
|
|
265
|
+
session_id: stringProp,
|
|
266
|
+
},
|
|
267
|
+
["group"],
|
|
268
|
+
(input) => ({ ...input, id: resolveRuleId(artifacts, scopes, input.project_root as string | undefined, input.id, input.name) }),
|
|
269
|
+
);
|
|
270
|
+
|
|
271
|
+
define(
|
|
272
|
+
"remove_group",
|
|
273
|
+
"Removes one scope group from a Rule's explicit scope. Rejected while it is the Rule's only remaining scope member -- call set_global or set_none first.",
|
|
274
|
+
"local-write",
|
|
275
|
+
{
|
|
276
|
+
id: stringProp,
|
|
277
|
+
name: stringProp,
|
|
278
|
+
group: { ...stringProp, description: "Exact scope group id, name, or alias to remove." },
|
|
279
|
+
project_root: stringProp,
|
|
280
|
+
actor: stringProp,
|
|
281
|
+
source: stringProp,
|
|
282
|
+
session_id: stringProp,
|
|
283
|
+
},
|
|
284
|
+
["group"],
|
|
285
|
+
(input) => ({ ...input, id: resolveRuleId(artifacts, scopes, input.project_root as string | undefined, input.id, input.name) }),
|
|
286
|
+
);
|
|
287
|
+
|
|
288
|
+
define(
|
|
289
|
+
"replace_groups",
|
|
290
|
+
"Replaces a Rule's entire scope-group membership with exactly this bounded, non-empty list of scope group references (id/name/alias). Use set_global/set_none instead to clear scoping entirely.",
|
|
291
|
+
"local-write",
|
|
292
|
+
{
|
|
293
|
+
id: stringProp,
|
|
294
|
+
name: stringProp,
|
|
295
|
+
groups: { type: "array", description: "Non-empty list of exact scope group id/name/alias references." } as unknown as {
|
|
296
|
+
type: string;
|
|
297
|
+
},
|
|
298
|
+
project_root: stringProp,
|
|
299
|
+
actor: stringProp,
|
|
300
|
+
source: stringProp,
|
|
301
|
+
session_id: stringProp,
|
|
302
|
+
},
|
|
303
|
+
["groups"],
|
|
304
|
+
(input) => ({ ...input, id: resolveRuleId(artifacts, scopes, input.project_root as string | undefined, input.id, input.name) }),
|
|
305
|
+
);
|
|
306
|
+
|
|
243
307
|
define(
|
|
244
308
|
"update",
|
|
245
309
|
"Changes a Rule's title/body/labels (at least one required). Body updates still enforce the same combined condition+action+body context-tax bound as creation. The response includes combinedLength and a non-blocking warning once it exceeds the ~600-character soft target.",
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scope groups (named, reusable, possibly-nested scope member collections) projected as a real
|
|
3
|
+
* VehicleRegistry: one VehicleOperation per real action. Wraps modules/scope-groups.ts's
|
|
4
|
+
* operation definitions. See artifact/artifact-scope-store.ts's own doc comment for how a Doc/
|
|
5
|
+
* Rule/Playbook's explicit scope references a group (docs/rules/playbooks.add_group etc.).
|
|
6
|
+
*/
|
|
7
|
+
import type { VehicleRegistry } from "@danypops/vehicle-server";
|
|
8
|
+
import type { ArtifactScopeStore } from "../artifact/artifact-scope-store.ts";
|
|
9
|
+
import { scopeGroupsOperations } from "../modules/scope-groups.ts";
|
|
10
|
+
import type { ProjectRegistryStore } from "../project-registry/project-registry-store.ts";
|
|
11
|
+
import type { ScopeGroupStore } from "../scope-group/scope-group-store.ts";
|
|
12
|
+
import { createOperationDefiner, numberProp, stringProp } from "./shared.ts";
|
|
13
|
+
|
|
14
|
+
const OWNER = "scope_groups";
|
|
15
|
+
|
|
16
|
+
export function registerScopeGroupsVehicleOperations(
|
|
17
|
+
registry: VehicleRegistry,
|
|
18
|
+
scopeGroups: ScopeGroupStore,
|
|
19
|
+
projectRegistry: ProjectRegistryStore,
|
|
20
|
+
artifactScopes: ArtifactScopeStore,
|
|
21
|
+
): void {
|
|
22
|
+
const moduleOperations = new Map(scopeGroupsOperations(scopeGroups, projectRegistry, artifactScopes).map((op) => [op.name, op]));
|
|
23
|
+
const call = (name: string, input: Record<string, unknown>): unknown => moduleOperations.get(name)!.execute(input);
|
|
24
|
+
const define = createOperationDefiner(registry, OWNER, "scope_groups", ["scope_groups:read", "scope_groups:write"], call);
|
|
25
|
+
|
|
26
|
+
define(
|
|
27
|
+
"list",
|
|
28
|
+
"Lists registered scope groups, optionally filtered by a name/alias substring.",
|
|
29
|
+
"read",
|
|
30
|
+
{ query: stringProp, limit: numberProp },
|
|
31
|
+
[],
|
|
32
|
+
(input) => input,
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
define(
|
|
36
|
+
"resolve",
|
|
37
|
+
"Resolves an exact scope group reference (id, name, or alias) to its full identity, failing closed with bounded candidates when unknown or ambiguous.",
|
|
38
|
+
"read",
|
|
39
|
+
{ reference: stringProp },
|
|
40
|
+
["reference"],
|
|
41
|
+
(input) => input,
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
define(
|
|
45
|
+
"register",
|
|
46
|
+
"Registers a new scope group, or renames an existing one in place (via existing_id/group), preserving its stable id and old name as an alias.",
|
|
47
|
+
"local-write",
|
|
48
|
+
{
|
|
49
|
+
name: stringProp,
|
|
50
|
+
aliases: { type: "array" } as unknown as { type: string },
|
|
51
|
+
existing_id: stringProp,
|
|
52
|
+
},
|
|
53
|
+
[],
|
|
54
|
+
(input) => input,
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
define(
|
|
58
|
+
"show",
|
|
59
|
+
"Shows one scope group's identity and its own direct membership (not expanded through nested groups).",
|
|
60
|
+
"read",
|
|
61
|
+
{ group: { ...stringProp, description: "Exact scope group id, name, or alias." } },
|
|
62
|
+
["group"],
|
|
63
|
+
(input) => input,
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
define(
|
|
67
|
+
"add_member",
|
|
68
|
+
"Adds one member (a registered project, or another scope group -- nesting) to a scope group. Idempotent if already a member. Refuses a group-type member that would create a cycle or exceed the nesting depth bound.",
|
|
69
|
+
"local-write",
|
|
70
|
+
{
|
|
71
|
+
group: { ...stringProp, description: "Exact scope group id, name, or alias." },
|
|
72
|
+
member_type: { type: "string", enum: ["project", "group"] },
|
|
73
|
+
member_reference: { ...stringProp, description: "Exact project or scope group id/name/alias/root reference, per member_type." },
|
|
74
|
+
},
|
|
75
|
+
["group", "member_type", "member_reference"],
|
|
76
|
+
(input) => input,
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
define(
|
|
80
|
+
"remove_member",
|
|
81
|
+
"Removes one member from a scope group (idempotent -- removing an absent member is a no-op).",
|
|
82
|
+
"local-write",
|
|
83
|
+
{
|
|
84
|
+
group: { ...stringProp, description: "Exact scope group id, name, or alias." },
|
|
85
|
+
member_type: { type: "string", enum: ["project", "group"] },
|
|
86
|
+
member_reference: { ...stringProp, description: "Exact project or scope group id/name/alias/root reference, per member_type." },
|
|
87
|
+
},
|
|
88
|
+
["group", "member_type", "member_reference"],
|
|
89
|
+
(input) => input,
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
define(
|
|
93
|
+
"delete",
|
|
94
|
+
"Deletes a scope group outright. Refuses if any artifact's explicit scope, or any other scope group's own membership, still references it.",
|
|
95
|
+
"local-write",
|
|
96
|
+
{ group: { ...stringProp, description: "Exact scope group id, name, or alias." } },
|
|
97
|
+
["group"],
|
|
98
|
+
(input) => input,
|
|
99
|
+
);
|
|
100
|
+
}
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
import { VehicleError } from "@danypops/vehicle-core";
|
|
11
11
|
import { PlaybookCompositionError } from "../playbook/playbook-definition.ts";
|
|
12
12
|
import { InvalidSessionSecretError } from "../session-identity/session-identity-service.ts";
|
|
13
|
-
import { TaskCreateIdempotencyConflictError } from "../stores/task-create-request-store.ts";
|
|
14
13
|
import { TaskDependencyCycleError, TaskExecutionBoundExceededError } from "../task/task-execution.ts";
|
|
14
|
+
import { TaskCreateIdempotencyConflictError } from "../task-create-request/task-create-request-store.ts";
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* tasks.focus/pause/unpause/clear_focus and playbooks.invoke all re-run
|
package/src/handlers/tasks.ts
CHANGED
|
@@ -23,12 +23,10 @@ import { VehicleError, type VehicleLimits, type VehicleOperationContext } from "
|
|
|
23
23
|
import type { VehicleRegistry } from "@danypops/vehicle-server";
|
|
24
24
|
import type { ArtifactStore } from "../artifact/artifact-store.ts";
|
|
25
25
|
import { GATE_TIMEOUT_MAX_MS, TASK_CREATE_IDEMPOTENCY_KEY_MAX_LENGTH, TASK_MUTATION_IDEMPOTENCY_KEY_MAX_LENGTH } from "../constants.ts";
|
|
26
|
-
import {
|
|
27
|
-
import { GATE_TYPES } from "../domain/gate.ts";
|
|
28
|
-
import type { TaskViewMode } from "../domain/task-scope.ts";
|
|
26
|
+
import { GATE_TYPES } from "../gate/gate.ts";
|
|
29
27
|
import { tasksOperations } from "../modules/tasks.ts";
|
|
30
28
|
import type { SessionIdentity } from "../session-identity/session-identity-service.ts";
|
|
31
|
-
import {
|
|
29
|
+
import { PROOF_TYPES } from "../task/checklist.ts";
|
|
32
30
|
import type { TaskExecutionPlan } from "../task/task-execution.ts";
|
|
33
31
|
import {
|
|
34
32
|
type TaskCompletion,
|
|
@@ -38,6 +36,8 @@ import {
|
|
|
38
36
|
TaskProjectNotFoundError,
|
|
39
37
|
type Tasks,
|
|
40
38
|
} from "../task/task-service.ts";
|
|
39
|
+
import { TaskMutationIdempotencyConflictError, TaskMutationPendingError } from "../task-mutation-request/task-mutation-request-store.ts";
|
|
40
|
+
import type { TaskViewMode } from "../task-scope/task-scope.ts";
|
|
41
41
|
import {
|
|
42
42
|
booleanProp,
|
|
43
43
|
classifySessionAuthorization,
|
package/src/index.ts
CHANGED
|
@@ -17,20 +17,17 @@ export {
|
|
|
17
17
|
type VehicleClientTarget,
|
|
18
18
|
} from "./client.ts";
|
|
19
19
|
export * from "./constants.ts";
|
|
20
|
+
export { DISCUSSION_SUBTYPE, type DiscussionRound, readDiscussionExtra } from "./discussion/discussion.ts";
|
|
20
21
|
export type { DiscussionAndRounds } from "./discussion/discussion-service.ts";
|
|
21
|
-
export {
|
|
22
|
-
export
|
|
23
|
-
export type {
|
|
24
|
-
export type {
|
|
25
|
-
export type { NoteHistoryPage } from "./domain/note-event.ts";
|
|
26
|
-
export type { TaskEvent, TaskHistoryPage } from "./domain/task-event.ts";
|
|
27
|
-
export type { TaskLease, TaskLeaseView } from "./domain/task-lease.ts";
|
|
28
|
-
export type { TaskViewSelection } from "./domain/task-scope.ts";
|
|
22
|
+
export type { DisplayGraph, DisplayGraphEdge, DisplayGraphNode, RenderedGraph } from "./display-graph/display-graph.ts";
|
|
23
|
+
export type { GraphRenderer } from "./display-graph/graph-renderer.ts";
|
|
24
|
+
export type { GateResult } from "./gate/gate.ts";
|
|
25
|
+
export type { NoteHistoryPage } from "./note/note-event.ts";
|
|
29
26
|
export { NOTE_DISPOSITIONS } from "./note/note-service.ts";
|
|
30
27
|
export type { PlaybookInvocationResult, PlaybookMissingArguments } from "./playbook/playbook-execution.ts";
|
|
31
28
|
export type { WorkflowRunResult } from "./playbook/workflow-execution.ts";
|
|
32
29
|
export type { OperationName, SchemaState } from "./service.ts";
|
|
33
|
-
export type
|
|
30
|
+
export { checklistEntries, PROOF_TYPES, type ProofReference } from "./task/checklist.ts";
|
|
34
31
|
export { taskContext } from "./task/task-context.ts";
|
|
35
32
|
export { projectTaskExecution, type TaskExecutionPlan, type TaskExecutionState } from "./task/task-execution.ts";
|
|
36
33
|
export { projectTaskGraph, type TaskGraphView } from "./task/task-graph-view.ts";
|
|
@@ -44,3 +41,6 @@ export type {
|
|
|
44
41
|
TaskStatus,
|
|
45
42
|
} from "./task/task-service.ts";
|
|
46
43
|
export { TaskInvalidTransitionError, TaskMutationReceiptNotFoundError } from "./task/task-service.ts";
|
|
44
|
+
export type { TaskEvent, TaskHistoryPage } from "./task-event/task-event.ts";
|
|
45
|
+
export type { TaskLease, TaskLeaseView } from "./task-lease/task-lease.ts";
|
|
46
|
+
export type { TaskViewSelection } from "./task-scope/task-scope.ts";
|
package/src/log/log-service.ts
CHANGED
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
type LogQuery,
|
|
10
10
|
meetsLevel,
|
|
11
11
|
validateAppendLogEntryCommand,
|
|
12
|
-
} from "
|
|
13
|
-
import type { LogStore } from "
|
|
12
|
+
} from "./log-entry.ts";
|
|
13
|
+
import type { LogStore } from "./log-store.ts";
|
|
14
14
|
|
|
15
15
|
export class Logs {
|
|
16
16
|
constructor(private readonly store: LogStore) {}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Db } from "../db.ts";
|
|
2
|
-
import type { JsonValue, LogEntry, LogLevel, LogSource } from "../
|
|
3
|
-
import type { LogStore } from "
|
|
2
|
+
import type { JsonValue, LogEntry, LogLevel, LogSource } from "../log/log-entry.ts";
|
|
3
|
+
import type { LogStore } from "../log/log-store.ts";
|
|
4
4
|
|
|
5
5
|
interface SourceRow {
|
|
6
6
|
id: string;
|
package/src/modules/docs.ts
CHANGED
|
@@ -12,6 +12,7 @@ import type { ArtifactScopeStore } from "../artifact/artifact-scope-store.ts";
|
|
|
12
12
|
import type { ArtifactStore } from "../artifact/artifact-store.ts";
|
|
13
13
|
import type { AuthorityRegistry } from "../authority-registry.ts";
|
|
14
14
|
import {
|
|
15
|
+
addDocGroup,
|
|
15
16
|
addDocProject,
|
|
16
17
|
assignDocumentProject,
|
|
17
18
|
createDocument,
|
|
@@ -19,15 +20,19 @@ import {
|
|
|
19
20
|
docScope,
|
|
20
21
|
linkDocument,
|
|
21
22
|
listDocuments,
|
|
23
|
+
removeDocGroup,
|
|
22
24
|
removeDocProject,
|
|
25
|
+
replaceDocGroups,
|
|
23
26
|
replaceDocProjects,
|
|
24
27
|
setDocGlobal,
|
|
28
|
+
setDocNone,
|
|
25
29
|
showDocument,
|
|
26
30
|
transitionDocument,
|
|
27
31
|
updateDocument,
|
|
28
32
|
} from "../docs/docs-service.ts";
|
|
29
33
|
import type { OperationDefinition } from "../module-registry.ts";
|
|
30
|
-
import type { ProjectRegistryStore } from "../
|
|
34
|
+
import type { ProjectRegistryStore } from "../project-registry/project-registry-store.ts";
|
|
35
|
+
import type { ScopeGroupStore } from "../scope-group/scope-group-store.ts";
|
|
31
36
|
import { type OperationInput, optionalBoolean, optionalNumber, optionalString, string } from "./operation-input.ts";
|
|
32
37
|
|
|
33
38
|
const MODULE_ID = "docs";
|
|
@@ -69,8 +74,12 @@ export const DOCS_OPERATION_NAMES = [
|
|
|
69
74
|
"docs.assign_project",
|
|
70
75
|
"docs.scope",
|
|
71
76
|
"docs.set_global",
|
|
77
|
+
"docs.set_none",
|
|
72
78
|
"docs.add_project",
|
|
73
79
|
"docs.remove_project",
|
|
80
|
+
"docs.add_group",
|
|
81
|
+
"docs.remove_group",
|
|
82
|
+
"docs.replace_groups",
|
|
74
83
|
"docs.replace_projects",
|
|
75
84
|
"docs.update",
|
|
76
85
|
] as const;
|
|
@@ -80,6 +89,7 @@ export function docsOperations(
|
|
|
80
89
|
scopes: ArtifactScopeStore,
|
|
81
90
|
authority: AuthorityRegistry,
|
|
82
91
|
registry: ProjectRegistryStore,
|
|
92
|
+
scopeGroups: ScopeGroupStore,
|
|
83
93
|
): OperationDefinition[] {
|
|
84
94
|
const define = <Input, Output>(name: string, execute: (input: Input) => Output): OperationDefinition<Input, Output> => ({
|
|
85
95
|
name,
|
|
@@ -135,6 +145,7 @@ export function docsOperations(
|
|
|
135
145
|
),
|
|
136
146
|
define("docs.scope", (input: OperationInput) => docScope(artifacts, scopes, string(input, "id"))),
|
|
137
147
|
define("docs.set_global", (input: OperationInput) => setDocGlobal(artifacts, scopes, string(input, "id"))),
|
|
148
|
+
define("docs.set_none", (input: OperationInput) => setDocNone(artifacts, scopes, string(input, "id"))),
|
|
138
149
|
define("docs.add_project", (input: OperationInput) =>
|
|
139
150
|
addDocProject(artifacts, scopes, registry, string(input, "id"), string(input, "project")),
|
|
140
151
|
),
|
|
@@ -144,6 +155,15 @@ export function docsOperations(
|
|
|
144
155
|
define("docs.replace_projects", (input: OperationInput) =>
|
|
145
156
|
replaceDocProjects(artifacts, scopes, registry, string(input, "id"), (input.projects as string[] | undefined) ?? []),
|
|
146
157
|
),
|
|
158
|
+
define("docs.add_group", (input: OperationInput) =>
|
|
159
|
+
addDocGroup(artifacts, scopes, scopeGroups, string(input, "id"), string(input, "group")),
|
|
160
|
+
),
|
|
161
|
+
define("docs.remove_group", (input: OperationInput) =>
|
|
162
|
+
removeDocGroup(artifacts, scopes, scopeGroups, string(input, "id"), string(input, "group")),
|
|
163
|
+
),
|
|
164
|
+
define("docs.replace_groups", (input: OperationInput) =>
|
|
165
|
+
replaceDocGroups(artifacts, scopes, scopeGroups, string(input, "id"), (input.groups as string[] | undefined) ?? []),
|
|
166
|
+
),
|
|
147
167
|
define("docs.update", (input: OperationInput) =>
|
|
148
168
|
updateDocument(
|
|
149
169
|
artifacts,
|
|
@@ -13,10 +13,10 @@ import type {
|
|
|
13
13
|
GraphProjectionBatch,
|
|
14
14
|
ProjectedArtifact,
|
|
15
15
|
ProjectedEdge,
|
|
16
|
-
} from "../
|
|
16
|
+
} from "../graph-projection/graph-projection.ts";
|
|
17
17
|
import { GraphProjection } from "../graph-projection/graph-projection-service.ts";
|
|
18
|
+
import type { GraphProjectionStore } from "../graph-projection/graph-projection-store.ts";
|
|
18
19
|
import type { OperationDefinition } from "../module-registry.ts";
|
|
19
|
-
import type { GraphProjectionStore } from "../stores/graph-projection-store.ts";
|
|
20
20
|
import { type OperationInput, string } from "./operation-input.ts";
|
|
21
21
|
|
|
22
22
|
const MODULE_ID = "graph_projection";
|
package/src/modules/logs.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* logs never touch the Artifact graph directly (see src/domain/log-entry.ts's own module
|
|
6
6
|
* comment on why `log` is not an Artifact kind).
|
|
7
7
|
*/
|
|
8
|
-
import type { JsonValue, LogLevel } from "../
|
|
8
|
+
import type { JsonValue, LogLevel } from "../log/log-entry.ts";
|
|
9
9
|
import type { Logs } from "../log/log-service.ts";
|
|
10
10
|
import type { OperationDefinition } from "../module-registry.ts";
|
|
11
11
|
import { type OperationInput, optionalNumber, optionalString, string } from "./operation-input.ts";
|
package/src/modules/notes.ts
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* module's infrastructure" constraint.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import type { NoteEventDirection } from "../domain/note-event.ts";
|
|
17
16
|
import type { OperationDefinition } from "../module-registry.ts";
|
|
17
|
+
import type { NoteEventDirection } from "../note/note-event.ts";
|
|
18
18
|
import type { NoteDisposition, Notes } from "../note/note-service.ts";
|
|
19
19
|
import { type OperationInput, optionalNumber, optionalString, string } from "./operation-input.ts";
|
|
20
20
|
|
package/src/modules/playbooks.ts
CHANGED
|
@@ -16,6 +16,7 @@ import type { ArtifactStore } from "../artifact/artifact-store.ts";
|
|
|
16
16
|
import type { OperationDefinition } from "../module-registry.ts";
|
|
17
17
|
import { invokePlaybook } from "../playbook/playbook-execution.ts";
|
|
18
18
|
import {
|
|
19
|
+
addPlaybookGroup,
|
|
19
20
|
addPlaybookProject,
|
|
20
21
|
assignPlaybookProject,
|
|
21
22
|
containPlaybook,
|
|
@@ -24,20 +25,24 @@ import {
|
|
|
24
25
|
listPlaybooks,
|
|
25
26
|
playbookInvocation,
|
|
26
27
|
playbookScope,
|
|
28
|
+
removePlaybookGroup,
|
|
27
29
|
removePlaybookProject,
|
|
30
|
+
replacePlaybookGroups,
|
|
28
31
|
replacePlaybookProjects,
|
|
29
32
|
setPlaybookGlobal,
|
|
33
|
+
setPlaybookNone,
|
|
30
34
|
showPlaybook,
|
|
31
35
|
transitionPlaybook,
|
|
32
36
|
uncontainPlaybook,
|
|
33
37
|
undependPlaybook,
|
|
34
38
|
updatePlaybook,
|
|
35
39
|
} from "../playbook/playbook-service.ts";
|
|
36
|
-
import type { ProjectRegistryStore } from "../
|
|
40
|
+
import type { ProjectRegistryStore } from "../project-registry/project-registry-store.ts";
|
|
41
|
+
import type { ScopeGroupStore } from "../scope-group/scope-group-store.ts";
|
|
37
42
|
import type { SessionIdentity } from "../session-identity/session-identity-service.ts";
|
|
38
|
-
import type { TaskEventStore } from "../stores/task-event-store.ts";
|
|
39
|
-
import type { TaskScopeStore } from "../stores/task-scope-store.ts";
|
|
40
43
|
import type { Tasks } from "../task/task-service.ts";
|
|
44
|
+
import type { TaskEventStore } from "../task-event/task-event-store.ts";
|
|
45
|
+
import type { TaskScopeStore } from "../task-scope/task-scope-store.ts";
|
|
41
46
|
import { type OperationInput, optionalBoolean, optionalNumber, optionalString, string } from "./operation-input.ts";
|
|
42
47
|
|
|
43
48
|
const MODULE_ID = "playbooks";
|
|
@@ -84,9 +89,13 @@ export const PLAYBOOKS_OPERATION_NAMES = [
|
|
|
84
89
|
"playbooks.assign_project",
|
|
85
90
|
"playbooks.scope",
|
|
86
91
|
"playbooks.set_global",
|
|
92
|
+
"playbooks.set_none",
|
|
87
93
|
"playbooks.add_project",
|
|
88
94
|
"playbooks.remove_project",
|
|
89
95
|
"playbooks.replace_projects",
|
|
96
|
+
"playbooks.add_group",
|
|
97
|
+
"playbooks.remove_group",
|
|
98
|
+
"playbooks.replace_groups",
|
|
90
99
|
"playbooks.update",
|
|
91
100
|
"playbooks.contain",
|
|
92
101
|
"playbooks.uncontain",
|
|
@@ -105,6 +114,7 @@ export interface PlaybooksModuleDeps {
|
|
|
105
114
|
/** Guards the same session_secret check tasks.focus's own operation enforces (guardFocusMutation in modules/tasks.ts) -- invoke's internal tasks.focus() call goes straight through the Tasks class, bypassing that operation wrapper entirely, so the check must be applied here instead of silently skipped. */
|
|
106
115
|
sessionIdentity: SessionIdentity;
|
|
107
116
|
registry: ProjectRegistryStore;
|
|
117
|
+
scopeGroups: ScopeGroupStore;
|
|
108
118
|
}
|
|
109
119
|
|
|
110
120
|
export function playbooksOperations({
|
|
@@ -115,6 +125,7 @@ export function playbooksOperations({
|
|
|
115
125
|
tasks,
|
|
116
126
|
sessionIdentity,
|
|
117
127
|
registry,
|
|
128
|
+
scopeGroups,
|
|
118
129
|
}: PlaybooksModuleDeps): OperationDefinition[] {
|
|
119
130
|
const define = <Input, Output>(name: string, execute: (input: Input) => Output): OperationDefinition<Input, Output> => ({
|
|
120
131
|
name,
|
|
@@ -185,6 +196,16 @@ export function playbooksOperations({
|
|
|
185
196
|
),
|
|
186
197
|
define("playbooks.scope", (input: OperationInput) => playbookScope(artifacts, artifactScopes, string(input, "id"))),
|
|
187
198
|
define("playbooks.set_global", (input: OperationInput) => setPlaybookGlobal(artifacts, artifactScopes, string(input, "id"))),
|
|
199
|
+
define("playbooks.set_none", (input: OperationInput) => setPlaybookNone(artifacts, artifactScopes, string(input, "id"))),
|
|
200
|
+
define("playbooks.add_group", (input: OperationInput) =>
|
|
201
|
+
addPlaybookGroup(artifacts, artifactScopes, scopeGroups, string(input, "id"), string(input, "group")),
|
|
202
|
+
),
|
|
203
|
+
define("playbooks.remove_group", (input: OperationInput) =>
|
|
204
|
+
removePlaybookGroup(artifacts, artifactScopes, scopeGroups, string(input, "id"), string(input, "group")),
|
|
205
|
+
),
|
|
206
|
+
define("playbooks.replace_groups", (input: OperationInput) =>
|
|
207
|
+
replacePlaybookGroups(artifacts, artifactScopes, scopeGroups, string(input, "id"), (input.groups as string[] | undefined) ?? []),
|
|
208
|
+
),
|
|
188
209
|
define("playbooks.add_project", (input: OperationInput) =>
|
|
189
210
|
addPlaybookProject(artifacts, artifactScopes, registry, string(input, "id"), string(input, "project")),
|
|
190
211
|
),
|
package/src/modules/projects.ts
CHANGED
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { TASK_PROJECT_LIST_MAX_RESULTS } from "../constants.ts";
|
|
11
|
-
import { assertRegisterProjectInputBounds, resolveProjectReference } from "../domain/project-registry.ts";
|
|
12
|
-
import { normalizeProjectRoot } from "../domain/task-scope.ts";
|
|
13
11
|
import type { OperationDefinition } from "../module-registry.ts";
|
|
14
|
-
import
|
|
12
|
+
import { assertRegisterProjectInputBounds, resolveProjectReference } from "../project-registry/project-registry.ts";
|
|
13
|
+
import type { ProjectRegistryStore } from "../project-registry/project-registry-store.ts";
|
|
14
|
+
import { normalizeProjectRoot } from "../task-scope/task-scope.ts";
|
|
15
15
|
import { type OperationInput, optionalNumber, optionalString, optionalStringArray, string } from "./operation-input.ts";
|
|
16
16
|
|
|
17
17
|
const MODULE_ID = "projects";
|