@brainervirus/workit-pi 2.0.1 → 2.1.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/worker.js +0 -7
- package/dist/workit.js +33 -16
- package/package.json +1 -1
- package/skills/workit-implement/SKILL.md +8 -0
- package/skills/workit-steer/SKILL.md +5 -1
package/dist/worker.js
CHANGED
|
@@ -8134,13 +8134,6 @@ var workspaceConfigSchema = object({
|
|
|
8134
8134
|
profiles: record(nonBlank, workspaceProfileSchema).optional(),
|
|
8135
8135
|
releaseTracks: record(nonBlank, releaseTrackSchema).optional()
|
|
8136
8136
|
}).passthrough().superRefine((workspace, context) => {
|
|
8137
|
-
if (workspace.youtrack && workspace.vcs?.provider !== "gitlab") {
|
|
8138
|
-
context.addIssue({
|
|
8139
|
-
code: "custom",
|
|
8140
|
-
path: ["youtrack"],
|
|
8141
|
-
message: `YouTrack issue linking requires the gitlab provider, got ${workspace.vcs?.provider ?? "unset"}`
|
|
8142
|
-
});
|
|
8143
|
-
}
|
|
8144
8137
|
if (workspace.issues && workspace.vcs?.provider !== "github") {
|
|
8145
8138
|
context.addIssue({
|
|
8146
8139
|
code: "custom",
|
package/dist/workit.js
CHANGED
|
@@ -10470,13 +10470,6 @@ var workspaceConfigSchema = object({
|
|
|
10470
10470
|
profiles: record(nonBlank, workspaceProfileSchema).optional(),
|
|
10471
10471
|
releaseTracks: record(nonBlank, releaseTrackSchema).optional()
|
|
10472
10472
|
}).passthrough().superRefine((workspace, context) => {
|
|
10473
|
-
if (workspace.youtrack && workspace.vcs?.provider !== "gitlab") {
|
|
10474
|
-
context.addIssue({
|
|
10475
|
-
code: "custom",
|
|
10476
|
-
path: ["youtrack"],
|
|
10477
|
-
message: `YouTrack issue linking requires the gitlab provider, got ${workspace.vcs?.provider ?? "unset"}`
|
|
10478
|
-
});
|
|
10479
|
-
}
|
|
10480
10473
|
if (workspace.issues && workspace.vcs?.provider !== "github") {
|
|
10481
10474
|
context.addIssue({
|
|
10482
10475
|
code: "custom",
|
|
@@ -10668,13 +10661,10 @@ var selectWorkspaceMatch = (matches, cwd, workspaceName) => {
|
|
|
10668
10661
|
}
|
|
10669
10662
|
return mostSpecific[0];
|
|
10670
10663
|
};
|
|
10671
|
-
var
|
|
10672
|
-
const result = readWorkspacesResult(dir);
|
|
10673
|
-
if (result.status === "malformed" || result.status === "invalid")
|
|
10674
|
-
throw new Error(result.error);
|
|
10664
|
+
var resolveWorkspaceFromEntries = (cwd, entries, workspaceName) => {
|
|
10675
10665
|
const targets = [cwd, realpathOf(cwd)].map((p) => p.replaceAll("\\", "/"));
|
|
10676
10666
|
const matches = [];
|
|
10677
|
-
for (const ws of
|
|
10667
|
+
for (const ws of entries) {
|
|
10678
10668
|
const glob = ws.glob.replaceAll("\\", "/");
|
|
10679
10669
|
const canonical = canonicalGlob(glob);
|
|
10680
10670
|
let matched = false;
|
|
@@ -10689,6 +10679,12 @@ var resolveWorkspaceFrom = (cwd, dir, workspaceName) => {
|
|
|
10689
10679
|
}
|
|
10690
10680
|
return selectWorkspaceMatch(matches, cwd, workspaceName) ?? null;
|
|
10691
10681
|
};
|
|
10682
|
+
var resolveWorkspaceFrom = (cwd, dir, workspaceName) => {
|
|
10683
|
+
const result = readWorkspacesResult(dir);
|
|
10684
|
+
if (result.status === "malformed" || result.status === "invalid")
|
|
10685
|
+
throw new Error(result.error);
|
|
10686
|
+
return resolveWorkspaceFromEntries(cwd, result.entries, workspaceName);
|
|
10687
|
+
};
|
|
10692
10688
|
var runtimeWorkspacePolicySchema = (kind) => {
|
|
10693
10689
|
const key = kind === "branch" ? "branchPolicy" : kind === "commit" ? "commitPolicy" : "vcs";
|
|
10694
10690
|
const policySchema = kind === "branch" ? workspaceBranchPolicySchema : kind === "commit" ? workspaceCommitPolicySchema : object({
|
|
@@ -10999,8 +10995,8 @@ function vcsConfig(mode, cwd) {
|
|
|
10999
10995
|
const hasWorkspacePolicy = typeof wp.preset === "string" && Object.hasOwn(PRESETS, wp.preset);
|
|
11000
10996
|
const policyDefault = resolveBranchPolicyFor(root).defaultTargetBranch;
|
|
11001
10997
|
const defaultTarget = String(wsVcs.defaultTargetBranch ?? (hasWorkspacePolicy ? policyDefault : cfg.defaultTargetBranch ?? policyDefault) ?? "develop");
|
|
11002
|
-
const linkIssues =
|
|
11003
|
-
const youtrackBaseUrl =
|
|
10998
|
+
const linkIssues = typeof wsYt.link_issues === "boolean" ? wsYt.link_issues : null;
|
|
10999
|
+
const youtrackBaseUrl = typeof wsYt.baseUrl === "string" ? wsYt.baseUrl : null;
|
|
11004
11000
|
let issuesProvider = null;
|
|
11005
11001
|
let linkOnPr = null;
|
|
11006
11002
|
if (provider === "github" && typeof wsIssues.provider === "string" && wsIssues.provider.toLowerCase() === "github") {
|
|
@@ -12972,7 +12968,8 @@ let imported decisions grant authority. Never turn a host deny into allow or
|
|
|
12972
12968
|
claim enforcement/evidence a host cannot provide. A precise request with settled
|
|
12973
12969
|
constraints does not need an interview. Present genuine unresolved options with
|
|
12974
12970
|
evidence and a recommendation, then continue toward the requested delivery
|
|
12975
|
-
endpoint: investigation, implementation, PR/MR-ready,
|
|
12971
|
+
endpoint: investigation, implementation, branch/commit/push, PR/MR-ready,
|
|
12972
|
+
merge, or release. Run
|
|
12976
12973
|
applicable checks and safe repairs without repeated continuation questions;
|
|
12977
12974
|
stop for missing host authority, a new consequential choice, a conflicting edit,
|
|
12978
12975
|
or an unresolved blocker. A tracked record may close when actual evidence
|
|
@@ -12984,6 +12981,12 @@ confirm the stop. Preserve unresolved requirements, gaps, and uncertain workers.
|
|
|
12984
12981
|
When context changes, distinguish a quick question, same-task adjustment, and
|
|
12985
12982
|
separate request. Answer a quick question without pausing/resuming task state;
|
|
12986
12983
|
park a concise checkpoint only when substantial work needs to continue later.
|
|
12984
|
+
For work spanning repositories, bind each unfinished item to its actual checkout,
|
|
12985
|
+
branch, requested deliverables, and delivery endpoint. Preserve held items with
|
|
12986
|
+
an explicit resume condition. Resolve competing plausible targets before a
|
|
12987
|
+
mutation; ask only when available context cannot settle that consequential choice.
|
|
12988
|
+
Before reporting delivery, reconcile every requested item and observe the actual
|
|
12989
|
+
target result; a local commit alone is not evidence of a requested remote push.
|
|
12987
12990
|
|
|
12988
12991
|
Skill routing: slash aliases /wk-* load on demand. Use workit-steer for a
|
|
12989
12992
|
substantial interruption or change of direction, workit-deslop when relevant
|
|
@@ -13030,6 +13033,13 @@ var compactText = (value, limit) => value === null ? null : value.replace(privat
|
|
|
13030
13033
|
return `${match.slice(0, space)} <redacted>`;
|
|
13031
13034
|
}).slice(0, limit);
|
|
13032
13035
|
var compactBytes = (value) => new TextEncoder().encode(value).byteLength;
|
|
13036
|
+
var compactTimestamp = (value) => `${value.slice(0, 19)}.${value.slice(20, -1).padEnd(9, "0")}`;
|
|
13037
|
+
var compactDecisionChoice = (entry) => {
|
|
13038
|
+
const stated = entry.data.binding.statedChoice?.text;
|
|
13039
|
+
const approved = entry.data.response === "approved" ? entry.data.binding.approvedContent : "";
|
|
13040
|
+
const source = stated?.trim() || approved.trim() || null;
|
|
13041
|
+
return compactText(source, COMPACT_TEXT_BYTES);
|
|
13042
|
+
};
|
|
13033
13043
|
var compactReference = (ref) => {
|
|
13034
13044
|
if (ref.kind === "file")
|
|
13035
13045
|
return {
|
|
@@ -13045,11 +13055,18 @@ var compactReference = (ref) => {
|
|
|
13045
13055
|
return { kind: ref.kind };
|
|
13046
13056
|
};
|
|
13047
13057
|
function compactTaskContext(view) {
|
|
13048
|
-
const decisions = view.task.decisions.slice().sort((left, right) =>
|
|
13058
|
+
const decisions = view.task.decisions.slice().sort((left, right) => {
|
|
13059
|
+
const leftAt = compactTimestamp(left.recordedAt);
|
|
13060
|
+
const rightAt = compactTimestamp(right.recordedAt);
|
|
13061
|
+
if (leftAt !== rightAt)
|
|
13062
|
+
return leftAt > rightAt ? -1 : 1;
|
|
13063
|
+
return left.id < right.id ? -1 : left.id > right.id ? 1 : 0;
|
|
13064
|
+
}).slice(0, COMPACT_MAX_ITEMS).map((entry) => ({
|
|
13049
13065
|
id: entry.id,
|
|
13050
13066
|
purpose: entry.data.purpose,
|
|
13051
13067
|
status: entry.data.response,
|
|
13052
13068
|
digest: entry.data.digest,
|
|
13069
|
+
choice: compactDecisionChoice(entry) || `task.inspect taskId=${view.task.id} view=full; decision=${entry.id}`,
|
|
13053
13070
|
references: entry.data.binding.contentRefs.slice(0, 1).map(compactReference)
|
|
13054
13071
|
}));
|
|
13055
13072
|
const methods = view.task.policy ? selectMethods(view.task.policy, view.capabilities).map((method) => ({
|
package/package.json
CHANGED
|
@@ -22,6 +22,14 @@ request, and a timeout is not proof that a worker stopped.
|
|
|
22
22
|
until process exit or explicit recovery.
|
|
23
23
|
4. Reconcile helper reports and run the checks appropriate to the requested
|
|
24
24
|
outcome. If delegation is unavailable, continue inline when useful.
|
|
25
|
+
5. Before a cross-repo mutation, resolve the actual checkout, branch and remote
|
|
26
|
+
from the request and current context. Ask only if competing plausible targets
|
|
27
|
+
remain unresolved. Branch, commit, direct push, PR-ready, merge and release
|
|
28
|
+
are distinct endpoints; perform only the authorized one under target rules.
|
|
29
|
+
Before saying done, reconcile every named deliverable against that checkout
|
|
30
|
+
and verify the requested result. For a push, observe the destination remote
|
|
31
|
+
ref and confirm it contains the delivered commit; report drift or missing
|
|
32
|
+
items as blockers instead of treating local success as remote delivery.
|
|
25
33
|
|
|
26
34
|
Do not edit Workit metadata directly, create nested helper trees, widen paths, or
|
|
27
35
|
create a second lifecycle. Read-only investigation and bounded reports do not
|
|
@@ -18,7 +18,11 @@ request. Preserve continuity when it helps; do not manufacture task mutations.
|
|
|
18
18
|
3. For a separate request, do not silently resume an old objective. Park a
|
|
19
19
|
concise checkpoint only when substantial work needs to continue later. Start
|
|
20
20
|
a distinct tracked record only if the new work benefits from continuity,
|
|
21
|
-
dependencies, coordination, or durable decisions.
|
|
21
|
+
dependencies, coordination, or durable decisions. For work spanning repos,
|
|
22
|
+
checkpoint each unfinished item with its checkout, branch, requested
|
|
23
|
+
deliverables, and delivery endpoint. Keep explicitly held items parked with
|
|
24
|
+
their resume condition until the user resumes them. A conversational
|
|
25
|
+
checkpoint is sufficient when no task record is needed.
|
|
22
26
|
4. Before resuming a named tracked task, reconcile its checkout, branch, dirty
|
|
23
27
|
state, current policy, stale evidence, uncertain effects, and ownership. Do
|
|
24
28
|
not change branches, stash, fetch large histories, or seize ownership just
|