@codeam/shared 2.61.21 → 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.mjs CHANGED
@@ -801,6 +801,17 @@ var INTEGRATION_BRANDING = {
801
801
  brandColor: "#FFFFFF",
802
802
  logoSvg: '<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path fill="#FFFFFF" d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>'
803
803
  },
804
+ // npm — a brand-only entry (NOT an `IntegrationId`): the registry the
805
+ // codeam-cli ships to. Present so surfaces like the Wiki can render the
806
+ // official npm mark from the ONE shared catalog instead of a loose asset.
807
+ npm: {
808
+ id: "npm",
809
+ name: "npm",
810
+ vendor: "npm, Inc.",
811
+ tagline: "The Node package registry",
812
+ brandColor: "#CB3837",
813
+ logoSvg: '<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>npm</title><path fill="#CB3837" d="M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.08 19.17H5.113z"/></svg>'
814
+ },
804
815
  jira: {
805
816
  // Branding key kept 'jira' for id-stability; DISPLAY rebranded to Atlassian
806
817
  // (the one integration fronts both Jira + Confluence via mcp-atlassian).
@@ -1011,6 +1022,94 @@ function getIntegrationBranding(id) {
1011
1022
  return INTEGRATION_BRANDING[id] ?? null;
1012
1023
  }
1013
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
+
1014
1113
  // src/api-url.ts
1015
1114
  var DEFAULT_API_BASE_URL = "https://api.codeagent-mobile.com";
1016
1115
  var DEV_API_BASE_URL = "https://dev-api.codeagent-mobile.com";
@@ -1222,6 +1321,7 @@ export {
1222
1321
  PREVIEW_DETECT_PROMPT,
1223
1322
  PROTOCOL_VERSION,
1224
1323
  PUBLIC_TO_INTERNAL,
1324
+ SKILL_REGISTRY,
1225
1325
  SSE_SOCKET_TIMEOUT_MS,
1226
1326
  TERMINAL_AGENT_PREFIX,
1227
1327
  UNKNOWN_MODEL_PRICING,
@@ -1235,6 +1335,7 @@ export {
1235
1335
  getIntegrationBranding,
1236
1336
  getIntegrationsByCategory,
1237
1337
  getPricing,
1338
+ getSkillDefinition,
1238
1339
  headroomKindFor,
1239
1340
  headroomModelPredownloadScript,
1240
1341
  headroomPipPackage,
@@ -1245,10 +1346,12 @@ export {
1245
1346
  isKnownIntegrationId,
1246
1347
  isKnownModel,
1247
1348
  isLinkedAgentId,
1349
+ isSkillId,
1248
1350
  normalizeAgentId,
1249
1351
  publicToInternal,
1250
1352
  renderToLines,
1251
1353
  resolveApiBaseUrl,
1354
+ skillHasRail,
1252
1355
  toRemoteCommand,
1253
1356
  tryGetContextWindow
1254
1357
  };