rhachet-roles-bhuild 0.17.2 → 0.18.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/dist/contract/cli/{give.feedback.d.ts → feedback.give.d.ts} +1 -1
- package/dist/contract/cli/{give.feedback.js → feedback.give.js} +7 -6
- package/dist/contract/cli/{give.feedback.js.map → feedback.give.js.map} +1 -1
- package/dist/contract/cli/feedback.take.get.d.ts +18 -0
- package/dist/contract/cli/feedback.take.get.js +71 -0
- package/dist/contract/cli/feedback.take.get.js.map +1 -0
- package/dist/contract/cli/feedback.take.set.d.ts +17 -0
- package/dist/contract/cli/feedback.take.set.js +77 -0
- package/dist/contract/cli/feedback.take.set.js.map +1 -0
- package/dist/domain.operations/behavior/feedback/asFeedbackTakenPath.d.ts +9 -0
- package/dist/domain.operations/behavior/feedback/asFeedbackTakenPath.js +16 -0
- package/dist/domain.operations/behavior/feedback/asFeedbackTakenPath.js.map +1 -0
- package/dist/domain.operations/behavior/feedback/asFeedbackVersionFromFilename.d.ts +8 -0
- package/dist/domain.operations/behavior/feedback/asFeedbackVersionFromFilename.js +25 -0
- package/dist/domain.operations/behavior/feedback/asFeedbackVersionFromFilename.js.map +1 -0
- package/dist/domain.operations/behavior/feedback/computeFeedbackHash.d.ts +7 -0
- package/dist/domain.operations/behavior/feedback/computeFeedbackHash.js +13 -0
- package/dist/domain.operations/behavior/feedback/computeFeedbackHash.js.map +1 -0
- package/dist/domain.operations/behavior/feedback/{giveFeedback.d.ts → feedbackGive.d.ts} +1 -1
- package/dist/domain.operations/behavior/feedback/{giveFeedback.js → feedbackGive.js} +9 -6
- package/dist/domain.operations/behavior/feedback/feedbackGive.js.map +1 -0
- package/dist/domain.operations/behavior/feedback/feedbackTakeGet.d.ts +25 -0
- package/dist/domain.operations/behavior/feedback/feedbackTakeGet.js +40 -0
- package/dist/domain.operations/behavior/feedback/feedbackTakeGet.js.map +1 -0
- package/dist/domain.operations/behavior/feedback/feedbackTakeSet.d.ts +12 -0
- package/dist/domain.operations/behavior/feedback/feedbackTakeSet.js +39 -0
- package/dist/domain.operations/behavior/feedback/feedbackTakeSet.js.map +1 -0
- package/dist/domain.operations/behavior/feedback/getAllFeedbackForBehavior.d.ts +11 -0
- package/dist/domain.operations/behavior/feedback/getAllFeedbackForBehavior.js +46 -0
- package/dist/domain.operations/behavior/feedback/getAllFeedbackForBehavior.js.map +1 -0
- package/dist/domain.operations/behavior/feedback/getAllFeedbackVersionsForArtifact.d.ts +8 -0
- package/dist/domain.operations/behavior/feedback/getAllFeedbackVersionsForArtifact.js +23 -0
- package/dist/domain.operations/behavior/feedback/getAllFeedbackVersionsForArtifact.js.map +1 -0
- package/dist/domain.operations/behavior/feedback/getFeedbackStatus.d.ts +17 -0
- package/dist/domain.operations/behavior/feedback/getFeedbackStatus.js +42 -0
- package/dist/domain.operations/behavior/feedback/getFeedbackStatus.js.map +1 -0
- package/dist/domain.operations/behavior/feedback/getLatestFeedbackVersion.js +15 -26
- package/dist/domain.operations/behavior/feedback/getLatestFeedbackVersion.js.map +1 -1
- package/dist/domain.operations/behavior/feedback/validateFeedbackTakePaths.d.ts +10 -0
- package/dist/domain.operations/behavior/feedback/validateFeedbackTakePaths.js +36 -0
- package/dist/domain.operations/behavior/feedback/validateFeedbackTakePaths.js.map +1 -0
- package/dist/domain.operations/behavior/init/getAllTemplatesBySize.d.ts +2 -2
- package/dist/domain.operations/behavior/init/getAllTemplatesBySize.js +3 -2
- package/dist/domain.operations/behavior/init/getAllTemplatesBySize.js.map +1 -1
- package/dist/domain.operations/behavior/init/templates/3.1.1.research.external.product.flagged._.stone +49 -0
- package/dist/domain.operations/behavior/init/templates/3.3.1.blueprint.product.guard.heavy +105 -20
- package/dist/domain.operations/behavior/init/templates/3.3.1.blueprint.product.guard.light +105 -20
- package/dist/domain.operations/behavior/init/templates/3.3.1.blueprint.product.stone +1 -0
- package/dist/domain.operations/behavior/render/computeFeedbackOutput.d.ts +1 -0
- package/dist/domain.operations/behavior/render/computeFeedbackOutput.js +2 -1
- package/dist/domain.operations/behavior/render/computeFeedbackOutput.js.map +1 -1
- package/dist/domain.operations/behavior/render/computeFeedbackTakeGetOutput.d.ts +10 -0
- package/dist/domain.operations/behavior/render/computeFeedbackTakeGetOutput.js +84 -0
- package/dist/domain.operations/behavior/render/computeFeedbackTakeGetOutput.js.map +1 -0
- package/dist/domain.roles/behaver/skills/feedback.give.sh +57 -0
- package/dist/domain.roles/behaver/skills/feedback.take.get.sh +45 -0
- package/dist/domain.roles/behaver/skills/feedback.take.set.sh +44 -0
- package/dist/domain.roles/behaver/skills/give.feedback.sh +4 -57
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/dist/domain.operations/behavior/feedback/giveFeedback.js.map +0 -1
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
* - findsert: if feedback exists, open it
|
|
20
20
|
*/
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.
|
|
22
|
+
exports.feedbackGive = void 0;
|
|
23
23
|
const path_1 = require("path");
|
|
24
24
|
const zod_1 = require("zod");
|
|
25
|
-
const
|
|
25
|
+
const feedbackGive_1 = require("../../domain.operations/behavior/feedback/feedbackGive");
|
|
26
26
|
const computeFeedbackOutput_1 = require("../../domain.operations/behavior/render/computeFeedbackOutput");
|
|
27
27
|
const cli_1 = require("../../infra/cli");
|
|
28
28
|
const OpenerUnavailableError_1 = require("../../infra/shell/OpenerUnavailableError");
|
|
@@ -50,7 +50,7 @@ const schemaOfArgs = zod_1.z.object({
|
|
|
50
50
|
// ────────────────────────────────────────────────────────────────────
|
|
51
51
|
// exported CLI entry point
|
|
52
52
|
// ────────────────────────────────────────────────────────────────────
|
|
53
|
-
const
|
|
53
|
+
const feedbackGive = () => {
|
|
54
54
|
const { named } = (0, cli_1.getCliArgs)({ schema: schemaOfArgs });
|
|
55
55
|
const context = { cwd: process.cwd() };
|
|
56
56
|
// validate --open has a value if provided
|
|
@@ -65,7 +65,7 @@ const giveFeedback = () => {
|
|
|
65
65
|
process.exit(1);
|
|
66
66
|
}
|
|
67
67
|
// create or find feedback file
|
|
68
|
-
const result = (0,
|
|
68
|
+
const result = (0, feedbackGive_1.feedbackGive)({
|
|
69
69
|
against: named.against,
|
|
70
70
|
behavior: named.behavior,
|
|
71
71
|
version: named.version,
|
|
@@ -94,9 +94,10 @@ const giveFeedback = () => {
|
|
|
94
94
|
// render output
|
|
95
95
|
const output = (0, computeFeedbackOutput_1.computeFeedbackOutput)({
|
|
96
96
|
feedbackFilename,
|
|
97
|
+
artifact: named.against,
|
|
97
98
|
opener: openerUsed,
|
|
98
99
|
});
|
|
99
100
|
console.log(output);
|
|
100
101
|
};
|
|
101
|
-
exports.
|
|
102
|
-
//# sourceMappingURL=give.
|
|
102
|
+
exports.feedbackGive = feedbackGive;
|
|
103
|
+
//# sourceMappingURL=feedback.give.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"give.
|
|
1
|
+
{"version":3,"file":"feedback.give.js","sourceRoot":"","sources":["../../../src/contract/cli/feedback.give.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAEH,+BAAgC;AAChC,6BAAwB;AAExB,wFAAuG;AACvG,wGAAqG;AACrG,wCAA4C;AAC5C,oFAAiF;AACjF,4EAAyE;AAEzE,uEAAuE;AACvE,SAAS;AACT,uEAAuE;AAEvE,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5B,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC;QACd,sBAAsB;QACtB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;QACnB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC/B,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,CAAC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AAU;KACnB,CAAC,CAAC;IACH,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC,CAAC;AAtDW,QAAA,YAAY,gBAsDvB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .what = list all feedback for a behavior with their response status
|
|
3
|
+
*
|
|
4
|
+
* .why = enables clones to see what feedback needs response
|
|
5
|
+
* - normal mode: list all feedback with status
|
|
6
|
+
* - hook.onStop mode: exit 2 if unresponded feedback exists
|
|
7
|
+
*
|
|
8
|
+
* usage:
|
|
9
|
+
* feedback.take.get.sh # list all feedback
|
|
10
|
+
* feedback.take.get.sh --behavior <name> # explicit behavior
|
|
11
|
+
* feedback.take.get.sh --when hook.onStop # exit 2 if unresponded
|
|
12
|
+
*
|
|
13
|
+
* guarantee:
|
|
14
|
+
* - fail-fast if behavior not found (unless --force)
|
|
15
|
+
* - exit 0 if all feedback responded
|
|
16
|
+
* - exit 2 if unresponded feedback in hook.onStop mode
|
|
17
|
+
*/
|
|
18
|
+
export declare const feedbackTakeGet: () => void;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* .what = list all feedback for a behavior with their response status
|
|
4
|
+
*
|
|
5
|
+
* .why = enables clones to see what feedback needs response
|
|
6
|
+
* - normal mode: list all feedback with status
|
|
7
|
+
* - hook.onStop mode: exit 2 if unresponded feedback exists
|
|
8
|
+
*
|
|
9
|
+
* usage:
|
|
10
|
+
* feedback.take.get.sh # list all feedback
|
|
11
|
+
* feedback.take.get.sh --behavior <name> # explicit behavior
|
|
12
|
+
* feedback.take.get.sh --when hook.onStop # exit 2 if unresponded
|
|
13
|
+
*
|
|
14
|
+
* guarantee:
|
|
15
|
+
* - fail-fast if behavior not found (unless --force)
|
|
16
|
+
* - exit 0 if all feedback responded
|
|
17
|
+
* - exit 2 if unresponded feedback in hook.onStop mode
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.feedbackTakeGet = void 0;
|
|
21
|
+
const zod_1 = require("zod");
|
|
22
|
+
const feedbackTakeGet_1 = require("../../domain.operations/behavior/feedback/feedbackTakeGet");
|
|
23
|
+
const computeFeedbackTakeGetOutput_1 = require("../../domain.operations/behavior/render/computeFeedbackTakeGetOutput");
|
|
24
|
+
const cli_1 = require("../../infra/cli");
|
|
25
|
+
const node_path_1 = require("node:path");
|
|
26
|
+
// ────────────────────────────────────────────────────────────────────
|
|
27
|
+
// schema
|
|
28
|
+
// ────────────────────────────────────────────────────────────────────
|
|
29
|
+
const schemaOfArgs = zod_1.z.object({
|
|
30
|
+
named: zod_1.z.object({
|
|
31
|
+
// skill-specific args
|
|
32
|
+
behavior: zod_1.z.string().optional(),
|
|
33
|
+
when: zod_1.z.enum(['hook.onStop']).optional(),
|
|
34
|
+
force: zod_1.z.boolean().optional(),
|
|
35
|
+
// rhachet passthrough args (optional, ignored)
|
|
36
|
+
repo: zod_1.z.string().optional(),
|
|
37
|
+
role: zod_1.z.string().optional(),
|
|
38
|
+
skill: zod_1.z.string().optional(),
|
|
39
|
+
s: zod_1.z.string().optional(),
|
|
40
|
+
}),
|
|
41
|
+
ordered: zod_1.z.array(zod_1.z.string()).default([]),
|
|
42
|
+
});
|
|
43
|
+
// ────────────────────────────────────────────────────────────────────
|
|
44
|
+
// exported CLI entry point
|
|
45
|
+
// ────────────────────────────────────────────────────────────────────
|
|
46
|
+
const feedbackTakeGet = () => {
|
|
47
|
+
const { named } = (0, cli_1.getCliArgs)({ schema: schemaOfArgs });
|
|
48
|
+
const context = { cwd: process.cwd() };
|
|
49
|
+
// get feedback status
|
|
50
|
+
const result = (0, feedbackTakeGet_1.feedbackTakeGet)({
|
|
51
|
+
behavior: named.behavior,
|
|
52
|
+
force: named.force,
|
|
53
|
+
}, context);
|
|
54
|
+
// determine mode
|
|
55
|
+
const mode = named.when === 'hook.onStop' ? 'hook.onStop' : 'list';
|
|
56
|
+
// render output (null = silent per vision for hook.onStop passed)
|
|
57
|
+
const behavior = (0, node_path_1.basename)(result.behaviorDir);
|
|
58
|
+
const output = (0, computeFeedbackTakeGetOutput_1.computeFeedbackTakeGetOutput)({ result, mode, behavior });
|
|
59
|
+
if (output !== null) {
|
|
60
|
+
console.log(output);
|
|
61
|
+
}
|
|
62
|
+
// exit 2 if hook.onStop mode and unresponded feedback exists
|
|
63
|
+
if (mode === 'hook.onStop') {
|
|
64
|
+
const openCount = result.unresponded + result.stale;
|
|
65
|
+
if (openCount > 0) {
|
|
66
|
+
process.exit(2);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
exports.feedbackTakeGet = feedbackTakeGet;
|
|
71
|
+
//# sourceMappingURL=feedback.take.get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback.take.get.js","sourceRoot":"","sources":["../../../src/contract/cli/feedback.take.get.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,6BAAwB;AAExB,8FAAgH;AAChH,sHAAmH;AACnH,wCAA4C;AAE5C,yCAAqC;AAErC,uEAAuE;AACvE,SAAS;AACT,uEAAuE;AAEvE,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5B,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC;QACd,sBAAsB;QACtB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC/B,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,EAAE;QACxC,KAAK,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;QAC7B,+CAA+C;QAC/C,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC3B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC3B,KAAK,EAAE,OAAC,CA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CAAC;YAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;AACH,CAAC,CAAC;AA9BW,QAAA,eAAe,mBA8B1B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .what = record a feedback response with hash verification
|
|
3
|
+
*
|
|
4
|
+
* .why = enables clones to mark feedback as responded
|
|
5
|
+
* - validates path consistency
|
|
6
|
+
* - stores hash for stale detection
|
|
7
|
+
*
|
|
8
|
+
* usage:
|
|
9
|
+
* feedback.take.set.sh --from <given> --into <taken> --response <text>
|
|
10
|
+
* feedback.take.set.sh --from <given> --into <taken> --response @stdin
|
|
11
|
+
*
|
|
12
|
+
* guarantee:
|
|
13
|
+
* - fail-fast if paths are invalid
|
|
14
|
+
* - fail-fast if [given] file not found
|
|
15
|
+
* - writes [taken] file with givenHash in frontmatter
|
|
16
|
+
*/
|
|
17
|
+
export declare const feedbackTakeSet: () => void;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* .what = record a feedback response with hash verification
|
|
4
|
+
*
|
|
5
|
+
* .why = enables clones to mark feedback as responded
|
|
6
|
+
* - validates path consistency
|
|
7
|
+
* - stores hash for stale detection
|
|
8
|
+
*
|
|
9
|
+
* usage:
|
|
10
|
+
* feedback.take.set.sh --from <given> --into <taken> --response <text>
|
|
11
|
+
* feedback.take.set.sh --from <given> --into <taken> --response @stdin
|
|
12
|
+
*
|
|
13
|
+
* guarantee:
|
|
14
|
+
* - fail-fast if paths are invalid
|
|
15
|
+
* - fail-fast if [given] file not found
|
|
16
|
+
* - writes [taken] file with givenHash in frontmatter
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.feedbackTakeSet = void 0;
|
|
20
|
+
const fs_1 = require("fs");
|
|
21
|
+
const path_1 = require("path");
|
|
22
|
+
const zod_1 = require("zod");
|
|
23
|
+
const feedbackTakeSet_1 = require("../../domain.operations/behavior/feedback/feedbackTakeSet");
|
|
24
|
+
const cli_1 = require("../../infra/cli");
|
|
25
|
+
// ────────────────────────────────────────────────────────────────────
|
|
26
|
+
// schema
|
|
27
|
+
// ────────────────────────────────────────────────────────────────────
|
|
28
|
+
const schemaOfArgs = zod_1.z.object({
|
|
29
|
+
named: zod_1.z.object({
|
|
30
|
+
// skill-specific args
|
|
31
|
+
from: zod_1.z.string(),
|
|
32
|
+
into: zod_1.z.string(),
|
|
33
|
+
response: zod_1.z.string(),
|
|
34
|
+
// rhachet passthrough args (optional, ignored)
|
|
35
|
+
repo: zod_1.z.string().optional(),
|
|
36
|
+
role: zod_1.z.string().optional(),
|
|
37
|
+
skill: zod_1.z.string().optional(),
|
|
38
|
+
s: zod_1.z.string().optional(),
|
|
39
|
+
}),
|
|
40
|
+
ordered: zod_1.z.array(zod_1.z.string()).default([]),
|
|
41
|
+
});
|
|
42
|
+
// ────────────────────────────────────────────────────────────────────
|
|
43
|
+
// exported CLI entry point
|
|
44
|
+
// ────────────────────────────────────────────────────────────────────
|
|
45
|
+
const feedbackTakeSet = () => {
|
|
46
|
+
const { named } = (0, cli_1.getCliArgs)({ schema: schemaOfArgs });
|
|
47
|
+
// handle @stdin for response
|
|
48
|
+
let response;
|
|
49
|
+
if (named.response === '@stdin') {
|
|
50
|
+
response = (0, fs_1.readFileSync)(0, 'utf-8').trim();
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
response = named.response;
|
|
54
|
+
}
|
|
55
|
+
// set feedback response
|
|
56
|
+
const result = (0, feedbackTakeSet_1.feedbackTakeSet)({
|
|
57
|
+
fromPath: named.from,
|
|
58
|
+
intoPath: named.into,
|
|
59
|
+
response,
|
|
60
|
+
});
|
|
61
|
+
// render output
|
|
62
|
+
const dim = '\x1b[2m';
|
|
63
|
+
const reset = '\x1b[0m';
|
|
64
|
+
const green = '\x1b[32m';
|
|
65
|
+
const givenFilename = (0, path_1.basename)(named.from);
|
|
66
|
+
const takenFilename = (0, path_1.basename)(result.takenPath);
|
|
67
|
+
const lines = [
|
|
68
|
+
`🦫 mkurrr,`,
|
|
69
|
+
'', // blank line between mascot and artifact
|
|
70
|
+
`🌲 feedback.take.set --from ${givenFilename} --into ${takenFilename}`,
|
|
71
|
+
` ├─ ${green}✓${reset} ${takenFilename}`,
|
|
72
|
+
` └─ ${dim}hash: ${result.givenHash.slice(0, 8)}...${reset}`,
|
|
73
|
+
];
|
|
74
|
+
console.log(lines.join('\n'));
|
|
75
|
+
};
|
|
76
|
+
exports.feedbackTakeSet = feedbackTakeSet;
|
|
77
|
+
//# sourceMappingURL=feedback.take.set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedback.take.set.js","sourceRoot":"","sources":["../../../src/contract/cli/feedback.take.set.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH,2BAAkC;AAClC,+BAAgC;AAChC,6BAAwB;AAExB,8FAAgH;AAChH,wCAA4C;AAE5C,uEAAuE;AACvE,SAAS;AACT,uEAAuE;AAEvE,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5B,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC;QACd,sBAAsB;QACtB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;QAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;QAChB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;QACpB,+CAA+C;QAC/C,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC3B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC3B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5B,CAAC,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KACzB,CAAC;IACF,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,OA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AAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AAChC,CAAC,CAAC;AAlCW,QAAA,eAAe,mBAkC1B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .what = derive [taken] path from [given] path
|
|
3
|
+
* .why = ensures consistent path derivation for feedback response files
|
|
4
|
+
*
|
|
5
|
+
* .note = replaces [given] → [taken] and by_human → by_robot
|
|
6
|
+
*/
|
|
7
|
+
export declare const asFeedbackTakenPath: (input: {
|
|
8
|
+
givenPath: string;
|
|
9
|
+
}) => string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.asFeedbackTakenPath = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* .what = derive [taken] path from [given] path
|
|
6
|
+
* .why = ensures consistent path derivation for feedback response files
|
|
7
|
+
*
|
|
8
|
+
* .note = replaces [given] → [taken] and by_human → by_robot
|
|
9
|
+
*/
|
|
10
|
+
const asFeedbackTakenPath = (input) => {
|
|
11
|
+
return input.givenPath
|
|
12
|
+
.replace('[given]', '[taken]')
|
|
13
|
+
.replace('by_human', 'by_robot');
|
|
14
|
+
};
|
|
15
|
+
exports.asFeedbackTakenPath = asFeedbackTakenPath;
|
|
16
|
+
//# sourceMappingURL=asFeedbackTakenPath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asFeedbackTakenPath.js","sourceRoot":"","sources":["../../../../src/domain.operations/behavior/feedback/asFeedbackTakenPath.ts"],"names":[],"mappings":";;;AAAA;;;;;GAKG;AACI,MAAM,mBAAmB,GAAG,CAAC,KAA4B,EAAU,EAAE;IAC1E,OAAO,KAAK,CAAC,SAAS;SACnB,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC;SAC7B,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AACrC,CAAC,CAAC;AAJW,QAAA,mBAAmB,uBAI9B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .what = extract feedback version number from a filename
|
|
3
|
+
* .why = encapsulates regex pattern for feedback file name convention
|
|
4
|
+
*/
|
|
5
|
+
export declare const asFeedbackVersionFromFilename: (input: {
|
|
6
|
+
filename: string;
|
|
7
|
+
artifactFileName: string;
|
|
8
|
+
}) => number | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.asFeedbackVersionFromFilename = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* .what = extract feedback version number from a filename
|
|
6
|
+
* .why = encapsulates regex pattern for feedback file name convention
|
|
7
|
+
*/
|
|
8
|
+
const asFeedbackVersionFromFilename = (input) => {
|
|
9
|
+
// escape special regex characters in artifact name
|
|
10
|
+
const escaped = input.artifactFileName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
11
|
+
// pattern: {artifactFileName}.[feedback].v{N}.[given].by_human.md
|
|
12
|
+
const pattern = new RegExp(`^${escaped}\\.\\[feedback\\]\\.v(\\d+)\\.`);
|
|
13
|
+
// extract version from match
|
|
14
|
+
const match = input.filename.match(pattern);
|
|
15
|
+
if (!match)
|
|
16
|
+
return null;
|
|
17
|
+
// parse version number
|
|
18
|
+
const versionStr = match[1];
|
|
19
|
+
if (versionStr === undefined)
|
|
20
|
+
return null;
|
|
21
|
+
const version = parseInt(versionStr, 10);
|
|
22
|
+
return isNaN(version) ? null : version;
|
|
23
|
+
};
|
|
24
|
+
exports.asFeedbackVersionFromFilename = asFeedbackVersionFromFilename;
|
|
25
|
+
//# sourceMappingURL=asFeedbackVersionFromFilename.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asFeedbackVersionFromFilename.js","sourceRoot":"","sources":["../../../../src/domain.operations/behavior/feedback/asFeedbackVersionFromFilename.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACI,MAAM,6BAA6B,GAAG,CAAC,KAG7C,EAAiB,EAAE;IAClB,mDAAmD;IACnD,MAAM,OAAO,GAAG,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;IAE9E,kEAAkE;IAClE,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,IAAI,OAAO,gCAAgC,CAAC,CAAC;IAExE,6BAA6B;IAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC5C,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,uBAAuB;IACvB,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,UAAU,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAE1C,MAAM,OAAO,GAAG,QAAQ,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IACzC,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;AACzC,CAAC,CAAC;AApBW,QAAA,6BAA6B,iCAoBxC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.computeFeedbackHash = void 0;
|
|
4
|
+
const crypto_1 = require("crypto");
|
|
5
|
+
/**
|
|
6
|
+
* .what = compute sha256 hash of feedback file content
|
|
7
|
+
* .why = enables hash-based verification that [taken] response matches [given] content
|
|
8
|
+
*/
|
|
9
|
+
const computeFeedbackHash = (input) => {
|
|
10
|
+
return (0, crypto_1.createHash)('sha256').update(input.content).digest('hex');
|
|
11
|
+
};
|
|
12
|
+
exports.computeFeedbackHash = computeFeedbackHash;
|
|
13
|
+
//# sourceMappingURL=computeFeedbackHash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeFeedbackHash.js","sourceRoot":"","sources":["../../../../src/domain.operations/behavior/feedback/computeFeedbackHash.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AAEpC;;;GAGG;AACI,MAAM,mBAAmB,GAAG,CAAC,KAA0B,EAAU,EAAE;IACxE,OAAO,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAClE,CAAC,CAAC;AAFW,QAAA,mBAAmB,uBAE9B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.feedbackGive = void 0;
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const helpful_errors_1 = require("helpful-errors");
|
|
6
6
|
const path_1 = require("path");
|
|
@@ -15,7 +15,7 @@ const initFeedbackTemplate_1 = require("./initFeedbackTemplate");
|
|
|
15
15
|
*
|
|
16
16
|
* .note = findsert behavior: if feedback exists, returns it instead of throw
|
|
17
17
|
*/
|
|
18
|
-
const
|
|
18
|
+
const feedbackGive = (input, context) => {
|
|
19
19
|
// get behavior directory
|
|
20
20
|
const behaviorDir = (0, getBehaviorDirForFeedback_1.getBehaviorDirForFeedback)({
|
|
21
21
|
behavior: input.behavior,
|
|
@@ -42,12 +42,13 @@ const giveFeedback = (input, context) => {
|
|
|
42
42
|
// undefined → use latest (or 1 if none)
|
|
43
43
|
return latestVersion ?? 1;
|
|
44
44
|
})();
|
|
45
|
-
// compute feedback filename
|
|
45
|
+
// compute feedback filename and path in feedback/ subdir
|
|
46
46
|
const feedbackFilename = (0, computeBehaviorFeedbackName_1.computeBehaviorFeedbackName)({
|
|
47
47
|
artifactFileName: artifact.filename,
|
|
48
48
|
feedbackVersion,
|
|
49
49
|
});
|
|
50
|
-
const
|
|
50
|
+
const feedbackDir = (0, path_1.join)(behaviorDir, 'feedback');
|
|
51
|
+
const feedbackPath = (0, path_1.join)(feedbackDir, feedbackFilename);
|
|
51
52
|
// findsert: if feedback file exists, return it
|
|
52
53
|
if ((0, fs_1.existsSync)(feedbackPath)) {
|
|
53
54
|
return {
|
|
@@ -65,6 +66,8 @@ const giveFeedback = (input, context) => {
|
|
|
65
66
|
}
|
|
66
67
|
// compute relative behavior directory path
|
|
67
68
|
const behaviorDirRel = (0, path_1.relative)(context.cwd, behaviorDir);
|
|
69
|
+
// ensure feedback/ subdir exists
|
|
70
|
+
(0, fs_1.mkdirSync)(feedbackDir, { recursive: true });
|
|
68
71
|
// init feedback file from template
|
|
69
72
|
(0, initFeedbackTemplate_1.initFeedbackTemplate)({
|
|
70
73
|
templatePath,
|
|
@@ -80,5 +83,5 @@ const giveFeedback = (input, context) => {
|
|
|
80
83
|
created: true,
|
|
81
84
|
};
|
|
82
85
|
};
|
|
83
|
-
exports.
|
|
84
|
-
//# sourceMappingURL=
|
|
86
|
+
exports.feedbackGive = feedbackGive;
|
|
87
|
+
//# sourceMappingURL=feedbackGive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedbackGive.js","sourceRoot":"","sources":["../../../../src/domain.operations/behavior/feedback/feedbackGive.ts"],"names":[],"mappings":";;;AAAA,2BAA2C;AAC3C,mDAAiD;AACjD,+BAAsC;AAEtC,+EAA4E;AAC5E,2EAAwE;AACxE,uEAAoE;AACpE,yEAAsE;AACtE,iEAA8D;AAE9D;;;;;GAKG;AACI,MAAM,YAAY,GAAG,CAC1B,KAOC,EACD,OAAwB,EAMxB,EAAE;IACF,yBAAyB;IACzB,MAAM,WAAW,GAAG,IAAA,qDAAyB,EAC3C;QACE,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,SAAS,EAAE,KAAK,CAAC,SAAS;KAC3B,EACD,OAAO,CACR,CAAC;IAEF,uBAAuB;IACvB,MAAM,QAAQ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GAChB,KAAK,CAAC,QAAQ;QACd,IAAA,WAAI,EAAC,WAAW,EAAE,iDAAiD,CAAC,CAAC;IACvE,IAAI,CAAC,IAAA,eAAU,EAAC,YAAY,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,gCAAe,CAAC,uBAAuB,YAAY,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,2CAA2C;IAC3C,MAAM,cAAc,GAAG,IAAA,eAAQ,EAAC,OAAO,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAE1D,iCAAiC;IACjC,IAAA,cAAS,EAAC,WAAW,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE5C,mCAAmC;IACnC,IAAA,2CAAoB,EAAC;QACnB,YAAY;QACZ,UAAU,EAAE,YAAY;QACxB,gBAAgB,EAAE,QAAQ,CAAC,QAAQ;QACnC,cAAc;QACd,eAAe;KAChB,CAAC,CAAC;IAEH,OAAO;QACL,YAAY,EAAE,YAAY;QAC1B,YAAY,EAAE,QAAQ,CAAC,IAAI;QAC3B,WAAW;QACX,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC,CAAC;AApGW,QAAA,YAAY,gBAoGvB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type FeedbackStatus } from './getFeedbackStatus';
|
|
2
|
+
export type FeedbackTakeGetResult = {
|
|
3
|
+
behaviorDir: string;
|
|
4
|
+
feedback: {
|
|
5
|
+
givenPath: string;
|
|
6
|
+
givenPathRel: string;
|
|
7
|
+
artifactFileName: string;
|
|
8
|
+
feedbackVersion: number;
|
|
9
|
+
status: FeedbackStatus;
|
|
10
|
+
}[];
|
|
11
|
+
unresponded: number;
|
|
12
|
+
responded: number;
|
|
13
|
+
stale: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* .what = list all feedback for a behavior with their response status
|
|
17
|
+
* .why = enables clones to see what feedback needs response
|
|
18
|
+
*/
|
|
19
|
+
export declare const feedbackTakeGet: (input: {
|
|
20
|
+
behavior?: string;
|
|
21
|
+
force?: boolean;
|
|
22
|
+
targetDir?: string;
|
|
23
|
+
}, context: {
|
|
24
|
+
cwd: string;
|
|
25
|
+
}) => FeedbackTakeGetResult;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.feedbackTakeGet = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const getAllFeedbackForBehavior_1 = require("./getAllFeedbackForBehavior");
|
|
6
|
+
const getBehaviorDirForFeedback_1 = require("./getBehaviorDirForFeedback");
|
|
7
|
+
const getFeedbackStatus_1 = require("./getFeedbackStatus");
|
|
8
|
+
/**
|
|
9
|
+
* .what = list all feedback for a behavior with their response status
|
|
10
|
+
* .why = enables clones to see what feedback needs response
|
|
11
|
+
*/
|
|
12
|
+
const feedbackTakeGet = (input, context) => {
|
|
13
|
+
// get behavior directory
|
|
14
|
+
const behaviorDir = (0, getBehaviorDirForFeedback_1.getBehaviorDirForFeedback)({
|
|
15
|
+
behavior: input.behavior,
|
|
16
|
+
force: input.force,
|
|
17
|
+
targetDir: input.targetDir,
|
|
18
|
+
}, context);
|
|
19
|
+
// get all feedback files
|
|
20
|
+
const allFeedback = (0, getAllFeedbackForBehavior_1.getAllFeedbackForBehavior)({ behaviorDir });
|
|
21
|
+
// get status for each feedback file
|
|
22
|
+
const feedbackWithStatus = allFeedback.map((fb) => ({
|
|
23
|
+
...fb,
|
|
24
|
+
givenPathRel: (0, path_1.relative)(context.cwd, fb.givenPath),
|
|
25
|
+
status: (0, getFeedbackStatus_1.getFeedbackStatus)({ givenPath: fb.givenPath }),
|
|
26
|
+
}));
|
|
27
|
+
// count by status
|
|
28
|
+
const unresponded = feedbackWithStatus.filter((fb) => fb.status.status === 'unresponded').length;
|
|
29
|
+
const responded = feedbackWithStatus.filter((fb) => fb.status.status === 'responded').length;
|
|
30
|
+
const stale = feedbackWithStatus.filter((fb) => fb.status.status === 'stale').length;
|
|
31
|
+
return {
|
|
32
|
+
behaviorDir,
|
|
33
|
+
feedback: feedbackWithStatus,
|
|
34
|
+
unresponded,
|
|
35
|
+
responded,
|
|
36
|
+
stale,
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
exports.feedbackTakeGet = feedbackTakeGet;
|
|
40
|
+
//# sourceMappingURL=feedbackTakeGet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedbackTakeGet.js","sourceRoot":"","sources":["../../../../src/domain.operations/behavior/feedback/feedbackTakeGet.ts"],"names":[],"mappings":";;;AAAA,+BAAgC;AAEhC,2EAAwE;AACxE,2EAAwE;AACxE,2DAA6E;AAgB7E;;;GAGG;AACI,MAAM,eAAe,GAAG,CAC7B,KAIC,EACD,OAAwB,EACD,EAAE;IACzB,yBAAyB;IACzB,MAAM,WAAW,GAAG,IAAA,qDAAyB,EAC3C;QACE,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,SAAS,EAAE,KAAK,CAAC,SAAS;KAC3B,EACD,OAAO,CACR,CAAC;IAEF,yBAAyB;IACzB,MAAM,WAAW,GAAG,IAAA,qDAAyB,EAAC,EAAE,WAAW,EAAE,CAAC,CAAC;IAE/D,oCAAoC;IACpC,MAAM,kBAAkB,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAClD,GAAG,EAAE;QACL,YAAY,EAAE,IAAA,eAAQ,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC;QACjD,MAAM,EAAE,IAAA,qCAAiB,EAAC,EAAE,SAAS,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC;KACvD,CAAC,CAAC,CAAC;IAEJ,kBAAkB;IAClB,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAM,CAC3C,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,KAAK,aAAa,CAC3C,CAAC,MAAM,CAAC;IACT,MAAM,SAAS,GAAG,kBAAkB,CAAC,MAAM,CACzC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,KAAK,WAAW,CACzC,CAAC,MAAM,CAAC;IACT,MAAM,KAAK,GAAG,kBAAkB,CAAC,MAAM,CACrC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,KAAK,OAAO,CACrC,CAAC,MAAM,CAAC;IAET,OAAO;QACL,WAAW;QACX,QAAQ,EAAE,kBAAkB;QAC5B,WAAW;QACX,SAAS;QACT,KAAK;KACN,CAAC;AACJ,CAAC,CAAC;AA9CW,QAAA,eAAe,mBA8C1B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .what = record a feedback response with hash verification
|
|
3
|
+
* .why = enables clones to mark feedback as responded and verify hash
|
|
4
|
+
*/
|
|
5
|
+
export declare const feedbackTakeSet: (input: {
|
|
6
|
+
fromPath: string;
|
|
7
|
+
intoPath: string;
|
|
8
|
+
response: string;
|
|
9
|
+
}) => {
|
|
10
|
+
takenPath: string;
|
|
11
|
+
givenHash: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.feedbackTakeSet = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const helpful_errors_1 = require("helpful-errors");
|
|
6
|
+
const computeFeedbackHash_1 = require("./computeFeedbackHash");
|
|
7
|
+
const validateFeedbackTakePaths_1 = require("./validateFeedbackTakePaths");
|
|
8
|
+
/**
|
|
9
|
+
* .what = record a feedback response with hash verification
|
|
10
|
+
* .why = enables clones to mark feedback as responded and verify hash
|
|
11
|
+
*/
|
|
12
|
+
const feedbackTakeSet = (input) => {
|
|
13
|
+
// validate paths
|
|
14
|
+
(0, validateFeedbackTakePaths_1.validateFeedbackTakePaths)({
|
|
15
|
+
fromPath: input.fromPath,
|
|
16
|
+
intoPath: input.intoPath,
|
|
17
|
+
});
|
|
18
|
+
// verify [given] file exists
|
|
19
|
+
if (!(0, fs_1.existsSync)(input.fromPath)) {
|
|
20
|
+
throw new helpful_errors_1.BadRequestError(`[given] file not found: ${input.fromPath}`);
|
|
21
|
+
}
|
|
22
|
+
// read [given] content and compute hash
|
|
23
|
+
const givenContent = (0, fs_1.readFileSync)(input.fromPath, 'utf-8');
|
|
24
|
+
const givenHash = (0, computeFeedbackHash_1.computeFeedbackHash)({ content: givenContent });
|
|
25
|
+
// build [taken] content with frontmatter
|
|
26
|
+
const takenContent = `---
|
|
27
|
+
givenHash: ${givenHash}
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
${input.response}`;
|
|
31
|
+
// write [taken] file
|
|
32
|
+
(0, fs_1.writeFileSync)(input.intoPath, takenContent);
|
|
33
|
+
return {
|
|
34
|
+
takenPath: input.intoPath,
|
|
35
|
+
givenHash,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
exports.feedbackTakeSet = feedbackTakeSet;
|
|
39
|
+
//# sourceMappingURL=feedbackTakeSet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feedbackTakeSet.js","sourceRoot":"","sources":["../../../../src/domain.operations/behavior/feedback/feedbackTakeSet.ts"],"names":[],"mappings":";;;AAAA,2BAA6D;AAC7D,mDAAiD;AAEjD,+DAA4D;AAC5D,2EAAwE;AAExE;;;GAGG;AACI,MAAM,eAAe,GAAG,CAAC,KAI/B,EAGC,EAAE;IACF,iBAAiB;IACjB,IAAA,qDAAyB,EAAC;QACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,QAAQ,EAAE,KAAK,CAAC,QAAQ;KACzB,CAAC,CAAC;IAEH,6BAA6B;IAC7B,IAAI,CAAC,IAAA,eAAU,EAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,gCAAe,CAAC,2BAA2B,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,wCAAwC;IACxC,MAAM,YAAY,GAAG,IAAA,iBAAY,EAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC3D,MAAM,SAAS,GAAG,IAAA,yCAAmB,EAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;IAEjE,yCAAyC;IACzC,MAAM,YAAY,GAAG;aACV,SAAS;;;EAGpB,KAAK,CAAC,QAAQ,EAAE,CAAC;IAEjB,qBAAqB;IACrB,IAAA,kBAAa,EAAC,KAAK,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAE5C,OAAO;QACL,SAAS,EAAE,KAAK,CAAC,QAAQ;QACzB,SAAS;KACV,CAAC;AACJ,CAAC,CAAC;AArCW,QAAA,eAAe,mBAqC1B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .what = discover all [given] feedback files in a behavior directory
|
|
3
|
+
* .why = enables feedback.take.get to list all feedback and their status
|
|
4
|
+
*/
|
|
5
|
+
export declare const getAllFeedbackForBehavior: (input: {
|
|
6
|
+
behaviorDir: string;
|
|
7
|
+
}) => {
|
|
8
|
+
givenPath: string;
|
|
9
|
+
artifactFileName: string;
|
|
10
|
+
feedbackVersion: number;
|
|
11
|
+
}[];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAllFeedbackForBehavior = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
/**
|
|
7
|
+
* .what = discover all [given] feedback files in a behavior directory
|
|
8
|
+
* .why = enables feedback.take.get to list all feedback and their status
|
|
9
|
+
*/
|
|
10
|
+
const getAllFeedbackForBehavior = (input) => {
|
|
11
|
+
const feedbackDir = (0, path_1.join)(input.behaviorDir, 'feedback');
|
|
12
|
+
// if feedback dir doesn't exist, no feedback
|
|
13
|
+
if (!(0, fs_1.existsSync)(feedbackDir))
|
|
14
|
+
return [];
|
|
15
|
+
// read directory contents
|
|
16
|
+
const files = (0, fs_1.readdirSync)(feedbackDir);
|
|
17
|
+
// pattern to match [given] feedback files
|
|
18
|
+
// format: {artifactFileName}.[feedback].v{N}.[given].by_human.md
|
|
19
|
+
const givenPattern = /^(.+)\.\[feedback\]\.v(\d+)\.\[given\]\.by_human\.md$/;
|
|
20
|
+
// collect feedback files
|
|
21
|
+
const feedbackFiles = [];
|
|
22
|
+
for (const file of files) {
|
|
23
|
+
const match = file.match(givenPattern);
|
|
24
|
+
if (!match)
|
|
25
|
+
continue;
|
|
26
|
+
const artifactFileName = match[1];
|
|
27
|
+
const feedbackVersion = parseInt(match[2] ?? '', 10);
|
|
28
|
+
if (!artifactFileName || isNaN(feedbackVersion))
|
|
29
|
+
continue;
|
|
30
|
+
feedbackFiles.push({
|
|
31
|
+
givenPath: (0, path_1.join)(feedbackDir, file),
|
|
32
|
+
artifactFileName,
|
|
33
|
+
feedbackVersion,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
// sort by artifact name, then by version (highest first)
|
|
37
|
+
feedbackFiles.sort((a, b) => {
|
|
38
|
+
const nameCompare = a.artifactFileName.localeCompare(b.artifactFileName);
|
|
39
|
+
if (nameCompare !== 0)
|
|
40
|
+
return nameCompare;
|
|
41
|
+
return b.feedbackVersion - a.feedbackVersion;
|
|
42
|
+
});
|
|
43
|
+
return feedbackFiles;
|
|
44
|
+
};
|
|
45
|
+
exports.getAllFeedbackForBehavior = getAllFeedbackForBehavior;
|
|
46
|
+
//# sourceMappingURL=getAllFeedbackForBehavior.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAllFeedbackForBehavior.js","sourceRoot":"","sources":["../../../../src/domain.operations/behavior/feedback/getAllF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AO,WAAW,CAAC;QAC1C,OAAO,CAAC,CAAC,eAAe,GAAG,CAAC,CAAC,eAAe,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AAlDW,QAAA,yBAAyB,6BAkDpC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* .what = extract all feedback versions for an artifact from a list of filenames
|
|
3
|
+
* .why = encapsulates version extraction pipeline for orchestrator readability
|
|
4
|
+
*/
|
|
5
|
+
export declare const getAllFeedbackVersionsForArtifact: (input: {
|
|
6
|
+
filenames: string[];
|
|
7
|
+
artifactFileName: string;
|
|
8
|
+
}) => number[];
|