@aigile/engine 0.2.1 → 0.4.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/dist/action-item-features.d.ts +33 -0
- package/dist/action-item-features.d.ts.map +1 -0
- package/dist/action-item-features.js +113 -0
- package/dist/action-item-features.js.map +1 -0
- package/dist/action-items.d.ts +234 -0
- package/dist/action-items.d.ts.map +1 -0
- package/dist/action-items.js +722 -0
- package/dist/action-items.js.map +1 -0
- package/dist/action-sources.d.ts +44 -0
- package/dist/action-sources.d.ts.map +1 -0
- package/dist/action-sources.js +141 -0
- package/dist/action-sources.js.map +1 -0
- package/dist/agent-roles.d.ts +9 -0
- package/dist/agent-roles.d.ts.map +1 -0
- package/dist/agent-roles.js +18 -0
- package/dist/agent-roles.js.map +1 -0
- package/dist/agent-tasks.d.ts +36 -0
- package/dist/agent-tasks.d.ts.map +1 -0
- package/dist/agent-tasks.js +151 -0
- package/dist/agent-tasks.js.map +1 -0
- package/dist/agents/orchestrator.d.ts +26 -6
- package/dist/agents/orchestrator.d.ts.map +1 -1
- package/dist/agents/orchestrator.js +95 -45
- package/dist/agents/orchestrator.js.map +1 -1
- package/dist/agents/spec-analyst.d.ts +81 -13
- package/dist/agents/spec-analyst.d.ts.map +1 -1
- package/dist/agents/spec-analyst.js +350 -89
- package/dist/agents/spec-analyst.js.map +1 -1
- package/dist/ai-service.d.ts +40 -0
- package/dist/ai-service.d.ts.map +1 -1
- package/dist/ai-service.js +94 -9
- package/dist/ai-service.js.map +1 -1
- package/dist/api-tokens.d.ts +67 -0
- package/dist/api-tokens.d.ts.map +1 -0
- package/dist/api-tokens.js +89 -0
- package/dist/api-tokens.js.map +1 -0
- package/dist/attachments/extract.d.ts +26 -0
- package/dist/attachments/extract.d.ts.map +1 -0
- package/dist/attachments/extract.js +160 -0
- package/dist/attachments/extract.js.map +1 -0
- package/dist/attachments/fixtures.d.ts +9 -0
- package/dist/attachments/fixtures.d.ts.map +1 -0
- package/dist/attachments/fixtures.js +58 -0
- package/dist/attachments/fixtures.js.map +1 -0
- package/dist/attachments/service.d.ts +71 -0
- package/dist/attachments/service.d.ts.map +1 -0
- package/dist/attachments/service.js +220 -0
- package/dist/attachments/service.js.map +1 -0
- package/dist/build-service.d.ts +1 -1
- package/dist/build-service.d.ts.map +1 -1
- package/dist/build-service.js +9 -4
- package/dist/build-service.js.map +1 -1
- package/dist/change-events.d.ts +110 -0
- package/dist/change-events.d.ts.map +1 -0
- package/dist/change-events.js +238 -0
- package/dist/change-events.js.map +1 -0
- package/dist/change-sets.d.ts +110 -0
- package/dist/change-sets.d.ts.map +1 -0
- package/dist/change-sets.js +188 -0
- package/dist/change-sets.js.map +1 -0
- package/dist/command-runner.d.ts.map +1 -1
- package/dist/command-runner.js +2 -1
- package/dist/command-runner.js.map +1 -1
- package/dist/conversations.d.ts +2 -1
- package/dist/conversations.d.ts.map +1 -1
- package/dist/conversations.js +1 -1
- package/dist/conversations.js.map +1 -1
- package/dist/data-access.d.ts +9 -2
- package/dist/data-access.d.ts.map +1 -1
- package/dist/data-access.js +38 -6
- package/dist/data-access.js.map +1 -1
- package/dist/decisions.d.ts +56 -0
- package/dist/decisions.d.ts.map +1 -0
- package/dist/decisions.js +76 -0
- package/dist/decisions.js.map +1 -0
- package/dist/deliverables.d.ts +96 -0
- package/dist/deliverables.d.ts.map +1 -0
- package/dist/deliverables.js +344 -0
- package/dist/deliverables.js.map +1 -0
- package/dist/designs.d.ts +30 -0
- package/dist/designs.d.ts.map +1 -0
- package/dist/designs.js +154 -0
- package/dist/designs.js.map +1 -0
- package/dist/git-host.d.ts +10 -0
- package/dist/git-host.d.ts.map +1 -1
- package/dist/git-host.js +30 -2
- package/dist/git-host.js.map +1 -1
- package/dist/grounding.d.ts +9 -0
- package/dist/grounding.d.ts.map +1 -0
- package/dist/grounding.js +12 -0
- package/dist/grounding.js.map +1 -0
- package/dist/index.d.ts +35 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +33 -10
- package/dist/index.js.map +1 -1
- package/dist/jira-features.d.ts +142 -0
- package/dist/jira-features.d.ts.map +1 -0
- package/dist/jira-features.js +366 -0
- package/dist/jira-features.js.map +1 -0
- package/dist/milestones.js +1 -1
- package/dist/milestones.js.map +1 -1
- package/dist/pull-request-sync.d.ts.map +1 -1
- package/dist/pull-request-sync.js +10 -6
- package/dist/pull-request-sync.js.map +1 -1
- package/dist/questions.d.ts +100 -10
- package/dist/questions.d.ts.map +1 -1
- package/dist/questions.js +211 -22
- package/dist/questions.js.map +1 -1
- package/dist/related.d.ts +26 -0
- package/dist/related.d.ts.map +1 -0
- package/dist/related.js +64 -0
- package/dist/related.js.map +1 -0
- package/dist/release-gates.d.ts +16 -0
- package/dist/release-gates.d.ts.map +1 -0
- package/dist/release-gates.js +47 -0
- package/dist/release-gates.js.map +1 -0
- package/dist/reviews.d.ts.map +1 -1
- package/dist/reviews.js +4 -3
- package/dist/reviews.js.map +1 -1
- package/dist/router.d.ts +2 -2
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js.map +1 -1
- package/dist/scheduler.d.ts +41 -5
- package/dist/scheduler.d.ts.map +1 -1
- package/dist/scheduler.js +109 -7
- package/dist/scheduler.js.map +1 -1
- package/dist/services.d.ts +760 -15
- package/dist/services.d.ts.map +1 -1
- package/dist/services.js +402 -20
- package/dist/services.js.map +1 -1
- package/dist/source-sync.d.ts +136 -0
- package/dist/source-sync.d.ts.map +1 -0
- package/dist/source-sync.js +370 -0
- package/dist/source-sync.js.map +1 -0
- package/dist/sources/front-matter.d.ts +20 -0
- package/dist/sources/front-matter.d.ts.map +1 -0
- package/dist/sources/front-matter.js +57 -0
- package/dist/sources/front-matter.js.map +1 -0
- package/dist/sources/git.d.ts +80 -0
- package/dist/sources/git.d.ts.map +1 -0
- package/dist/sources/git.js +338 -0
- package/dist/sources/git.js.map +1 -0
- package/dist/sources/http.d.ts +54 -0
- package/dist/sources/http.d.ts.map +1 -0
- package/dist/sources/http.js +79 -0
- package/dist/sources/http.js.map +1 -0
- package/dist/spec-cache.d.ts +54 -0
- package/dist/spec-cache.d.ts.map +1 -0
- package/dist/spec-cache.js +133 -0
- package/dist/spec-cache.js.map +1 -0
- package/dist/spec-links.d.ts +68 -0
- package/dist/spec-links.d.ts.map +1 -0
- package/dist/spec-links.js +144 -0
- package/dist/spec-links.js.map +1 -0
- package/dist/spec-reader.d.ts +44 -0
- package/dist/spec-reader.d.ts.map +1 -0
- package/dist/spec-reader.js +81 -0
- package/dist/spec-reader.js.map +1 -0
- package/dist/spec-resolver.d.ts +13 -1
- package/dist/spec-resolver.d.ts.map +1 -1
- package/dist/spec-resolver.js +45 -8
- package/dist/spec-resolver.js.map +1 -1
- package/dist/spec-tools.d.ts +10 -0
- package/dist/spec-tools.d.ts.map +1 -0
- package/dist/spec-tools.js +103 -0
- package/dist/spec-tools.js.map +1 -0
- package/dist/task-scope.d.ts +11 -0
- package/dist/task-scope.d.ts.map +1 -0
- package/dist/task-scope.js +11 -0
- package/dist/task-scope.js.map +1 -0
- package/dist/telemetry.d.ts +34 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +72 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/template.d.ts +341 -0
- package/dist/template.d.ts.map +1 -0
- package/dist/template.js +142 -0
- package/dist/template.js.map +1 -0
- package/dist/tool-sandbox.d.ts.map +1 -1
- package/dist/tool-sandbox.js +2 -2
- package/dist/tool-sandbox.js.map +1 -1
- package/dist/tracks.d.ts +3 -3
- package/dist/tracks.js +1 -1
- package/dist/tracks.js.map +1 -1
- package/dist/verifier.d.ts.map +1 -1
- package/dist/verifier.js +8 -7
- package/dist/verifier.js.map +1 -1
- package/dist/vscode-connect.d.ts +48 -0
- package/dist/vscode-connect.d.ts.map +1 -0
- package/dist/vscode-connect.js +105 -0
- package/dist/vscode-connect.js.map +1 -0
- package/package.json +14 -3
- package/prompts/agent-task.contract.md +9 -0
- package/prompts/orchestrator.brief.md +17 -0
- package/prompts/orchestrator.contract.md +7 -0
- package/prompts/spec-analyst.brief.md +19 -0
- package/prompts/spec-analyst.contract.md +5 -0
- package/prompts/spec-analyst.sweep.md +2 -0
package/dist/tracks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracks.js","sourceRoot":"","sources":["../src/tracks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChI,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAc,YAAY,EAAE,MAAM,eAAe,CAAC;AAEzD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACnC,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAClD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACvD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACvD,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CAClD,CAAC,CAAC;AAGH;;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;QAC9F,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC5H,IAAI,MAAM;gBAAE,MAAM,IAAI,YAAY,CAAC,GAAG,EAAE,GAAG,IAAI,wBAAwB,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC;QAC5G,CAAC;IACH,CAAC;CACF"}
|
package/dist/verifier.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifier.d.ts","sourceRoot":"","sources":["../src/verifier.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAsB,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAI3F,OAAO,EAAE,KAAK,aAAa,EAAa,MAAM,qBAAqB,CAAC;AAGpE,OAAO,EAAE,KAAK,KAAK,EAAgC,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"verifier.d.ts","sourceRoot":"","sources":["../src/verifier.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAsB,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAI3F,OAAO,EAAE,KAAK,aAAa,EAAa,MAAM,qBAAqB,CAAC;AAGpE,OAAO,EAAE,KAAK,KAAK,EAAgC,MAAM,eAAe,CAAC;AAKzE;;;;;;GAMG;AACH,qBAAa,QAAQ;IAMjB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,kEAAkE;IAClE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;IAR1B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAa;IAClC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAiB;gBAGvB,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,SAAS;IAClC,kEAAkE;IACjD,MAAM,CAAC,EAAE,aAAa,YAAA;IAOnC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAM5C,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE;IAIhC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC;YA0CzE,MAAM;CAWrB"}
|
package/dist/verifier.js
CHANGED
|
@@ -6,6 +6,7 @@ import { runnerFor } from './command-runner.js';
|
|
|
6
6
|
import { DataAccess } from './data-access.js';
|
|
7
7
|
import { MilestoneService } from './milestones.js';
|
|
8
8
|
import { ProjectService, ServiceError } from './services.js';
|
|
9
|
+
import { shortId } from '@aigile/core/id';
|
|
9
10
|
const TAIL = 4_000;
|
|
10
11
|
/**
|
|
11
12
|
* The deterministic Verifier (documentation/agents.md §2.5): the project's
|
|
@@ -46,15 +47,15 @@ export class Verifier {
|
|
|
46
47
|
const started = Date.now();
|
|
47
48
|
const record = (status, checks, note) => this.record(build, { buildId, projectId: project.id, status, checks, durationMs: Date.now() - started, note, commit: build.commit }, actor);
|
|
48
49
|
if (!build.branch || !project.gitUrl)
|
|
49
|
-
return record('blocked', [], `build ${buildId
|
|
50
|
+
return record('blocked', [], `build ${shortId(buildId)} has no branch to check`);
|
|
50
51
|
if (build.status !== 'proposed' && build.status !== 'checking')
|
|
51
|
-
return record('blocked', [], `build ${buildId
|
|
52
|
+
return record('blocked', [], `build ${shortId(buildId)} is ${build.status}; the checks run on a built branch before its decision`);
|
|
52
53
|
const commands = this.checksFor(project.id);
|
|
53
54
|
if (commands.length === 0)
|
|
54
55
|
return record('skipped', [], 'no checks are configured (agents.verifier.checks or checksByProject)');
|
|
55
56
|
const work = join(installRoot, '.aigile', 'work');
|
|
56
57
|
const checkout = new Checkout(join(work, project.id), project.gitUrl, project.gitBranch);
|
|
57
|
-
const dir = join(work, `${project.id}-verify-${build.id
|
|
58
|
+
const dir = join(work, `${project.id}-verify-${shortId(build.id)}`);
|
|
58
59
|
try {
|
|
59
60
|
await checkout.addWorktree(build.branch, dir);
|
|
60
61
|
}
|
|
@@ -89,10 +90,10 @@ export class Verifier {
|
|
|
89
90
|
}
|
|
90
91
|
async record(build, input, actor) {
|
|
91
92
|
const ts = nowIso();
|
|
92
|
-
const verification = verificationSchema.parse({ ...input, id: newId(), createdAt: ts, updatedAt: ts });
|
|
93
|
-
await this.store.put(COLLECTIONS.verifications, verification.id, verification, { message: `Verification of build ${build.id
|
|
94
|
-
await this.builds.update(build.id, { verificationId: verification.id }, `Build ${build.id
|
|
95
|
-
await new MilestoneService(this.store).post({ kind: 'gate-verdict', agentKey: 'verifier', about: { kind: 'build', id: build.id }, projectIds: [build.projectId], summary: `Checks ${verification.status} on build ${build.id
|
|
93
|
+
const verification = verificationSchema.parse({ ...input, id: newId('verification'), createdAt: ts, updatedAt: ts });
|
|
94
|
+
await this.store.put(COLLECTIONS.verifications, verification.id, verification, { message: `Verification of build ${shortId(build.id)}: ${verification.status}`, ...(actor.author ? { author: actor.author } : {}) });
|
|
95
|
+
await this.builds.update(build.id, { verificationId: verification.id }, `Build ${shortId(build.id)} verified: ${verification.status}`);
|
|
96
|
+
await new MilestoneService(this.store).post({ kind: 'gate-verdict', agentKey: 'verifier', about: { kind: 'build', id: build.id }, projectIds: [build.projectId], summary: `Checks ${verification.status} on build ${shortId(build.id)}`, detail: verification.note ?? verification.checks.map((c) => `${c.command} → ${c.exitCode === null ? 'timed out' : `exit ${c.exitCode}`}`).join('; ') }, actor);
|
|
96
97
|
return verification;
|
|
97
98
|
}
|
|
98
99
|
}
|
package/dist/verifier.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifier.js","sourceRoot":"","sources":["../src/verifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAsB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAc,cAAc,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"verifier.js","sourceRoot":"","sources":["../src/verifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAsB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAc,cAAc,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,C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AAI,CAAC,IAAI,CAAC,EAAE,EACnV,KAAK,CACN,CAAC;QACF,OAAO,YAAY,CAAC;IACtB,CAAC;CACF"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { DataStore } from '@aigile/core';
|
|
2
|
+
import type { ApiTokenService } from './api-tokens.js';
|
|
3
|
+
import { type Actor } from './services.js';
|
|
4
|
+
/**
|
|
5
|
+
* Signing VS Code in through the browser (documentation/ui.md "Signing VS Code
|
|
6
|
+
* in"): the person allows the connection on `/vscode/connect`, aigile issues a
|
|
7
|
+
* one-time code that goes to the extension's loopback server in the redirect,
|
|
8
|
+
* and the extension redeems the code with its verifier for a personal API
|
|
9
|
+
* token. The token travels only in the redeem reply, never in an address; the
|
|
10
|
+
* code alone is worthless (the verifier never leaves the extension) and dies
|
|
11
|
+
* after one use or two minutes. Codes are kept in the datastore, by their
|
|
12
|
+
* hash, so the replica that issues one need not be the one that redeems it.
|
|
13
|
+
*/
|
|
14
|
+
export declare const VSCODE_CODES_COLLECTION = "vscode-connect-codes";
|
|
15
|
+
/** How long a code may wait to be redeemed. */
|
|
16
|
+
export declare const CODE_TTL_MS = 120000;
|
|
17
|
+
/** The label a connection is named by: printable, one line, at most 80 characters. */
|
|
18
|
+
export declare function connectionLabel(name: string): string;
|
|
19
|
+
/** The PKCE (S256) challenge of a verifier. */
|
|
20
|
+
export declare function challengeOf(verifier: string): string;
|
|
21
|
+
export declare function isB64Url32(value: unknown): value is string;
|
|
22
|
+
export declare class VsCodeConnectService {
|
|
23
|
+
private readonly store;
|
|
24
|
+
private readonly tokens;
|
|
25
|
+
private readonly now;
|
|
26
|
+
/** Codes being redeemed in this process, so two redeems of one code cannot both pass. */
|
|
27
|
+
private readonly redeeming;
|
|
28
|
+
constructor(store: DataStore, tokens: ApiTokenService, now?: () => number);
|
|
29
|
+
/** After the person allowed it: a code for the extension, kept by its hash with the extension's challenge. */
|
|
30
|
+
issue(userId: string, challenge: string, name: string): Promise<{
|
|
31
|
+
code: string;
|
|
32
|
+
expiresAt: number;
|
|
33
|
+
}>;
|
|
34
|
+
/**
|
|
35
|
+
* The extension's redeem: the code and the verifier whose challenge came with
|
|
36
|
+
* it. Any attempt uses the code up, right or wrong; a wrong, used or expired
|
|
37
|
+
* code gets one answer, so a guess learns nothing. A new token named
|
|
38
|
+
* "VS Code (<name>)" is made for the person who allowed it.
|
|
39
|
+
*/
|
|
40
|
+
redeem(code: unknown, verifier: unknown, actorFor: (userId: string) => Promise<Actor>): Promise<{
|
|
41
|
+
token: string;
|
|
42
|
+
userId: string;
|
|
43
|
+
name: string;
|
|
44
|
+
}>;
|
|
45
|
+
/** Drop codes that expired unredeemed. */
|
|
46
|
+
private sweep;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=vscode-connect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vscode-connect.d.ts","sourceRoot":"","sources":["../src/vscode-connect.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,KAAK,KAAK,EAAgB,MAAM,eAAe,CAAC;AAEzD;;;;;;;;;GASG;AACH,eAAO,MAAM,uBAAuB,yBAAyB,CAAC;AAE9D,+CAA+C;AAC/C,eAAO,MAAM,WAAW,SAAU,CAAC;AAanC,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGpD;AAED,+CAA+C;AAC/C,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAE1D;AAID,qBAAa,oBAAoB;IAK7B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IANtB,yFAAyF;IACzF,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqB;gBAG5B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,eAAe,EACvB,GAAG,GAAE,MAAM,MAAiB;IAG/C,8GAA8G;IACxG,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAU1G;;;;;OAKG;IACG,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAuBtJ,0CAA0C;YAC5B,KAAK;CAOpB"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { createHash, randomBytes, timingSafeEqual } from 'node:crypto';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { ServiceError } from './services.js';
|
|
4
|
+
/**
|
|
5
|
+
* Signing VS Code in through the browser (documentation/ui.md "Signing VS Code
|
|
6
|
+
* in"): the person allows the connection on `/vscode/connect`, aigile issues a
|
|
7
|
+
* one-time code that goes to the extension's loopback server in the redirect,
|
|
8
|
+
* and the extension redeems the code with its verifier for a personal API
|
|
9
|
+
* token. The token travels only in the redeem reply, never in an address; the
|
|
10
|
+
* code alone is worthless (the verifier never leaves the extension) and dies
|
|
11
|
+
* after one use or two minutes. Codes are kept in the datastore, by their
|
|
12
|
+
* hash, so the replica that issues one need not be the one that redeems it.
|
|
13
|
+
*/
|
|
14
|
+
export const VSCODE_CODES_COLLECTION = 'vscode-connect-codes';
|
|
15
|
+
/** How long a code may wait to be redeemed. */
|
|
16
|
+
export const CODE_TTL_MS = 120_000;
|
|
17
|
+
/** A base64url string of 32 bytes (a SHA-256 challenge, a verifier, a state): 43 characters. */
|
|
18
|
+
const B64URL_32 = /^[A-Za-z0-9_-]{43}$/;
|
|
19
|
+
const codeRecordSchema = z.object({
|
|
20
|
+
id: z.string(),
|
|
21
|
+
userId: z.string(),
|
|
22
|
+
challenge: z.string(),
|
|
23
|
+
name: z.string(),
|
|
24
|
+
expiresAt: z.number(),
|
|
25
|
+
});
|
|
26
|
+
/** The label a connection is named by: printable, one line, at most 80 characters. */
|
|
27
|
+
export function connectionLabel(name) {
|
|
28
|
+
const label = name.replace(/\p{Cc}+/gu, ' ').replace(/\s+/g, ' ').trim().slice(0, 80);
|
|
29
|
+
return label || 'this computer';
|
|
30
|
+
}
|
|
31
|
+
/** The PKCE (S256) challenge of a verifier. */
|
|
32
|
+
export function challengeOf(verifier) {
|
|
33
|
+
return createHash('sha256').update(verifier).digest('base64url');
|
|
34
|
+
}
|
|
35
|
+
export function isB64Url32(value) {
|
|
36
|
+
return typeof value === 'string' && B64URL_32.test(value);
|
|
37
|
+
}
|
|
38
|
+
const hashOf = (code) => createHash('sha256').update(code).digest('hex');
|
|
39
|
+
export class VsCodeConnectService {
|
|
40
|
+
store;
|
|
41
|
+
tokens;
|
|
42
|
+
now;
|
|
43
|
+
/** Codes being redeemed in this process, so two redeems of one code cannot both pass. */
|
|
44
|
+
redeeming = new Set();
|
|
45
|
+
constructor(store, tokens, now = Date.now) {
|
|
46
|
+
this.store = store;
|
|
47
|
+
this.tokens = tokens;
|
|
48
|
+
this.now = now;
|
|
49
|
+
}
|
|
50
|
+
/** After the person allowed it: a code for the extension, kept by its hash with the extension's challenge. */
|
|
51
|
+
async issue(userId, challenge, name) {
|
|
52
|
+
if (!isB64Url32(challenge))
|
|
53
|
+
throw new ServiceError(400, 'the challenge is not a SHA-256 in base64url');
|
|
54
|
+
await this.sweep();
|
|
55
|
+
const code = randomBytes(32).toString('base64url');
|
|
56
|
+
const id = hashOf(code);
|
|
57
|
+
const expiresAt = this.now() + CODE_TTL_MS;
|
|
58
|
+
await this.store.put(VSCODE_CODES_COLLECTION, id, { id, userId, challenge, name: connectionLabel(name), expiresAt }, { message: 'VS Code sign-in code issued' });
|
|
59
|
+
return { code, expiresAt };
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The extension's redeem: the code and the verifier whose challenge came with
|
|
63
|
+
* it. Any attempt uses the code up, right or wrong; a wrong, used or expired
|
|
64
|
+
* code gets one answer, so a guess learns nothing. A new token named
|
|
65
|
+
* "VS Code (<name>)" is made for the person who allowed it.
|
|
66
|
+
*/
|
|
67
|
+
async redeem(code, verifier, actorFor) {
|
|
68
|
+
const refused = new ServiceError(400, 'that sign-in code is not valid (used, expired or not for this verifier); sign in again');
|
|
69
|
+
if (typeof code !== 'string' || !isB64Url32(code) || !isB64Url32(verifier))
|
|
70
|
+
throw refused;
|
|
71
|
+
const id = hashOf(code);
|
|
72
|
+
if (this.redeeming.has(id))
|
|
73
|
+
throw refused;
|
|
74
|
+
this.redeeming.add(id);
|
|
75
|
+
try {
|
|
76
|
+
const raw = await this.store.get(VSCODE_CODES_COLLECTION, id);
|
|
77
|
+
const parsed = raw ? codeRecordSchema.safeParse(raw) : null;
|
|
78
|
+
if (!parsed?.success)
|
|
79
|
+
throw refused;
|
|
80
|
+
await this.store.delete(VSCODE_CODES_COLLECTION, id, { message: 'VS Code sign-in code used' });
|
|
81
|
+
const record = parsed.data;
|
|
82
|
+
if (record.expiresAt <= this.now())
|
|
83
|
+
throw refused;
|
|
84
|
+
const expected = Buffer.from(record.challenge);
|
|
85
|
+
const given = Buffer.from(challengeOf(verifier));
|
|
86
|
+
if (expected.length !== given.length || !timingSafeEqual(expected, given))
|
|
87
|
+
throw refused;
|
|
88
|
+
const { token } = await this.tokens.create(record.userId, `VS Code (${record.name})`, await actorFor(record.userId));
|
|
89
|
+
return { token, userId: record.userId, name: record.name };
|
|
90
|
+
}
|
|
91
|
+
finally {
|
|
92
|
+
this.redeeming.delete(id);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
/** Drop codes that expired unredeemed. */
|
|
96
|
+
async sweep() {
|
|
97
|
+
const now = this.now();
|
|
98
|
+
for (const raw of await this.store.list(VSCODE_CODES_COLLECTION)) {
|
|
99
|
+
const parsed = codeRecordSchema.safeParse(raw);
|
|
100
|
+
if (parsed.success && parsed.data.expiresAt <= now)
|
|
101
|
+
await this.store.delete(VSCODE_CODES_COLLECTION, parsed.data.id, { message: 'VS Code sign-in code expired' }).catch(() => undefined);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=vscode-connect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vscode-connect.js","sourceRoot":"","sources":["../src/vscode-connect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAc,YAAY,EAAE,MAAM,eAAe,CAAC;AAEzD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,sBAAsB,CAAC;AAE9D,+CAA+C;AAC/C,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC;AAEnC,gGAAgG;AAChG,MAAM,SAAS,GAAG,qBAAqB,CAAC;AAExC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,CAAC;AAEH,sFAAsF;AACtF,MAAM,UAAU,eA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I,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,IAAI,GAAG;gBAAE,MAAM,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,uBAAuB,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,8BAA8B,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC3L,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigile/engine",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "aigile: engine package",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Ryan Goldstein <me@ryangoldstein.com>",
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
"type": "module",
|
|
13
13
|
"files": [
|
|
14
14
|
"dist",
|
|
15
|
+
"prompts",
|
|
16
|
+
"assets",
|
|
15
17
|
"!dist/**/*.test.*"
|
|
16
18
|
],
|
|
17
19
|
"main": "./dist/index.js",
|
|
@@ -21,13 +23,22 @@
|
|
|
21
23
|
},
|
|
22
24
|
"scripts": {
|
|
23
25
|
"build": "tsc --build",
|
|
24
|
-
"test": "tsc --build && node --test \"dist/**/*.test.js\""
|
|
26
|
+
"test": "tsc --build && GIT_TRACE2_EVENT=0 node --test \"dist/**/*.test.js\""
|
|
25
27
|
},
|
|
26
28
|
"dependencies": {
|
|
27
|
-
"@aigile/core": "0.
|
|
29
|
+
"@aigile/core": "0.4.0",
|
|
30
|
+
"@opentelemetry/api": "~1.9.0",
|
|
31
|
+
"exceljs": "^4.4.0",
|
|
32
|
+
"fflate": "^0.8.3",
|
|
33
|
+
"mammoth": "^1.13.0",
|
|
34
|
+
"pdfjs-dist": "^6.5.438",
|
|
35
|
+
"turndown": "^7.2.5",
|
|
28
36
|
"zod": "^3.25.76"
|
|
29
37
|
},
|
|
30
38
|
"publishConfig": {
|
|
31
39
|
"access": "public"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/turndown": "^5.0.6"
|
|
32
43
|
}
|
|
33
44
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
You are an agent of aigile, a system in which people write specs (statements of intent in Markdown) that AI agents turn into work. Who you are and how you work is in your brief below. Here a person, or another agent, has given you a task: something you must do, which may be holding up someone else's work.
|
|
2
|
+
|
|
3
|
+
Work it from what you are given: the task, its notes (including any resolution of yours that was not accepted, and why), the features it belongs to, and what the items it waited on came to. Read the specs that apply with your tools (search_specs, spec_outline, get_spec) rather than guessing what they say.
|
|
4
|
+
|
|
5
|
+
When you cannot do the task without something only a person can give you (a decision, a fact that is not in the specs, access you do not have), ask with the `ask` tool, one clear question at a time, and stop. The task waits until they answer, and you will be given the answer when it comes back to you. Do not ask what the specs already answer.
|
|
6
|
+
|
|
7
|
+
Otherwise, end with your resolution: what you did or found, in plain words the person can check, citing specs by title where they matter. Say plainly what you could not do. The person who gave you the task reviews your resolution and accepts it or sends it back with a reason.
|
|
8
|
+
|
|
9
|
+
You have no tools that change code, specs or other records here; when the task needs such a change, say exactly what should change and where, so the person can make it or give it to the agent that can.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Orchestrator brief
|
|
2
|
+
|
|
3
|
+
How the Orchestrator runs this installation. Edit this spec to change its habits; add a spec mapped to the Orchestrator and to an organization or project for rules that apply only there (who approves what, how tracks are named, what to ask before starting a build).
|
|
4
|
+
|
|
5
|
+
## Routing
|
|
6
|
+
|
|
7
|
+
- A question nobody's spec decides goes to the highest-ranked author whose specs cover the area; say who has it.
|
|
8
|
+
- A build's approval goes to the project's highest-ranked author; say who has it.
|
|
9
|
+
|
|
10
|
+
## Tracks
|
|
11
|
+
|
|
12
|
+
- Open a track for any piece of work that will take more than one build or involves more than one project; name it by outcome, not by activity.
|
|
13
|
+
- Before starting a build, say which specs changed since the last one if you can tell.
|
|
14
|
+
|
|
15
|
+
## Tone
|
|
16
|
+
|
|
17
|
+
- One reply per message. Say what was done and what waits on whom; nothing else.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
You are the Orchestrator of aigile, its Project Manager, and the only agent the people of this installation talk to. aigile turns specs (statements of intent in Markdown, mapped to organizations and projects) into work: the Spec Analyst reads them (conflicts, questions), the Engineer builds them on a branch a person approves, and you keep the tracker, route what needs a person, and answer from the records.
|
|
2
|
+
|
|
3
|
+
You do none of the work yourself. You have tools: read the person's queue, the tracks, the projects; open a track; ask the Spec Analyst a question (it answers from the specs with a grade: documented, inferred, undecided); start a build (the Engineer works; the result comes back as an approval for a person). Use a tool when the answer is in the records or the job belongs to an agent; answer directly when you already know. Never invent a record, a status or a spec. Everything you start is visible to the person at once (a track in the board, a question with its answer, a build waiting for approval), so act when asked and say what you did.
|
|
4
|
+
|
|
5
|
+
Approvals belong to people: you never approve a build, resolve a conflict or decide a question for them; you point them at it. When you route something to a person or wonder whom to ask, read list_roles (what each seat does here and who holds it) and list_people: a person's manager and the people who set their priorities decide what they work on; whom they defer to in an area (by hierarchy, a dotted line, or respect) answers a question in that area before they do. A person's own spec says what they are good at. Route to the person best placed to decide; when no one person fits, to the role that decides it; when no role fits, to the project manager. If something is blocked (no provider, a cap, a missing role), say so plainly with what you would have done.
|
|
6
|
+
|
|
7
|
+
Write short, plain replies in the person's terms: the answer first, then what you did, then what waits on them, if anything. No preamble, no lists of options you will not take.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Spec Analyst brief
|
|
2
|
+
|
|
3
|
+
How the Spec Analyst reads this installation's specs. Edit this spec to change its judgement; add a spec mapped to the Spec Analyst and to an organization or project to add instructions that apply only there.
|
|
4
|
+
|
|
5
|
+
## What to treat as a conflict
|
|
6
|
+
|
|
7
|
+
- Two requirements that cannot both be met for the same project, feature or environment.
|
|
8
|
+
- Two different values for the same setting, limit, deadline or name.
|
|
9
|
+
- A rule in one spec and an exception in another that does not name itself as the exception.
|
|
10
|
+
|
|
11
|
+
## What not to treat as a conflict
|
|
12
|
+
|
|
13
|
+
- A project spec that narrows an organization spec without contradicting it.
|
|
14
|
+
- Specs about different areas that merely sound alike.
|
|
15
|
+
- Wording, tone or formatting differences.
|
|
16
|
+
|
|
17
|
+
## How to explain one
|
|
18
|
+
|
|
19
|
+
Two short paragraphs for the authors: what each spec requires, quoting the passages, and why both cannot hold. Suggest how they might be reconciled when it is obvious; otherwise leave the decision to them.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
You are the Spec Analyst of aigile, a system in which people write specs (statements of intent in Markdown) that AI agents turn into work. Specs are mapped to organizations and projects; every project resolves to a ranked set of specs, and the specs with the highest-ranked authors win where they overlap. You never write specs; you read them.
|
|
2
|
+
|
|
3
|
+
Your job here: a spec was just revised (or created). Compare the revised spec against the other specs that apply to the same projects, and report every pair that cannot both be satisfied. A conflict is a genuine contradiction: the revised spec requires something another spec forbids, sets a value or limit the other sets differently for the same thing, or imposes a constraint the other spec's requirement cannot meet. Not a conflict: two specs about different things; a more specific spec that refines a general one without contradicting it; the same requirement stated twice; a difference of style or emphasis; something one spec is silent on.
|
|
4
|
+
|
|
5
|
+
Be conservative. Report a conflict only when you can quote the passage from each spec that cannot hold with the other. When nothing conflicts, say so with an empty list. Never invent requirements that are not in the text. Answer in the JSON format requested, nothing else.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
When given every spec that applies to a project at once, find the pairs that contradict each other: two specs that cannot both be true or both be built as written (one says a value, a limit, a behaviour, an owner or an order, and the other says a different one for the same thing). A spec that refines, narrows or adds detail to another is not a conflict; neither is a difference of wording, of emphasis or of scope, or a gap one spec leaves and another fills. Each spec comes with the outline it sits in ("Under: …"); read a spec in that context before you call two of them contradictory. Report each contradicting pair once, with the ids exactly as given, one line naming the contradiction, a short explanation, and the passage from each spec that shows it. Report nothing you are unsure of; an empty list is a good answer.
|