@danypops/papyrus 0.41.0 → 0.42.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/README.md +8 -11
- package/package.json +2 -2
- package/src/adapters/sqlite-artifact-scope-store.ts +18 -9
- package/src/adapters/sqlite-artifact-store.ts +7 -5
- package/src/adapters/sqlite-discussion-round-store.ts +26 -17
- package/src/adapters/sqlite-gate-runner.ts +1 -1
- package/src/adapters/sqlite-graph-projection-store.ts +14 -10
- package/src/adapters/sqlite-log-store.ts +36 -17
- package/src/adapters/sqlite-note-event-store.ts +20 -16
- package/src/adapters/sqlite-session-identity-store.ts +13 -7
- package/src/adapters/sqlite-task-event-store.ts +29 -21
- package/src/adapters/sqlite-task-focus-store.ts +36 -10
- package/src/adapters/sqlite-task-lease-store.ts +12 -6
- package/src/adapters/sqlite-task-scope-store.ts +25 -14
- package/src/artifact-relationship-view.ts +4 -4
- package/src/artifact-subtree.ts +4 -2
- package/src/authority-registry.ts +2 -1
- package/src/cli.ts +794 -354
- package/src/client.ts +6 -3
- package/src/constants.ts +34 -56
- package/src/daemon-state.ts +4 -12
- package/src/daemon.ts +31 -9
- package/src/db.ts +153 -105
- package/src/discussion-service.ts +109 -44
- package/src/domain/artifact-event.ts +18 -5
- package/src/domain/artifact.ts +3 -1
- package/src/domain/blueprint-definition.ts +268 -0
- package/src/domain/checklist.ts +20 -17
- package/src/domain/discussion.ts +37 -18
- package/src/domain/gate.ts +7 -7
- package/src/domain/log-entry.ts +1 -1
- package/src/domain/note-event.ts +20 -7
- package/src/domain/task-event.ts +17 -7
- package/src/domain-services.ts +362 -288
- package/src/graph-projection-service.ts +34 -8
- package/src/id-migration.ts +17 -4
- package/src/index.ts +16 -11
- package/src/log-service.ts +6 -5
- package/src/log.ts +19 -0
- package/src/modules/discuss.ts +63 -28
- package/src/modules/docs.ts +74 -17
- package/src/modules/graph-projection.ts +20 -9
- package/src/modules/logs.ts +34 -22
- package/src/modules/notes.ts +66 -28
- package/src/modules/playbooks.ts +93 -32
- package/src/modules/rules.ts +57 -15
- package/src/modules/session-identity.ts +6 -2
- package/src/modules/tasks.ts +142 -67
- package/src/note-service.ts +11 -7
- package/src/ops.ts +134 -69
- package/src/playbook-definition.ts +124 -39
- package/src/playbook-execution.ts +18 -25
- package/src/ports/artifact-scope-store.ts +1 -1
- package/src/ports/note-event-store.ts +6 -4
- package/src/ports/task-event-store.ts +9 -6
- package/src/ports/task-focus-store.ts +17 -4
- package/src/ports/task-lease-store.ts +9 -4
- package/src/ports/task-scope-store.ts +3 -1
- package/src/service.ts +148 -110
- package/src/session-identity-service.ts +10 -2
- package/src/task-context.ts +28 -16
- package/src/task-execution.ts +4 -12
- package/src/task-graph-view.ts +12 -12
- package/src/task-relationship-view.ts +1 -3
- package/src/task-service.ts +168 -73
- package/src/vehicle/artifact-trash-vehicle.ts +26 -14
- package/src/vehicle/artifact-vehicle-shared.ts +32 -13
- package/src/vehicle/docs-vehicle.ts +50 -18
- package/src/vehicle/notes-vehicle.ts +26 -8
- package/src/vehicle/papyrus-vehicle.ts +16 -8
- package/src/vehicle/playbooks-vehicle.ts +88 -19
- package/src/vehicle/rules-vehicle.ts +58 -21
- package/src/vehicle/tasks-vehicle.ts +366 -54
- package/src/version.ts +1 -1
- package/src/workflow-execution.ts +198 -109
- package/src/domain/skill-definition.ts +0 -270
- package/src/modules/skills.ts +0 -158
- package/src/vehicle/skills-vehicle.ts +0 -194
package/src/modules/notes.ts
CHANGED
|
@@ -12,9 +12,10 @@
|
|
|
12
12
|
* OperationInput parsing helpers, matching the "module code does not import another
|
|
13
13
|
* module's infrastructure" constraint.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
import type { NoteEventDirection } from "../domain/note-event.ts";
|
|
17
|
-
import {
|
|
17
|
+
import type { OperationDefinition } from "../module-registry.ts";
|
|
18
|
+
import type { NoteDisposition, Notes } from "../note-service.ts";
|
|
18
19
|
|
|
19
20
|
const MODULE_ID = "notes";
|
|
20
21
|
|
|
@@ -42,39 +43,76 @@ function optionalNumber(input: OperationInput, key: string): number | undefined
|
|
|
42
43
|
|
|
43
44
|
/** This module's own operation names, the single source of truth src/service.ts's EXPECTED_OPERATION_NAMES spreads in rather than re-listing by hand. */
|
|
44
45
|
export const NOTES_OPERATION_NAMES = [
|
|
45
|
-
"notes.capture",
|
|
46
|
+
"notes.capture",
|
|
47
|
+
"notes.list",
|
|
48
|
+
"notes.show",
|
|
49
|
+
"notes.history",
|
|
50
|
+
"notes.consume",
|
|
51
|
+
"notes.promote",
|
|
52
|
+
"notes.archive",
|
|
46
53
|
] as const;
|
|
47
54
|
|
|
48
55
|
/** Registers every notes.* operation against one Notes instance. Behavior is unchanged from the prior inline handlers in src/service.ts. */
|
|
49
56
|
export function notesOperations(notes: Notes): OperationDefinition[] {
|
|
50
57
|
const define = <Input, Output>(name: string, execute: (input: Input) => Output): OperationDefinition<Input, Output> => ({
|
|
51
|
-
name,
|
|
58
|
+
name,
|
|
59
|
+
moduleId: MODULE_ID,
|
|
60
|
+
execute,
|
|
52
61
|
});
|
|
53
62
|
return [
|
|
54
|
-
define("notes.capture", (input: OperationInput) =>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
define("notes.capture", (input: OperationInput) =>
|
|
64
|
+
notes.capture({
|
|
65
|
+
body: string(input, "body"),
|
|
66
|
+
title: optionalString(input, "title"),
|
|
67
|
+
projectRoot: string(input, "project_root"),
|
|
68
|
+
actor: optionalString(input, "actor"),
|
|
69
|
+
source: optionalString(input, "source"),
|
|
70
|
+
sessionId: optionalString(input, "session_id"),
|
|
71
|
+
}),
|
|
72
|
+
),
|
|
73
|
+
define("notes.list", (input: OperationInput) =>
|
|
74
|
+
notes.list({
|
|
75
|
+
projectRoot: string(input, "project_root"),
|
|
76
|
+
status: optionalString(input, "status") as "draft" | "active" | "archived" | undefined,
|
|
77
|
+
text: optionalString(input, "text"),
|
|
78
|
+
limit: optionalNumber(input, "limit"),
|
|
79
|
+
}),
|
|
80
|
+
),
|
|
62
81
|
define("notes.show", (input: OperationInput) => notes.show(string(input, "id"), string(input, "project_root"))),
|
|
63
|
-
define("notes.history", (input: OperationInput) =>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
define("notes.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
82
|
+
define("notes.history", (input: OperationInput) =>
|
|
83
|
+
notes.history(string(input, "id"), string(input, "project_root"), {
|
|
84
|
+
limit: optionalNumber(input, "limit"),
|
|
85
|
+
cursor: optionalNumber(input, "cursor"),
|
|
86
|
+
direction: optionalString(input, "direction") as NoteEventDirection | undefined,
|
|
87
|
+
}),
|
|
88
|
+
),
|
|
89
|
+
define("notes.consume", (input: OperationInput) =>
|
|
90
|
+
notes.consume(string(input, "id"), {
|
|
91
|
+
projectRoot: string(input, "project_root"),
|
|
92
|
+
actor: optionalString(input, "actor"),
|
|
93
|
+
source: optionalString(input, "source"),
|
|
94
|
+
sessionId: optionalString(input, "session_id"),
|
|
95
|
+
reason: optionalString(input, "reason"),
|
|
96
|
+
}),
|
|
97
|
+
),
|
|
98
|
+
define("notes.promote", (input: OperationInput) =>
|
|
99
|
+
notes.promote(string(input, "id"), string(input, "target_id"), {
|
|
100
|
+
projectRoot: string(input, "project_root"),
|
|
101
|
+
actor: optionalString(input, "actor"),
|
|
102
|
+
source: optionalString(input, "source"),
|
|
103
|
+
sessionId: optionalString(input, "session_id"),
|
|
104
|
+
reason: optionalString(input, "reason"),
|
|
105
|
+
}),
|
|
106
|
+
),
|
|
107
|
+
define("notes.archive", (input: OperationInput) =>
|
|
108
|
+
notes.archive(string(input, "id"), {
|
|
109
|
+
projectRoot: string(input, "project_root"),
|
|
110
|
+
disposition: string(input, "disposition") as NoteDisposition,
|
|
111
|
+
actor: optionalString(input, "actor"),
|
|
112
|
+
source: optionalString(input, "source"),
|
|
113
|
+
sessionId: optionalString(input, "session_id"),
|
|
114
|
+
reason: optionalString(input, "reason"),
|
|
115
|
+
}),
|
|
116
|
+
),
|
|
79
117
|
];
|
|
80
118
|
}
|
package/src/modules/playbooks.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* modules/playbooks.ts — Playbooks as a Papyrus-native registered module.
|
|
3
3
|
*
|
|
4
|
-
* A Playbook
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* recycles the
|
|
8
|
-
*
|
|
4
|
+
* A Playbook is prose-first, whole-artifact composition (contains/depends_on between real
|
|
5
|
+
* Playbook artifacts) rather than a raw JSON blueprint -- but its own step list can also
|
|
6
|
+
* declare Doc/Rule blueprints and typed arguments and nested pipeline calls. playbooks.invoke
|
|
7
|
+
* recycles the shared blueprint materialization engine (playbook-execution.ts compiles a
|
|
8
|
+
* Playbook's steps and composition tree into a BlueprintDefinition, then hands off to
|
|
9
9
|
* workflow-execution.ts's shared core). See domain-services.ts's Playbook section and
|
|
10
10
|
* playbook-definition.ts for the full rationale.
|
|
11
11
|
*/
|
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
updatePlaybook,
|
|
24
24
|
} from "../domain-services.ts";
|
|
25
25
|
import type { OperationDefinition } from "../module-registry.ts";
|
|
26
|
+
import { invokePlaybook } from "../playbook-execution.ts";
|
|
26
27
|
import type { ArtifactScopeStore } from "../ports/artifact-scope-store.ts";
|
|
27
28
|
import type { ArtifactStore } from "../ports/artifact-store.ts";
|
|
28
29
|
import type { TaskEventStore } from "../ports/task-event-store.ts";
|
|
29
30
|
import type { TaskScopeStore } from "../ports/task-scope-store.ts";
|
|
30
|
-
import { invokePlaybook } from "../playbook-execution.ts";
|
|
31
31
|
import type { SessionIdentity } from "../session-identity-service.ts";
|
|
32
32
|
import type { Tasks } from "../task-service.ts";
|
|
33
33
|
|
|
@@ -75,8 +75,19 @@ const artifactFilter = (input: OperationInput) => ({
|
|
|
75
75
|
|
|
76
76
|
/** This module's own operation names, the single source of truth src/service.ts's EXPECTED_OPERATION_NAMES spreads in rather than re-listing by hand. */
|
|
77
77
|
export const PLAYBOOKS_OPERATION_NAMES = [
|
|
78
|
-
"playbooks.create",
|
|
79
|
-
"playbooks.
|
|
78
|
+
"playbooks.create",
|
|
79
|
+
"playbooks.list",
|
|
80
|
+
"playbooks.show",
|
|
81
|
+
"playbooks.invoke",
|
|
82
|
+
"playbooks.preview",
|
|
83
|
+
"playbooks.enable",
|
|
84
|
+
"playbooks.disable",
|
|
85
|
+
"playbooks.assign_project",
|
|
86
|
+
"playbooks.update",
|
|
87
|
+
"playbooks.contain",
|
|
88
|
+
"playbooks.uncontain",
|
|
89
|
+
"playbooks.depend",
|
|
90
|
+
"playbooks.undepend",
|
|
80
91
|
] as const;
|
|
81
92
|
|
|
82
93
|
export interface PlaybooksModuleDeps {
|
|
@@ -91,41 +102,91 @@ export interface PlaybooksModuleDeps {
|
|
|
91
102
|
sessionIdentity: SessionIdentity;
|
|
92
103
|
}
|
|
93
104
|
|
|
94
|
-
export function playbooksOperations({
|
|
105
|
+
export function playbooksOperations({
|
|
106
|
+
artifacts,
|
|
107
|
+
events,
|
|
108
|
+
scopes,
|
|
109
|
+
artifactScopes,
|
|
110
|
+
tasks,
|
|
111
|
+
sessionIdentity,
|
|
112
|
+
}: PlaybooksModuleDeps): OperationDefinition[] {
|
|
95
113
|
const define = <Input, Output>(name: string, execute: (input: Input) => Output): OperationDefinition<Input, Output> => ({
|
|
96
|
-
name,
|
|
114
|
+
name,
|
|
115
|
+
moduleId: MODULE_ID,
|
|
116
|
+
execute,
|
|
97
117
|
});
|
|
98
118
|
return [
|
|
99
|
-
define("playbooks.create", (input: OperationInput) =>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
119
|
+
define("playbooks.create", (input: OperationInput) =>
|
|
120
|
+
createPlaybook(
|
|
121
|
+
artifacts,
|
|
122
|
+
artifactScopes,
|
|
123
|
+
{
|
|
124
|
+
title: string(input, "title"),
|
|
125
|
+
body: optionalString(input, "body"),
|
|
126
|
+
trigger: optionalString(input, "trigger"),
|
|
127
|
+
steps: input.steps,
|
|
128
|
+
tools: input.tools as string[] | undefined,
|
|
129
|
+
arguments: input.arguments,
|
|
130
|
+
labels: input.labels as string[] | undefined,
|
|
131
|
+
extra: input.extra as Record<string, unknown> | undefined,
|
|
132
|
+
projectRoot: optionalString(input, "project_root"),
|
|
133
|
+
},
|
|
134
|
+
eventContext(input),
|
|
135
|
+
),
|
|
136
|
+
),
|
|
106
137
|
define("playbooks.list", (input: OperationInput) => listPlaybooks(artifacts, artifactScopes, artifactFilter(input))),
|
|
107
138
|
define("playbooks.show", (input: OperationInput) => showPlaybook(artifacts, string(input, "id"))),
|
|
108
|
-
define("playbooks.preview", (input: OperationInput) =>
|
|
139
|
+
define("playbooks.preview", (input: OperationInput) =>
|
|
140
|
+
playbookInvocation(artifacts, string(input, "id"), input.arguments as Record<string, unknown> | undefined),
|
|
141
|
+
),
|
|
109
142
|
define("playbooks.invoke", (input: OperationInput) => {
|
|
110
|
-
const result = invokePlaybook(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
143
|
+
const result = invokePlaybook(
|
|
144
|
+
artifacts,
|
|
145
|
+
string(input, "id"),
|
|
146
|
+
{
|
|
147
|
+
runId: optionalString(input, "run_id") ?? optionalString(input, "runId"),
|
|
148
|
+
arguments: input.arguments as Record<string, unknown> | undefined,
|
|
149
|
+
},
|
|
150
|
+
{ events, scopes, projectRoot: optionalString(input, "project_root"), context: eventContextFor(input, "playbook-run") },
|
|
151
|
+
);
|
|
114
152
|
if ("missingArguments" in result) return result;
|
|
115
153
|
const focusContext = eventContextFor(input, "playbook-run");
|
|
116
154
|
sessionIdentity.assertAuthorized(focusContext.sessionId, optionalString(input, "session_secret"));
|
|
117
155
|
tasks.focus(result.entryTaskId, focusContext);
|
|
118
156
|
return result;
|
|
119
157
|
}),
|
|
120
|
-
define("playbooks.enable", (input: OperationInput) =>
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
define("playbooks.
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
define("playbooks.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
define("playbooks.
|
|
158
|
+
define("playbooks.enable", (input: OperationInput) =>
|
|
159
|
+
transitionPlaybook(artifacts, string(input, "id"), "enable", eventContext(input)),
|
|
160
|
+
),
|
|
161
|
+
define("playbooks.disable", (input: OperationInput) =>
|
|
162
|
+
transitionPlaybook(artifacts, string(input, "id"), "disable", eventContext(input)),
|
|
163
|
+
),
|
|
164
|
+
define("playbooks.assign_project", (input: OperationInput) =>
|
|
165
|
+
assignPlaybookProject(artifacts, artifactScopes, string(input, "id"), optionalString(input, "project_root")),
|
|
166
|
+
),
|
|
167
|
+
define("playbooks.update", (input: OperationInput) =>
|
|
168
|
+
updatePlaybook(
|
|
169
|
+
artifacts,
|
|
170
|
+
string(input, "id"),
|
|
171
|
+
{
|
|
172
|
+
title: optionalString(input, "title"),
|
|
173
|
+
body: optionalString(input, "body"),
|
|
174
|
+
labels: input.labels as string[] | undefined,
|
|
175
|
+
},
|
|
176
|
+
eventContext(input),
|
|
177
|
+
),
|
|
178
|
+
),
|
|
179
|
+
define("playbooks.contain", (input: OperationInput) =>
|
|
180
|
+
containPlaybook(artifacts, string(input, "parent_id"), string(input, "child_id"), eventContext(input)),
|
|
181
|
+
),
|
|
182
|
+
define("playbooks.uncontain", (input: OperationInput) =>
|
|
183
|
+
uncontainPlaybook(artifacts, string(input, "parent_id"), string(input, "child_id"), eventContext(input)),
|
|
184
|
+
),
|
|
185
|
+
define("playbooks.depend", (input: OperationInput) =>
|
|
186
|
+
dependPlaybook(artifacts, string(input, "id"), string(input, "dependency_id"), eventContext(input)),
|
|
187
|
+
),
|
|
188
|
+
define("playbooks.undepend", (input: OperationInput) =>
|
|
189
|
+
undependPlaybook(artifacts, string(input, "id"), string(input, "dependency_id"), eventContext(input)),
|
|
190
|
+
),
|
|
130
191
|
];
|
|
131
192
|
}
|
package/src/modules/rules.ts
CHANGED
|
@@ -10,7 +10,16 @@
|
|
|
10
10
|
* into this module or introducing a premature "modules call each other through the
|
|
11
11
|
* registry" convention.
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
assignRuleProject,
|
|
15
|
+
createRule,
|
|
16
|
+
gateTaskWithRule,
|
|
17
|
+
listRules,
|
|
18
|
+
previewRule,
|
|
19
|
+
showRule,
|
|
20
|
+
transitionRule,
|
|
21
|
+
updateRule,
|
|
22
|
+
} from "../domain-services.ts";
|
|
14
23
|
import type { OperationDefinition } from "../module-registry.ts";
|
|
15
24
|
import type { ArtifactScopeStore } from "../ports/artifact-scope-store.ts";
|
|
16
25
|
import type { ArtifactStore } from "../ports/artifact-store.ts";
|
|
@@ -55,30 +64,63 @@ const artifactFilter = (input: OperationInput) => ({
|
|
|
55
64
|
/** Registers every rules.* operation except rules.injectable (see module comment). Behavior is unchanged from the prior inline handlers in src/service.ts. */
|
|
56
65
|
/** This module's own operation names, the single source of truth src/service.ts's EXPECTED_OPERATION_NAMES spreads in rather than re-listing by hand. rules.injectable is deliberately absent -- see the module comment above. */
|
|
57
66
|
export const RULES_OPERATION_NAMES = [
|
|
58
|
-
"rules.create",
|
|
67
|
+
"rules.create",
|
|
68
|
+
"rules.list",
|
|
69
|
+
"rules.show",
|
|
70
|
+
"rules.preview",
|
|
71
|
+
"rules.enable",
|
|
72
|
+
"rules.disable",
|
|
73
|
+
"rules.gate",
|
|
74
|
+
"rules.assign_project",
|
|
75
|
+
"rules.update",
|
|
59
76
|
] as const;
|
|
60
77
|
|
|
61
78
|
export function rulesOperations(artifacts: ArtifactStore, scopes: ArtifactScopeStore): OperationDefinition[] {
|
|
62
79
|
const define = <Input, Output>(name: string, execute: (input: Input) => Output): OperationDefinition<Input, Output> => ({
|
|
63
|
-
name,
|
|
80
|
+
name,
|
|
81
|
+
moduleId: MODULE_ID,
|
|
82
|
+
execute,
|
|
64
83
|
});
|
|
65
84
|
return [
|
|
66
|
-
define("rules.create", (input: OperationInput) =>
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
85
|
+
define("rules.create", (input: OperationInput) =>
|
|
86
|
+
createRule(
|
|
87
|
+
artifacts,
|
|
88
|
+
scopes,
|
|
89
|
+
{
|
|
90
|
+
title: string(input, "title"),
|
|
91
|
+
body: optionalString(input, "body"),
|
|
92
|
+
condition: optionalString(input, "condition"),
|
|
93
|
+
action: optionalString(input, "rule_action") ?? optionalString(input, "governance_action"),
|
|
94
|
+
severity: optionalString(input, "severity") as "block" | "warn" | "info" | undefined,
|
|
95
|
+
labels: input.labels as string[] | undefined,
|
|
96
|
+
extra: input.extra as Record<string, unknown> | undefined,
|
|
97
|
+
projectRoot: optionalString(input, "project_root"),
|
|
98
|
+
},
|
|
99
|
+
eventContext(input),
|
|
100
|
+
),
|
|
101
|
+
),
|
|
73
102
|
define("rules.list", (input: OperationInput) => listRules(artifacts, scopes, artifactFilter(input))),
|
|
74
103
|
define("rules.show", (input: OperationInput) => showRule(artifacts, string(input, "id"))),
|
|
75
104
|
define("rules.preview", (input: OperationInput) => previewRule(artifacts, string(input, "id"))),
|
|
76
105
|
define("rules.enable", (input: OperationInput) => transitionRule(artifacts, string(input, "id"), "enable", eventContext(input))),
|
|
77
106
|
define("rules.disable", (input: OperationInput) => transitionRule(artifacts, string(input, "id"), "disable", eventContext(input))),
|
|
78
|
-
define("rules.gate", (input: OperationInput) =>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
107
|
+
define("rules.gate", (input: OperationInput) =>
|
|
108
|
+
gateTaskWithRule(artifacts, string(input, "id"), string(input, "task_id"), eventContext(input)),
|
|
109
|
+
),
|
|
110
|
+
define("rules.assign_project", (input: OperationInput) =>
|
|
111
|
+
assignRuleProject(artifacts, scopes, string(input, "id"), optionalString(input, "project_root")),
|
|
112
|
+
),
|
|
113
|
+
define("rules.update", (input: OperationInput) =>
|
|
114
|
+
updateRule(
|
|
115
|
+
artifacts,
|
|
116
|
+
string(input, "id"),
|
|
117
|
+
{
|
|
118
|
+
title: optionalString(input, "title"),
|
|
119
|
+
body: optionalString(input, "body"),
|
|
120
|
+
labels: input.labels as string[] | undefined,
|
|
121
|
+
},
|
|
122
|
+
eventContext(input),
|
|
123
|
+
),
|
|
124
|
+
),
|
|
83
125
|
];
|
|
84
126
|
}
|
|
@@ -29,10 +29,14 @@ export const SESSION_IDENTITY_OPERATION_NAMES = ["session.register", "session.re
|
|
|
29
29
|
/** Registers every session.* operation against one SessionIdentity instance. */
|
|
30
30
|
export function sessionIdentityOperations(sessionIdentity: SessionIdentity): OperationDefinition[] {
|
|
31
31
|
const define = <Input, Output>(name: string, execute: (input: Input) => Output): OperationDefinition<Input, Output> => ({
|
|
32
|
-
name,
|
|
32
|
+
name,
|
|
33
|
+
moduleId: MODULE_ID,
|
|
34
|
+
execute,
|
|
33
35
|
});
|
|
34
36
|
return [
|
|
35
37
|
define("session.register", (input: OperationInput) => sessionIdentity.register(string(input, "session_id"))),
|
|
36
|
-
define("session.release", (input: OperationInput) =>
|
|
38
|
+
define("session.release", (input: OperationInput) =>
|
|
39
|
+
sessionIdentity.release(string(input, "session_id"), optionalString(input, "session_secret")),
|
|
40
|
+
),
|
|
37
41
|
];
|
|
38
42
|
}
|