@webpieces/pr-gate 0.4.835 → 0.4.836
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpieces/pr-gate",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.836",
|
|
4
4
|
"description": "Gated PR system: 3-point squash-merge, merge validation gate, and red/yellow/green PR dashboard. Standalone scripts, no Nx dependency required.",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@inversifyjs/binding-decorators": "1.1.5",
|
|
19
|
-
"@webpieces/
|
|
20
|
-
"@webpieces/rules-config": "0.4.
|
|
19
|
+
"@webpieces/hook-runtime": "0.4.836",
|
|
20
|
+
"@webpieces/rules-config": "0.4.836",
|
|
21
21
|
"inversify": "7.10.4",
|
|
22
22
|
"reflect-metadata": "0.2.2"
|
|
23
23
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AI_TYPE_UNKNOWN, AiType } from '@webpieces/
|
|
1
|
+
import { AI_TYPE_UNKNOWN, AiType } from '@webpieces/hook-runtime';
|
|
2
2
|
/** The coding harness observed by the gate, plus the model the author reported in summary.json. */
|
|
3
3
|
export declare class AuthorIdentity {
|
|
4
4
|
harness: AiType | typeof AI_TYPE_UNKNOWN;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AuthorIdentityResolver = exports.AuthorIdentity = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const hook_runtime_1 = require("@webpieces/hook-runtime");
|
|
6
6
|
const inversify_1 = require("inversify");
|
|
7
7
|
/** The coding harness observed by the gate, plus the model the author reported in summary.json. */
|
|
8
8
|
class AuthorIdentity {
|
|
@@ -25,12 +25,12 @@ let AuthorIdentityResolver = class AuthorIdentityResolver {
|
|
|
25
25
|
resolve(selfReportedModel) {
|
|
26
26
|
const claude = this.present('CLAUDE_CODE_SESSION_ID');
|
|
27
27
|
const codex = this.present('CODEX_SESSION_ID') || this.present('CODEX_THREAD_ID');
|
|
28
|
-
let harness =
|
|
28
|
+
let harness = hook_runtime_1.AI_TYPE_UNKNOWN;
|
|
29
29
|
if (claude !== codex)
|
|
30
30
|
harness = claude ? 'claude-code' : 'codex';
|
|
31
31
|
// Keep this tied to ai-hook-rules' canonical vocabulary rather than growing a second spelling.
|
|
32
|
-
if (harness !==
|
|
33
|
-
harness =
|
|
32
|
+
if (harness !== hook_runtime_1.AI_TYPE_UNKNOWN && !hook_runtime_1.AI_TYPES.includes(harness))
|
|
33
|
+
harness = hook_runtime_1.AI_TYPE_UNKNOWN;
|
|
34
34
|
const model = selfReportedModel.trim() === '' ? 'unknown' : selfReportedModel.trim();
|
|
35
35
|
return new AuthorIdentity(harness, model);
|
|
36
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"author-identity.js","sourceRoot":"","sources":["../../../../../../packages/tooling/pr-gate/src/dashboard/author-identity.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"author-identity.js","sourceRoot":"","sources":["../../../../../../packages/tooling/pr-gate/src/dashboard/author-identity.ts"],"names":[],"mappings":";;;;AAAA,0DAA4E;AAC5E,yCAA2D;AAE3D,mGAAmG;AACnG,MAAa,cAAc;IACvB,OAAO,CAAkC;IACzC,KAAK,CAAS;IAEd,YAAY,OAAwC,EAAE,KAAa;QAC/D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;CACJ;AARD,wCAQC;AAED;;;;;;GAMG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAC/B,OAAO,CAAC,iBAAyB;QAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC;QACtD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;QAClF,IAAI,OAAO,GAAoC,8BAAe,CAAC;QAC/D,IAAI,MAAM,KAAK,KAAK;YAAE,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC;QACjE,+FAA+F;QAC/F,IAAI,OAAO,KAAK,8BAAe,IAAI,CAAC,uBAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC;YAAE,OAAO,GAAG,8BAAe,CAAC;QAC1F,MAAM,KAAK,GAAG,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC;QACrF,OAAO,IAAI,cAAc,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAEO,OAAO,CAAC,IAAY;QACxB,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;IACnD,CAAC;CACJ,CAAA;AAfY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,sBAAU,EAAC,8BAAkB,CAAC,SAAS,CAAC;GAC5B,sBAAsB,CAelC","sourcesContent":["import { AI_TYPES, AI_TYPE_UNKNOWN, AiType } from '@webpieces/hook-runtime';\nimport { injectable, bindingScopeValues } from 'inversify';\n\n/** The coding harness observed by the gate, plus the model the author reported in summary.json. */\nexport class AuthorIdentity {\n harness: AiType | typeof AI_TYPE_UNKNOWN;\n model: string;\n\n constructor(harness: AiType | typeof AI_TYPE_UNKNOWN, model: string) {\n this.harness = harness;\n this.model = model;\n }\n}\n\n/**\n * Resolves the authoring harness from session identifiers supplied by the harness itself.\n *\n * This deliberately does not trust summary.json's `agent` field: that file is AI-authored, while the\n * session variables are supplied by Claude Code / Codex before the model runs. Both-or-neither is\n * `unknown`; silently picking one in an ambiguous process would turn telemetry into a false claim.\n */\n@injectable(bindingScopeValues.Singleton)\nexport class AuthorIdentityResolver {\n resolve(selfReportedModel: string): AuthorIdentity {\n const claude = this.present('CLAUDE_CODE_SESSION_ID');\n const codex = this.present('CODEX_SESSION_ID') || this.present('CODEX_THREAD_ID');\n let harness: AiType | typeof AI_TYPE_UNKNOWN = AI_TYPE_UNKNOWN;\n if (claude !== codex) harness = claude ? 'claude-code' : 'codex';\n // Keep this tied to ai-hook-rules' canonical vocabulary rather than growing a second spelling.\n if (harness !== AI_TYPE_UNKNOWN && !AI_TYPES.includes(harness)) harness = AI_TYPE_UNKNOWN;\n const model = selfReportedModel.trim() === '' ? 'unknown' : selfReportedModel.trim();\n return new AuthorIdentity(harness, model);\n }\n\n private present(name: string): boolean {\n return (process.env[name] ?? '').trim() !== '';\n }\n}\n"]}
|