@yagni-app/code 1.0.8 → 1.1.0

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 (35) hide show
  1. package/README.md +39 -3
  2. package/dist/cli.js +1 -1
  3. package/dist/connectClaudeCode.d.ts +4 -3
  4. package/dist/connectClaudeCode.js +70 -37
  5. package/dist/connectCodex.d.ts +6 -2
  6. package/dist/connectCodex.js +43 -22
  7. package/dist/connectFiles.d.ts +5 -0
  8. package/dist/connectFiles.js +49 -0
  9. package/dist/extension/hooks.d.ts +13 -3
  10. package/dist/extension/hooks.js +170 -5
  11. package/dist/extension/mcp/cliConfig.d.ts +1 -1
  12. package/dist/extension/mcp/cliConfig.js +1 -1
  13. package/dist/extension/mcp/config.d.ts +2 -0
  14. package/dist/extension/mcp/config.js +2 -0
  15. package/dist/extension/mcp/tools.js +69 -6
  16. package/dist/extension/pipeline/scrubSecrets.js +5 -0
  17. package/dist/extension/resilientFetch.d.ts +3 -3
  18. package/dist/extension/resilientFetch.js +7 -4
  19. package/dist/extension/sandbox/config.d.ts +6 -1
  20. package/dist/extension/sandbox/config.js +19 -1
  21. package/dist/extension/sandbox/manager.d.ts +9 -2
  22. package/dist/extension/sandbox/manager.js +30 -5
  23. package/dist/extension/sandbox/panel.js +2 -1
  24. package/dist/extension/sandbox/session.js +7 -0
  25. package/dist/extension/sandbox/worktreeGit.d.ts +57 -0
  26. package/dist/extension/sandbox/worktreeGit.js +157 -0
  27. package/dist/extension/telemetry/attrs.d.ts +7 -0
  28. package/dist/extension/telemetry/attrs.js +7 -0
  29. package/dist/extension/telemetry/tracker.js +8 -1
  30. package/dist/mcpCommand.d.ts +7 -0
  31. package/dist/mcpCommand.js +161 -18
  32. package/dist/refresh.js +5 -2
  33. package/dist/token.d.ts +2 -1
  34. package/dist/token.js +29 -3
  35. package/package.json +2 -2
package/dist/token.js CHANGED
@@ -12,14 +12,40 @@
12
12
  */
13
13
  import { classifyTokenExpiry } from "./launch.js";
14
14
  import { maybeRefreshAtLaunch } from "./refresh.js";
15
- import { credentialsFromProfile, persistProfileTokenRotation, readActiveProfile, } from "./profiles.js";
16
- export async function tokenCommand(deps = {}) {
15
+ import { credentialsFromProfile, persistProfileTokenRotation, readActiveProfile, readProfile as readNamedProfile, isValidProfileName, } from "./profiles.js";
16
+ export async function tokenCommand(deps = {}, args = []) {
17
17
  const readProfile = deps.readProfile ?? readActiveProfile;
18
18
  const refresh = deps.refresh ?? maybeRefreshAtLaunch;
19
19
  const persist = deps.persist ?? persistProfileTokenRotation;
20
20
  const stdout = deps.stdout ?? ((t) => process.stdout.write(t));
21
21
  const stderr = deps.stderr ?? ((t) => process.stderr.write(t));
22
- const profile = await readProfile();
22
+ let profile;
23
+ if (args.length > 0) {
24
+ const options = new Map();
25
+ for (let i = 0; i < args.length; i += 2) {
26
+ const key = args[i];
27
+ const value = args[i + 1];
28
+ if (!["--profile", "--base-url"].includes(key) || !value || options.has(key)) {
29
+ stderr("Usage: yagni token [--profile <name> --base-url <url>]\n");
30
+ return 1;
31
+ }
32
+ options.set(key, value);
33
+ }
34
+ const name = options.get("--profile");
35
+ const baseUrl = options.get("--base-url");
36
+ if (!name || !isValidProfileName(name) || !baseUrl) {
37
+ stderr("A valid --profile and --base-url are both required.\n");
38
+ return 1;
39
+ }
40
+ profile = await (deps.readNamedProfile ?? readNamedProfile)(name);
41
+ if (!profile || profile.baseUrl.replace(/\/+$/, "") !== baseUrl.replace(/\/+$/, "")) {
42
+ stderr("The connected YAGNI profile is missing or its URL changed. Re-run yagni connect for this client.\n");
43
+ return 1;
44
+ }
45
+ }
46
+ else {
47
+ profile = await readProfile();
48
+ }
23
49
  let creds = credentialsFromProfile(profile);
24
50
  if (!creds?.token) {
25
51
  stderr(`Not logged in to environment "${profile.name}" (${profile.baseUrl}). Run \`yagni login\` first.\n`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yagni-app/code",
3
- "version": "1.0.8",
3
+ "version": "1.1.0",
4
4
  "description": "YAGNI Code: a terminal coding agent that already knows your company. One YAGNI login routes the model and grounds the agent in your team's context.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "author": "YAGNI, Inc. <jack@yagni.app> (https://yagni.app)",
@@ -58,5 +58,5 @@
58
58
  "turndown": "^7.2.4",
59
59
  "typebox": "^1.3.15"
60
60
  },
61
- "yagniSourceSha": "9b213ea65690a4544d0cdf093b6903aab8a1456b"
61
+ "yagniSourceSha": "0ba465bf11818ab831d132603f7dff64e5cf99c5"
62
62
  }