@brainervirus/workit-core 2.1.4 → 2.1.5

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.
@@ -41,7 +41,7 @@ export const skillManifestNames = (root: string): string[] =>
41
41
  existsSync(root)
42
42
  ? readdirSync(root)
43
43
  .filter((name) => existsSync(path.join(root, name, "SKILL.md")))
44
- .sort()
44
+ .toSorted()
45
45
  : [];
46
46
 
47
47
  export const validateSkillManifests = (
@@ -10,7 +10,7 @@ export const SUPPORT_MATRIX = {
10
10
  // The object-form dual entry (server() + setup()) only loads from
11
11
  // 1.18.29+; the supported floor is 1.18.30 so no host can pass doctor while
12
12
  // being unable to load the entry shape.
13
- opencode: { minimum: "1.18.30", current: "1.18.30" },
13
+ opencode: { minimum: "1.18.30", current: "1.18.34" },
14
14
  // Codex is a qualification host, not a runtime dependency: the CLI version
15
15
  // below is the one live qualification evidence covers. The doctor warns when
16
16
  // an installed CLI drifts ahead so a fresh install never silently outruns
@@ -38,7 +38,7 @@ export function reconcileResume(
38
38
  if (observations.length > 0)
39
39
  return failure("permission_denied", "worker observations require native host verification");
40
40
  const candidate = captureCandidate(view.workspace.root, view.task.intent.data.scope, []);
41
- if (!candidate.ok) return candidate as Result<never>;
41
+ if (!candidate.ok) return candidate;
42
42
  const staleEvidenceIds = evaluateEvidence(view.task, candidate.data)
43
43
  .filter((entry) => entry.status === "stale")
44
44
  .map((entry) => entry.evidenceId);
@@ -127,7 +127,7 @@ const compactReference = (ref: Ref): CompactReference => {
127
127
  export function compactTaskContext(view: TaskView): string {
128
128
  const decisions: CompactDecision[] = view.task.decisions
129
129
  .slice()
130
- .sort((left, right) => {
130
+ .toSorted((left, right) => {
131
131
  const leftAt = compactTimestamp(left.recordedAt);
132
132
  const rightAt = compactTimestamp(right.recordedAt);
133
133
  if (leftAt !== rightAt) return leftAt > rightAt ? -1 : 1;
@@ -162,7 +162,7 @@ export function compactTaskContext(view: TaskView): string {
162
162
  ...view.task.progress.blockers.map((entry) => entry.reason),
163
163
  ]),
164
164
  )
165
- .sort()
165
+ .toSorted()
166
166
  .slice(0, COMPACT_MAX_ITEMS)
167
167
  .map((gap) => compactText(gap, COMPACT_TEXT_BYTES)!);
168
168
  const context: CompactTaskContext = {
@@ -1118,7 +1118,7 @@ export function parseOperation(family: OperationFamily, input: unknown): Result<
1118
1118
  return failure("unsupported_version", "unsupported schema version", { operation: family });
1119
1119
  const compiled = compiledOperationSchemas[family].safeParse(input);
1120
1120
  const parsed = compiled.success ? operationSchemas[family].safeParse(input) : compiled;
1121
- if (parsed.success) return success(null, null, parsed.data as OperationRequest);
1121
+ if (parsed.success) return success(null, null, parsed.data);
1122
1122
  const fields = parsed.error.issues.map((issue) => ({
1123
1123
  path: issue.code === "unrecognized_keys" ? issue.keys.join(".") : issue.path.join("."),
1124
1124
  reason: issue.message,
@@ -1293,7 +1293,7 @@ function canonical(value: unknown, seen: Set<object>): JsonValue {
1293
1293
  throw new TypeError("invalid Unicode");
1294
1294
  result = Object.fromEntries(
1295
1295
  Object.keys(value)
1296
- .sort()
1296
+ .toSorted()
1297
1297
  .map((key) => [key, canonical((value as Record<string, unknown>)[key], seen)]),
1298
1298
  );
1299
1299
  }
@@ -1339,13 +1339,13 @@ export function decisionDigest(input: Omit<Decision, "digest"> | Decision): Dige
1339
1339
  export function candidateDigest(input: Candidate): Digest {
1340
1340
  const normalizedScope = {
1341
1341
  description: input.scope.description,
1342
- paths: [...input.scope.paths].sort(compareCodeUnits),
1343
- exclusions: [...input.scope.exclusions].sort(compareCodeUnits),
1342
+ paths: [...input.scope.paths].toSorted(compareCodeUnits),
1343
+ exclusions: [...input.scope.exclusions].toSorted(compareCodeUnits),
1344
1344
  };
1345
1345
  return sha256({
1346
1346
  scope: normalizedScope,
1347
1347
  completeness: input.completeness,
1348
- files: [...input.files].sort(
1348
+ files: [...input.files].toSorted(
1349
1349
  (left, right) =>
1350
1350
  compareCodeUnits(left.path, right.path) ||
1351
1351
  compareCodeUnits(left.kind, right.kind) ||
@@ -1354,7 +1354,7 @@ export function candidateDigest(input: Candidate): Digest {
1354
1354
  ),
1355
1355
  environment: input.environment
1356
1356
  .map(({ name, value }) => ({ name, value }))
1357
- .sort(
1357
+ .toSorted(
1358
1358
  (left, right) =>
1359
1359
  compareCodeUnits(left.name, right.name) || compareNullableText(left.value, right.value),
1360
1360
  ),
@@ -1372,8 +1372,8 @@ export function requirementId(input: {
1372
1372
  ...input,
1373
1373
  scope: {
1374
1374
  description: input.scope.description,
1375
- paths: [...input.scope.paths].sort(compareCodeUnits),
1376
- exclusions: [...input.scope.exclusions].sort(compareCodeUnits),
1375
+ paths: [...input.scope.paths].toSorted(compareCodeUnits),
1376
+ exclusions: [...input.scope.exclusions].toSorted(compareCodeUnits),
1377
1377
  },
1378
1378
  });
1379
1379
  }