dlw-machine-setup 0.7.1 → 0.8.1

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.
Files changed (2) hide show
  1. package/bin/installer.js +49 -29
  2. package/package.json +1 -1
package/bin/installer.js CHANGED
@@ -3888,7 +3888,9 @@ var claudeCodeProfile = {
3888
3888
  handlers: {
3889
3889
  agent: {
3890
3890
  supported: true,
3891
- destination: (name) => `.claude/agents/${name}.md`
3891
+ // File agents land at `.claude/agents/<name>.md`; folder agents
3892
+ // (persona bundles like jay/, monty/) land at `.claude/agents/<name>/`.
3893
+ destination: (name, isDir) => `.claude/agents/${name}${isDir ? "" : ".md"}`
3892
3894
  },
3893
3895
  skill: {
3894
3896
  supported: true,
@@ -3903,6 +3905,13 @@ var claudeCodeProfile = {
3903
3905
  },
3904
3906
  "instructions-snippet": {
3905
3907
  supported: true
3908
+ },
3909
+ workspace: {
3910
+ supported: true,
3911
+ // Bundle workspace payload (workflow scripts, shared definitions,
3912
+ // README) lands under `.claude/factory/`. Matches the path pattern
3913
+ // used historically by Factory's v1 ops and gitignored entries.
3914
+ destination: (name) => `.claude/factory/${name}`
3906
3915
  }
3907
3916
  }
3908
3917
  };
@@ -3914,26 +3923,37 @@ var githubCopilotProfile = {
3914
3923
  handlers: {
3915
3924
  agent: {
3916
3925
  supported: true,
3917
- // TODO(phase-3): verify destination path against Copilot CLI docs.
3918
- destination: (name) => `.github/agents/${name}.md`
3919
- // TODO(phase-3): supply frontmatter rewriter that maps Claude's
3920
- // {name, description, disable-model-invocation, ...} to whatever
3921
- // Copilot expects ({name, description, category, version, ...}).
3926
+ // Copilot only registers agents that match `.agent.md` literally.
3927
+ // File agents `.github/agents/<name>.agent.md` (registered).
3928
+ // Folder agents (persona bundles like jay/, monty/, shared/)
3929
+ // `.github/agents/<name>/` (placed alongside, but Copilot ignores
3930
+ // them because they don't match `.agent.md`). That's intentional:
3931
+ // these are Claude-specific personas, but shipping the files
3932
+ // means a user who switches agents later still has them on disk.
3933
+ destination: (name, isDir) => `.github/agents/${name}${isDir ? "" : ".agent.md"}`
3922
3934
  },
3923
3935
  skill: {
3924
3936
  supported: true,
3925
- // TODO(phase-3): verify destination path against Copilot CLI docs.
3926
- destination: (name) => `.github/skills/${name}.skill.md`
3927
- // TODO(phase-3): supply frontmatter rewriter.
3937
+ destination: (name) => `.github/skills/${name}/SKILL.md`
3928
3938
  },
3929
3939
  hook: {
3930
- // TODO(phase-3): verify whether Copilot CLI has a hook primitive.
3931
- // If yes, flip to supported: true and fill in configFile/configKey/scriptDir.
3932
- // If no, leave as unsupported assets of type 'hook' are silently skipped.
3940
+ // Hooks are Claude-only by policy (see plan doc). The bundle's
3941
+ // hook-related ops are gated with `when: 'hooks-supported'`, so
3942
+ // Copilot installs ship no hook events, no hook scripts, and no
3943
+ // statusLine setting. Phase 4 (Copilot hook implementation) was
3944
+ // canceled — this is the permanent final state.
3933
3945
  supported: false
3934
3946
  },
3935
3947
  "instructions-snippet": {
3936
3948
  supported: true
3949
+ },
3950
+ workspace: {
3951
+ supported: true,
3952
+ // Bundle workspace payload (workflow scripts, shared definitions,
3953
+ // README) lands under `.github/factory/`. Keeps Factory's
3954
+ // supporting material under the namespaced .github/ tree where
3955
+ // Copilot already reads everything else from.
3956
+ destination: (name) => `.github/factory/${name}`
3937
3957
  }
3938
3958
  }
3939
3959
  };
@@ -3946,7 +3966,8 @@ var cursorProfile = {
3946
3966
  agent: { supported: false },
3947
3967
  skill: { supported: false },
3948
3968
  hook: { supported: false },
3949
- "instructions-snippet": { supported: true }
3969
+ "instructions-snippet": { supported: true },
3970
+ workspace: { supported: false }
3950
3971
  }
3951
3972
  };
3952
3973
 
@@ -4015,6 +4036,7 @@ function runBundleV2(manifest, ctx) {
4015
4036
  runMergeJson({ op: "merge-json", file, patch }, manifest.name, ctx, result);
4016
4037
  }
4017
4038
  for (const op of manifest.ops ?? []) {
4039
+ if (op.when === "hooks-supported" && !profile.handlers.hook.supported) continue;
4018
4040
  executeOp(op, manifest.name, ctx, result);
4019
4041
  result.opsExecuted++;
4020
4042
  }
@@ -4042,20 +4064,25 @@ function runAsset(asset, profile, hookPatches, ctx, result) {
4042
4064
  result.instructionsSnippet = asset.content;
4043
4065
  }
4044
4066
  return;
4067
+ case "workspace":
4068
+ runAssetCopy(asset, profile.handlers.workspace, ctx, result);
4069
+ return;
4045
4070
  }
4046
4071
  }
4047
4072
  function runAssetCopy(asset, handler, ctx, result) {
4048
4073
  if (!handler.supported || !handler.destination) return;
4049
4074
  const source = resolveBundlePath(asset.source, ctx);
4050
4075
  if (!(0, import_fs6.existsSync)(source)) return;
4051
- const target = resolveProjectPath(handler.destination(asset.name), ctx);
4052
- if ((0, import_fs6.statSync)(source).isDirectory()) {
4076
+ const isDirectory = (0, import_fs6.statSync)(source).isDirectory();
4077
+ const targetRel = handler.destination(asset.name, isDirectory);
4078
+ const target = resolveProjectPath(targetRel, ctx);
4079
+ if (isDirectory) {
4053
4080
  copyDirectory(source, target);
4054
4081
  } else {
4055
4082
  (0, import_fs6.mkdirSync)((0, import_path6.dirname)(target), { recursive: true });
4056
4083
  (0, import_fs6.copyFileSync)(source, target);
4057
4084
  }
4058
- result.filesTouched.push(handler.destination(asset.name));
4085
+ result.filesTouched.push(targetRel);
4059
4086
  }
4060
4087
  function accumulateHook(asset, handler, hookPatches, ctx, result) {
4061
4088
  if (!handler.supported) return;
@@ -4227,14 +4254,8 @@ function assertBundleRootExists(ctx) {
4227
4254
  }
4228
4255
 
4229
4256
  // src/steps/resources/fetch-factory.ts
4230
- function getFactoryAsset(agent) {
4231
- switch (agent) {
4232
- case "github-copilot":
4233
- return { assetName: "factory-copilot.tar.gz", rootFolder: "factory-copilot" };
4234
- default:
4235
- return { assetName: "factory.tar.gz", rootFolder: "factory" };
4236
- }
4237
- }
4257
+ var FACTORY_ASSET_NAME = "factory.tar.gz";
4258
+ var FACTORY_ROOT_FOLDER = "factory";
4238
4259
  var fetch_factory_default = defineStep({
4239
4260
  name: "fetch-factory",
4240
4261
  label: "Installing Factory framework",
@@ -4253,7 +4274,6 @@ var fetch_factory_default = defineStep({
4253
4274
  });
4254
4275
  async function fetchFactory(token, repo, targetDir, agent) {
4255
4276
  const result = { success: false, filesInstalled: [] };
4256
- const { assetName, rootFolder } = getFactoryAsset(agent);
4257
4277
  let release;
4258
4278
  try {
4259
4279
  release = await fetchLatestRelease(token, repo);
@@ -4261,18 +4281,18 @@ async function fetchFactory(token, repo, targetDir, agent) {
4261
4281
  result.failureReason = err instanceof Error ? err.message : String(err);
4262
4282
  return result;
4263
4283
  }
4264
- const asset = release.assets.find((a) => a.name === assetName);
4284
+ const asset = release.assets.find((a) => a.name === FACTORY_ASSET_NAME);
4265
4285
  if (!asset) {
4266
- result.failureReason = `${assetName} not found in release`;
4286
+ result.failureReason = `${FACTORY_ASSET_NAME} not found in release`;
4267
4287
  return result;
4268
4288
  }
4269
4289
  let archive = null;
4270
4290
  try {
4271
4291
  archive = await downloadAndExtractAsset(token, asset, targetDir, ".temp-factory-download");
4272
4292
  const extractedEntries = (0, import_fs7.readdirSync)(archive.extractedRoot);
4273
- const extractedFolder = extractedEntries.find((e) => e.toLowerCase() === rootFolder.toLowerCase());
4293
+ const extractedFolder = extractedEntries.find((e) => e.toLowerCase() === FACTORY_ROOT_FOLDER.toLowerCase());
4274
4294
  if (!extractedFolder) {
4275
- result.failureReason = `No ${rootFolder}/ folder in archive`;
4295
+ result.failureReason = `No ${FACTORY_ROOT_FOLDER}/ folder in archive`;
4276
4296
  return result;
4277
4297
  }
4278
4298
  const extractedPath = (0, import_path7.join)(archive.extractedRoot, extractedFolder);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dlw-machine-setup",
3
- "version": "0.7.1",
3
+ "version": "0.8.1",
4
4
  "description": "One-shot installer for The Machine toolchain",
5
5
  "bin": {
6
6
  "dlw-machine-setup": "bin/installer.js"