aiwg 2026.7.5 → 2026.7.7

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/README.md CHANGED
@@ -1095,13 +1095,18 @@ The headline operator surface for finding and reading AIWG capabilities. Most AI
1095
1095
  aiwg discover "deploy production" # → flow-deploy-to-production
1096
1096
  aiwg discover "create intake" # → intake-* family
1097
1097
  aiwg discover "audit security" --type skill --limit 5
1098
- aiwg discover "<phrase>" --json # stable schema for sub-agents
1098
+ aiwg discover "<phrase>" --format json # stable ids for sub-agents, no paths
1099
+ aiwg discover "<phrase>" --format json --compact
1099
1100
 
1100
1101
  # Fetch the full body of a specific artifact (companion to discover)
1102
+ aiwg show skill aiwg:skill:6f1477d99813ca8d
1101
1103
  aiwg show skill flow-deploy-to-production
1102
1104
  aiwg show agent aiwg-steward
1103
1105
  aiwg show command discover
1104
1106
  aiwg show rule no-attribution
1107
+
1108
+ # Inspect Fortemi metadata and resolved paths when needed
1109
+ aiwg show metadata aiwg:skill:6f1477d99813ca8d --json
1105
1110
  ```
1106
1111
 
1107
1112
  The kernel quickrefs ship **curated, validated discovery phrases per capability domain** — phrases tested against the live scorer to surface the right top-3 candidates. The 6 self-maintenance ops (`steward`, `aiwg-doctor`, `aiwg-refresh`, `aiwg-status`, `aiwg-help`, `use`) stay loaded so the agent retains repair surfaces even when discovery itself is broken. See [`docs/discovery-and-kernel-skills.md`](docs/discovery-and-kernel-skills.md) for the full best-practices guide, ASCII flow diagrams, and verification steps.
@@ -6,7 +6,7 @@ function stableArtifactId(artifactPath) {
6
6
  return ("aiwg:artifact:" +
7
7
  createHash("sha256").update(artifactPath).digest("hex").slice(0, 16));
8
8
  }
9
- function stableRecordId(recordType, artifactPath) {
9
+ export function stableRecordId(recordType, artifactPath) {
10
10
  if (recordType === "aiwg.artifact")
11
11
  return stableArtifactId(artifactPath);
12
12
  return (recordType.replaceAll(".", ":") +
@@ -79,7 +79,7 @@ function relationshipsForEntry(entry, graph, recordTypesByPath) {
79
79
  return left.target_id.localeCompare(right.target_id);
80
80
  });
81
81
  }
82
- function recordTypeForEntry(entry, schemaVersion) {
82
+ export function recordTypeForEntry(entry, schemaVersion) {
83
83
  if (schemaVersion === "v1")
84
84
  return "aiwg.artifact";
85
85
  const normalized = entry.type.toLowerCase().replace(/_/g, "-");
@@ -228,6 +228,7 @@ function printIndexUsage() {
228
228
  console.log(' aiwg index discover "audit security" --type skill');
229
229
  console.log(' aiwg index show skill intake-wizard');
230
230
  console.log(' aiwg index show skill flow-deploy-to-production --json');
231
+ console.log(' aiwg index show metadata aiwg:skill:4840fa441622f676 --json');
231
232
  console.log(' aiwg index show agent aiwg-steward');
232
233
  console.log(' aiwg index export --format fortemi --graph project --out aiwg-fortemi-index.json');
233
234
  console.log(' aiwg index migrate-legacy --scope project --dry-run');
@@ -1113,13 +1114,13 @@ async function handleDiscover(args) {
1113
1114
  if (!phrase) {
1114
1115
  console.error('Error: aiwg index discover requires a search phrase');
1115
1116
  console.log('');
1116
- console.log('Usage: aiwg index discover "<phrase>" [--type <kinds>] [--limit N] [--json] [--graph <name>] [--backend local|fortemi-core]');
1117
+ console.log('Usage: aiwg index discover "<phrase>" [--type <kinds>] [--limit N] [--json|--format json|text] [--pretty|--compact] [--graph <name>] [--backend local|fortemi-core]');
1117
1118
  console.log('');
1118
1119
  console.log('Examples:');
1119
1120
  console.log(' aiwg index discover "create intake"');
1120
1121
  console.log(' aiwg index discover "deploy production" --limit 5');
1121
1122
  console.log(' aiwg index discover "audit security" --type skill,agent');
1122
- console.log(' aiwg index discover "intake" --json');
1123
+ console.log(' aiwg index discover "intake" --format json --pretty');
1123
1124
  process.exit(1);
1124
1125
  }
1125
1126
  const typeValue = parseFlagValue(flags, '--type', 'Error: --type requires a value');
@@ -1129,7 +1130,17 @@ async function handleDiscover(args) {
1129
1130
  .filter(Boolean);
1130
1131
  // K=5 default — see query-engine.ts comment (#1218 Wave A).
1131
1132
  const limit = parsePositiveIntegerFlag(flags, '--limit', 5, 'Error: --limit must be a positive integer');
1132
- const json = flags.includes('--json');
1133
+ const format = parseFlagValue(flags, '--format', 'Error: --format requires text or json') ?? 'text';
1134
+ if (format !== 'text' && format !== 'json') {
1135
+ console.error('Error: --format must be text or json');
1136
+ process.exit(1);
1137
+ }
1138
+ const json = flags.includes('--json') || format === 'json';
1139
+ if (flags.includes('--pretty') && flags.includes('--compact')) {
1140
+ console.error('Error: --pretty and --compact cannot be used together');
1141
+ process.exit(1);
1142
+ }
1143
+ const jsonPretty = !flags.includes('--compact');
1133
1144
  const graph = parseGraphFlag(flags);
1134
1145
  const backend = parseSearchBackendFlag(flags);
1135
1146
  await discoverCapability(cwd, {
@@ -1137,8 +1148,10 @@ async function handleDiscover(args) {
1137
1148
  typeFilter,
1138
1149
  limit,
1139
1150
  json,
1151
+ jsonPretty,
1140
1152
  graph,
1141
1153
  backend,
1154
+ includePaths: false,
1142
1155
  });
1143
1156
  }
1144
1157
  /**
@@ -1155,7 +1168,7 @@ async function handleDiscover(args) {
1155
1168
  * the artifact body so consumers don't need to navigate the filesystem.
1156
1169
  */
1157
1170
  async function handleShow(args) {
1158
- const { showArtifact } = await import('./query-engine.js');
1171
+ const { showArtifact, showMetadata } = await import('./query-engine.js');
1159
1172
  const cwd = process.cwd();
1160
1173
  const positional = [];
1161
1174
  const flags = [];
@@ -1172,6 +1185,7 @@ async function handleShow(args) {
1172
1185
  const HELP_TEXT = [
1173
1186
  '',
1174
1187
  'Usage: aiwg show <type> <name> [--json] [--first] [--graph <name>] [--backend local|fortemi-core]',
1188
+ ' aiwg show metadata <id-or-name-or-path> [--json] [--first] [--graph <name>] [--backend local|fortemi-core]',
1175
1189
  ' aiwg index show <type> <name> ...',
1176
1190
  '',
1177
1191
  'Types: skill | agent | command | rule',
@@ -1179,16 +1193,22 @@ async function handleShow(args) {
1179
1193
  'Examples:',
1180
1194
  ' aiwg show skill intake-wizard',
1181
1195
  ' aiwg show skill flow-deploy-to-production --json',
1196
+ ' aiwg show metadata aiwg:skill:4840fa441622f676 --json',
1182
1197
  ' aiwg show agent aiwg-steward',
1183
1198
  ' aiwg show command discover',
1184
1199
  '',
1185
- 'Tip: use `aiwg discover "<phrase>"` first to find the right name.',
1200
+ 'Tip: use `aiwg discover "<phrase>" --json` first to find the stable id.',
1186
1201
  ].join('\n');
1187
1202
  if (positional.length === 0) {
1188
1203
  console.error('Error: aiwg show requires a type and name');
1189
1204
  console.error(HELP_TEXT);
1190
1205
  process.exit(1);
1191
1206
  }
1207
+ const firstLower = positional[0].toLowerCase();
1208
+ const metadataMode = firstLower === 'metadata';
1209
+ if (metadataMode) {
1210
+ positional.shift();
1211
+ }
1192
1212
  // Wave A (#1218): if the first positional is a known type, treat it
1193
1213
  // as the type. If it's NOT a known type, fall through to single-name
1194
1214
  // mode — `aiwg show intake-wizard` works as long as the name is
@@ -1196,8 +1216,15 @@ async function handleShow(args) {
1196
1216
  // with the disambiguation list (existing behavior in showArtifact).
1197
1217
  let type = null;
1198
1218
  let name;
1199
- const firstLower = positional[0].toLowerCase();
1200
- if (ALLOWED_TYPES.includes(firstLower)) {
1219
+ if (metadataMode) {
1220
+ name = positional.join(' ').trim();
1221
+ if (!name) {
1222
+ console.error('Error: aiwg show metadata requires an id, name, or path');
1223
+ console.error(HELP_TEXT);
1224
+ process.exit(1);
1225
+ }
1226
+ }
1227
+ else if (ALLOWED_TYPES.includes(firstLower)) {
1201
1228
  type = firstLower;
1202
1229
  name = positional.slice(1).join(' ').trim();
1203
1230
  if (!name) {
@@ -1225,13 +1252,17 @@ async function handleShow(args) {
1225
1252
  }
1226
1253
  const graph = parseGraphFlag(flags);
1227
1254
  const backend = parseSearchBackendFlag(flags);
1228
- await showArtifact(cwd, {
1255
+ const params = {
1229
1256
  name,
1230
1257
  typeFilter: type ? [type] : undefined,
1231
1258
  json,
1232
1259
  first,
1233
1260
  graph,
1234
1261
  backend,
1235
- });
1262
+ };
1263
+ if (metadataMode)
1264
+ await showMetadata(cwd, params);
1265
+ else
1266
+ await showArtifact(cwd, params);
1236
1267
  }
1237
1268
  //# sourceMappingURL=cli.js.map
@@ -85,7 +85,7 @@ function matchesPath(recordPath, pattern) {
85
85
  }
86
86
  return recordPath.includes(pattern);
87
87
  }
88
- function loadFortemiCoreExport(cwd, graph = "project") {
88
+ export function loadFortemiCoreExport(cwd, graph = "project") {
89
89
  let status = getFortemiCoreSyncStatus(cwd, graph);
90
90
  if ((!status.optedIn || !status.built || status.stale) && graph === "framework") {
91
91
  const prebuilt = getFortemiCorePrebuiltStatus(graph);