@sequenceholdings/studio-cli 0.9.9 → 0.9.12

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 (44) hide show
  1. package/README.md +159 -24
  2. package/dist/artifact/delegate.js +8 -4
  3. package/dist/atlas-client.js +6 -57
  4. package/dist/auth.d.ts +0 -1
  5. package/dist/auth.js +9 -1
  6. package/dist/bin.js +7 -2
  7. package/dist/cli-attribution.d.ts +3 -0
  8. package/dist/cli-attribution.js +24 -0
  9. package/dist/command-contract.d.ts +8 -2
  10. package/dist/command-contract.js +3 -2
  11. package/dist/command-help.d.ts +5 -3
  12. package/dist/command-help.js +37 -4
  13. package/dist/command-telemetry.d.ts +11 -0
  14. package/dist/command-telemetry.js +97 -0
  15. package/dist/edge-auth-headers.d.ts +1 -0
  16. package/dist/edge-auth-headers.js +40 -0
  17. package/dist/functions/commands.js +1 -1
  18. package/dist/functions/manifest.js +2 -1
  19. package/dist/main.d.ts +2 -0
  20. package/dist/main.js +50 -3
  21. package/dist/orm/apply-source.d.ts +53 -0
  22. package/dist/orm/apply-source.js +86 -0
  23. package/dist/orm/delegate.js +27 -41
  24. package/dist/orm/deployment-policy.d.ts +2 -0
  25. package/dist/orm/deployment-policy.js +49 -0
  26. package/dist/orm/help.d.ts +1 -0
  27. package/dist/orm/help.js +44 -0
  28. package/dist/orm/history.d.ts +23 -0
  29. package/dist/orm/history.js +58 -0
  30. package/dist/orm/read.d.ts +1 -1
  31. package/dist/orm/read.js +4 -2
  32. package/dist/pipeline/commands.js +2 -1
  33. package/dist/pipeline/templates.js +5 -2
  34. package/dist/principals/commands.d.ts +1 -1
  35. package/dist/principals/commands.js +50 -2
  36. package/dist/process/build.js +6 -0
  37. package/dist/process/codegen.js +2 -0
  38. package/dist/process/commands.js +5 -2
  39. package/dist/process/plan-diff.js +4 -0
  40. package/dist/repos/git-credential.d.ts +8 -1
  41. package/dist/repos/git-credential.js +50 -4
  42. package/dist/templates/guidance/AGENTS.md +5 -0
  43. package/package.json +8 -8
  44. package/templates/guidance/AGENTS.md +5 -0
@@ -1,4 +1,6 @@
1
1
  import { execFile } from 'node:child_process';
2
+ import { readFile, realpath } from 'node:fs/promises';
3
+ import { basename, delimiter, dirname, isAbsolute, join, resolve } from 'node:path';
2
4
  import { promisify } from 'node:util';
3
5
  import { getAccessTokenWithMode } from '../auth.js';
4
6
  import { resolveConfiguredEnv } from '../config.js';
@@ -100,11 +102,55 @@ export async function gitCredentialResponse({ input, operation, envName, cloneUr
100
102
  function shellQuote(value) {
101
103
  return `'${value.replace(/'/g, "'\\''")}'`;
102
104
  }
105
+ async function shimRunsScript(candidate, script, target) {
106
+ const shim = await readFile(candidate, 'utf8');
107
+ if (shim.includes(`exec node "${script}" "$@"`))
108
+ return true;
109
+ // pnpm's local and global POSIX shims use $basedir to invoke the package
110
+ // bin. Resolve that literal target without executing a PATH candidate.
111
+ for (const match of shim.matchAll(/^\s*exec (?:node|"\$basedir\/node")\s+"\$basedir\/([^"]+\/dist\/bin\.js)" "\$@"\s*$/gm)) {
112
+ if (await realpath(join(dirname(candidate), match[1])) === target)
113
+ return true;
114
+ }
115
+ return false;
116
+ }
117
+ /** Select the stable launcher that invoked this CLI, not the first one on a later Git PATH. */
118
+ export async function resolveGitHelperLauncher({ scriptPath = process.argv[1], launcherHint = process.env.SEQ_STUDIO_LAUNCHER, searchPath = process.env.PATH, } = {}) {
119
+ if (!scriptPath || !isAbsolute(scriptPath))
120
+ throw new Error('Cannot identify the seq-studio launcher. Run repos clone through an installed seq-studio command.');
121
+ const script = resolve(scriptPath);
122
+ if (launcherHint && isAbsolute(launcherHint) && basename(launcherHint) === 'seq-studio') {
123
+ try {
124
+ // Our installed shell shim exports its own path before execing this build.
125
+ // Require the shim to target this exact script, so an inherited hint from
126
+ // another installation cannot make Git run a different CLI.
127
+ if ((await readFile(launcherHint, 'utf8')).includes(`exec node "${script}" "$@"`))
128
+ return resolve(launcherHint);
129
+ }
130
+ catch { /* Stale or unrelated launcher; look for a matching executable. */ }
131
+ }
132
+ if (basename(script) === 'seq-studio')
133
+ return script; // Node preserves the symlink invocation path.
134
+ const target = await realpath(script);
135
+ for (const directory of (searchPath ?? '').split(delimiter).filter(Boolean)) {
136
+ const candidate = join(directory, 'seq-studio');
137
+ try {
138
+ if (await realpath(candidate) === target)
139
+ return resolve(candidate);
140
+ }
141
+ catch { /* Not an installed launcher in this PATH entry. */ }
142
+ try {
143
+ if (await shimRunsScript(candidate, script, target))
144
+ return resolve(candidate);
145
+ }
146
+ catch { /* Not a matching generated shim. */ }
147
+ }
148
+ throw new Error('Cannot identify a stable seq-studio launcher for Git. Install this CLI with install-cli.sh or invoke its installed executable, then clone again.');
149
+ }
103
150
  /** Store only a helper command, bound to this environment and repository URL. */
104
- export async function configureGitLogin({ destDir, envName, cloneUrl, }) {
105
- // Resolve the installed CLI via PATH so package/Node upgrades do not leave
106
- // existing repositories pinned to a deleted version-specific executable.
107
- const helper = `!seq-studio auth git-credential --env ${shellQuote(envName)} --url ${shellQuote(cloneUrl)}`;
151
+ export async function configureGitLogin({ destDir, envName, cloneUrl, launcherPath, }) {
152
+ const launcher = launcherPath ?? await resolveGitHelperLauncher();
153
+ const helper = `!${shellQuote(launcher)} auth git-credential --env ${shellQuote(envName)} --url ${shellQuote(cloneUrl)}`;
108
154
  const config = async (...args) => { await exec('git', ['-C', destDir, 'config', '--local', ...args]); };
109
155
  // An empty helper resets inherited credential stores for this URL. That keeps
110
156
  // an Auth0 access token out of the user's global store/keychain on approval.
@@ -8,3 +8,8 @@ Start with that site's `/docs/llms.txt` index and follow the relevant pages as
8
8
  needed. The hosted docs are the single source of truth for platform usage;
9
9
  do not duplicate their instructions in this file. If docs access is blocked,
10
10
  open the same URL in the signed-in browser.
11
+
12
+ After concrete CLI friction costs time or retries, finish the task, then follow
13
+ the live `/seq-studio/feedback` guide and run `seq-studio feedback submit`
14
+ before the final response. Include the confirmed receipt ID and ticket URL, or
15
+ the sanitized draft and submission evidence if no receipt is confirmed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequenceholdings/studio-cli",
3
- "version": "0.9.9",
3
+ "version": "0.9.12",
4
4
  "description": "Unified Sequence Studio CLI — `seq-studio init` / `add` / `deploy` (app monorepos), `seq-studio agents`, `seq-studio process` (Lattice), `seq-studio artifact`, `seq-studio functions` / `secrets`, `seq-studio repos`, and `seq-studio auth whoami`. Includes Auth0 browser login shared with seqapi.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -43,17 +43,17 @@
43
43
  "smol-toml": "^1.9.0",
44
44
  "tsx": "^4.20.3",
45
45
  "yaml": "^2.8.4",
46
- "zod": "^4.1.13",
46
+ "zod": "4.6.6",
47
47
  "@sequenceholdings/agent-spec": "0.1.5",
48
- "@sequenceholdings/artifact-studio": "0.11.9",
49
48
  "@sequenceholdings/lattice": "0.1.8",
50
- "@sequenceholdings/managed-functions": "0.5.8",
51
- "@sequenceholdings/storage": "0.1.6",
52
- "@sequenceholdings/platform": "0.1.3"
49
+ "@sequenceholdings/artifact-studio": "0.11.11",
50
+ "@sequenceholdings/managed-functions": "0.5.9",
51
+ "@sequenceholdings/storage": "0.1.7",
52
+ "@sequenceholdings/platform": "0.1.4"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@sequenceholdings/orm": "2.8.5",
56
- "@sequenceholdings/pipeline-spec": "0.3.6"
56
+ "@sequenceholdings/pipeline-spec": "0.3.8"
57
57
  },
58
58
  "peerDependenciesMeta": {
59
59
  "@sequenceholdings/orm": {
@@ -69,7 +69,7 @@
69
69
  "@types/semver": "^7.8.0",
70
70
  "typescript": "^5.6.0",
71
71
  "vitest": "^4.1.11",
72
- "@sequenceholdings/pipeline-spec": "0.3.6",
72
+ "@sequenceholdings/pipeline-spec": "0.3.8",
73
73
  "@sequenceholdings/orm": "2.8.5"
74
74
  },
75
75
  "engines": {
@@ -8,3 +8,8 @@ Start with that site's `/docs/llms.txt` index and follow the relevant pages as
8
8
  needed. The hosted docs are the single source of truth for platform usage;
9
9
  do not duplicate their instructions in this file. If docs access is blocked,
10
10
  open the same URL in the signed-in browser.
11
+
12
+ After concrete CLI friction costs time or retries, finish the task, then follow
13
+ the live `/seq-studio/feedback` guide and run `seq-studio feedback submit`
14
+ before the final response. Include the confirmed receipt ID and ticket URL, or
15
+ the sanitized draft and submission evidence if no receipt is confirmed.