@codeam/shared 2.61.22 → 2.61.23
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/index.d.mts +50 -1
- package/dist/index.d.ts +50 -1
- package/dist/index.js +96 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +92 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1022,6 +1022,94 @@ function getIntegrationBranding(id) {
|
|
|
1022
1022
|
return INTEGRATION_BRANDING[id] ?? null;
|
|
1023
1023
|
}
|
|
1024
1024
|
|
|
1025
|
+
// src/skills/registry.ts
|
|
1026
|
+
var CODE_REVIEW_BODY = `Use this skill when reviewing a pull request. It defines what a high-signal
|
|
1027
|
+
review looks like so your inline comments are worth the author's time.
|
|
1028
|
+
|
|
1029
|
+
## Review priorities (in order)
|
|
1030
|
+
1. **Correctness** \u2014 does the change do what the PR says, and only that? Trace the
|
|
1031
|
+
changed paths for logic errors, off-by-one, null/undefined, wrong branch, and
|
|
1032
|
+
inverted conditions. State a concrete failure scenario (inputs \u2192 wrong output)
|
|
1033
|
+
for anything you flag as a bug.
|
|
1034
|
+
2. **Security** \u2014 untrusted input reaching a sink (SQL, shell, path, HTML), secrets
|
|
1035
|
+
in code/logs, authz gaps, credentials passed via argv instead of env.
|
|
1036
|
+
3. **Tests** \u2014 does the change carry tests that would fail without it? Missing
|
|
1037
|
+
coverage on a bug-prone path is a finding.
|
|
1038
|
+
4. **Clarity / reuse** \u2014 duplicated logic, a simpler existing helper, a name that
|
|
1039
|
+
misleads. Only raise these when they materially affect maintainability.
|
|
1040
|
+
|
|
1041
|
+
## Comment discipline
|
|
1042
|
+
- One finding per comment, anchored to the exact line.
|
|
1043
|
+
- Lead with severity: **blocker**, **should-fix**, or **nit**.
|
|
1044
|
+
- Say WHY (the failure or risk), not just WHAT. Propose the fix when it is short.
|
|
1045
|
+
- Do NOT restate the diff, praise trivially, or nitpick style a formatter owns.
|
|
1046
|
+
- If the PR is correct and well-tested, say so plainly and approve \u2014 a clean review
|
|
1047
|
+
is a valid outcome, not a failure to find something.
|
|
1048
|
+
|
|
1049
|
+
## Scope
|
|
1050
|
+
Review only what the diff changes and its direct blast radius. Do not demand
|
|
1051
|
+
unrelated refactors.`;
|
|
1052
|
+
var CODE_REVIEW_INSTRUCTION = `When reviewing this PR, prioritize correctness first, then security, then test
|
|
1053
|
+
coverage, then clarity/reuse. One finding per inline comment, anchored to the exact
|
|
1054
|
+
line, each led by a severity tag (blocker/should-fix/nit) and a concrete reason
|
|
1055
|
+
(the failure scenario or risk), not a restatement of the diff. If the change is
|
|
1056
|
+
correct and well-tested, approve and say so \u2014 finding nothing is a valid outcome.
|
|
1057
|
+
Review only the diff and its direct blast radius; do not demand unrelated refactors.`;
|
|
1058
|
+
var RESOLVE_CONFLICTS_BODY = `Use this skill when resolving merge conflicts on a pull request. The goal is a
|
|
1059
|
+
merge that preserves BOTH sides' intent, not one that just makes the file compile.
|
|
1060
|
+
|
|
1061
|
+
## Method
|
|
1062
|
+
1. Understand each conflict hunk before editing: what did HEAD change, what did the
|
|
1063
|
+
base branch change, and WHY. Read the surrounding function, not just the markers.
|
|
1064
|
+
2. Prefer a union of intents. Drop a side only when the two changes are genuinely
|
|
1065
|
+
mutually exclusive \u2014 and when you do, keep the side that matches the PR's purpose.
|
|
1066
|
+
3. Never leave a conflict marker (\`<<<<<<<\`, \`=======\`, \`>>>>>>>\`) behind. Grep for
|
|
1067
|
+
them before committing.
|
|
1068
|
+
4. After resolving, the code must build and its tests must pass. Run them. A merge
|
|
1069
|
+
that resolves markers but breaks the build is not done.
|
|
1070
|
+
5. For lockfiles/generated files, regenerate rather than hand-merge.
|
|
1071
|
+
|
|
1072
|
+
## Commit
|
|
1073
|
+
One commit that explains what was reconciled and any intent you had to choose
|
|
1074
|
+
between. Then push the branch.`;
|
|
1075
|
+
var RESOLVE_CONFLICTS_INSTRUCTION = `When resolving these merge conflicts, preserve both sides' intent \u2014 read each hunk's
|
|
1076
|
+
surrounding code to understand what HEAD and the base branch each changed and why,
|
|
1077
|
+
and prefer a union of intents; drop a side only when the two are mutually exclusive,
|
|
1078
|
+
keeping the side that matches the PR's purpose. Leave no conflict markers behind
|
|
1079
|
+
(grep for them). Regenerate lockfiles rather than hand-merging them. The result must
|
|
1080
|
+
build and pass tests \u2014 run them \u2014 before you commit and push.`;
|
|
1081
|
+
var SKILL_REGISTRY = {
|
|
1082
|
+
"code-review": {
|
|
1083
|
+
id: "code-review",
|
|
1084
|
+
name: "Code Review",
|
|
1085
|
+
description: `High-signal PR review: prioritize correctness \u2192 security \u2192 tests \u2192 clarity, one anchored finding per comment.`,
|
|
1086
|
+
source: "curated",
|
|
1087
|
+
delivery: {
|
|
1088
|
+
skillFile: { body: CODE_REVIEW_BODY },
|
|
1089
|
+
instruction: { body: CODE_REVIEW_INSTRUCTION }
|
|
1090
|
+
}
|
|
1091
|
+
},
|
|
1092
|
+
"resolve-conflicts": {
|
|
1093
|
+
id: "resolve-conflicts",
|
|
1094
|
+
name: "Resolve Conflicts",
|
|
1095
|
+
description: `Merge-conflict resolution that preserves both sides' intent, leaves no markers, and keeps the build green.`,
|
|
1096
|
+
source: "curated",
|
|
1097
|
+
delivery: {
|
|
1098
|
+
skillFile: { body: RESOLVE_CONFLICTS_BODY },
|
|
1099
|
+
instruction: { body: RESOLVE_CONFLICTS_INSTRUCTION }
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
};
|
|
1103
|
+
function isSkillId(id) {
|
|
1104
|
+
return Object.prototype.hasOwnProperty.call(SKILL_REGISTRY, id);
|
|
1105
|
+
}
|
|
1106
|
+
function getSkillDefinition(id) {
|
|
1107
|
+
return isSkillId(id) ? SKILL_REGISTRY[id] : null;
|
|
1108
|
+
}
|
|
1109
|
+
function skillHasRail(id, rail) {
|
|
1110
|
+
return Boolean(SKILL_REGISTRY[id].delivery[rail]);
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1025
1113
|
// src/api-url.ts
|
|
1026
1114
|
var DEFAULT_API_BASE_URL = "https://api.codeagent-mobile.com";
|
|
1027
1115
|
var DEV_API_BASE_URL = "https://dev-api.codeagent-mobile.com";
|
|
@@ -1233,6 +1321,7 @@ export {
|
|
|
1233
1321
|
PREVIEW_DETECT_PROMPT,
|
|
1234
1322
|
PROTOCOL_VERSION,
|
|
1235
1323
|
PUBLIC_TO_INTERNAL,
|
|
1324
|
+
SKILL_REGISTRY,
|
|
1236
1325
|
SSE_SOCKET_TIMEOUT_MS,
|
|
1237
1326
|
TERMINAL_AGENT_PREFIX,
|
|
1238
1327
|
UNKNOWN_MODEL_PRICING,
|
|
@@ -1246,6 +1335,7 @@ export {
|
|
|
1246
1335
|
getIntegrationBranding,
|
|
1247
1336
|
getIntegrationsByCategory,
|
|
1248
1337
|
getPricing,
|
|
1338
|
+
getSkillDefinition,
|
|
1249
1339
|
headroomKindFor,
|
|
1250
1340
|
headroomModelPredownloadScript,
|
|
1251
1341
|
headroomPipPackage,
|
|
@@ -1256,10 +1346,12 @@ export {
|
|
|
1256
1346
|
isKnownIntegrationId,
|
|
1257
1347
|
isKnownModel,
|
|
1258
1348
|
isLinkedAgentId,
|
|
1349
|
+
isSkillId,
|
|
1259
1350
|
normalizeAgentId,
|
|
1260
1351
|
publicToInternal,
|
|
1261
1352
|
renderToLines,
|
|
1262
1353
|
resolveApiBaseUrl,
|
|
1354
|
+
skillHasRail,
|
|
1263
1355
|
toRemoteCommand,
|
|
1264
1356
|
tryGetContextWindow
|
|
1265
1357
|
};
|