deepline 0.3.53 → 0.3.54

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.
@@ -199,7 +199,7 @@ export const SDK_RELEASE = {
199
199
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
200
200
  // getters keep their established compatibility behavior.
201
201
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
202
- version: '0.3.53',
202
+ version: '0.3.54',
203
203
  updateSummary:
204
204
  'Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.',
205
205
  packageCapabilities: {
package/dist/cli/index.js CHANGED
@@ -1075,7 +1075,7 @@ var SDK_RELEASE = {
1075
1075
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
1076
1076
  // getters keep their established compatibility behavior.
1077
1077
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
1078
- version: "0.3.53",
1078
+ version: "0.3.54",
1079
1079
  updateSummary: "Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.",
1080
1080
  packageCapabilities: {
1081
1081
  updatePreferences: 1
@@ -7989,6 +7989,16 @@ function savePendingClaim(baseUrl, claim) {
7989
7989
  mode: 384
7990
7990
  });
7991
7991
  }
7992
+ function resolvePendingAuthClaimForResume(baseUrl, requestedScope) {
7993
+ if (requestedScope) {
7994
+ const claim = readPendingAuthClaim(baseUrl, requestedScope);
7995
+ return { claim, scope: claim?.scope ?? requestedScope };
7996
+ }
7997
+ const folder = readPendingAuthClaim(baseUrl, "folder");
7998
+ if (folder) return { claim: folder, scope: folder.scope };
7999
+ const global = readPendingAuthClaim(baseUrl, "global");
8000
+ return { claim: global, scope: global?.scope ?? "global" };
8001
+ }
7992
8002
  function readPendingAuthClaim(baseUrl, scope) {
7993
8003
  let filePath;
7994
8004
  try {
@@ -8019,7 +8029,12 @@ function readPendingAuthClaim(baseUrl, scope) {
8019
8029
  return {
8020
8030
  claimToken,
8021
8031
  claimUrl: typeof parsed.claimUrl === "string" ? parsed.claimUrl.trim() : "",
8022
- scope
8032
+ // The record's own scope, when it has one. `register` writes this field
8033
+ // precisely so a resume can learn where the credential belongs; reading
8034
+ // back the caller's argument instead made it decorative, and a record
8035
+ // found by searching would have reported the scope of the search rather
8036
+ // than the scope it was created with.
8037
+ scope: parsed.scope === "folder" || parsed.scope === "global" ? parsed.scope : scope
8023
8038
  };
8024
8039
  } catch {
8025
8040
  return null;
@@ -8205,12 +8220,13 @@ async function printClaimSuccessBanner(baseUrl, apiKey, statusData) {
8205
8220
  async function handleRegister(args) {
8206
8221
  const baseUrl = autoDetectBaseUrl().replace(/\/$/, "");
8207
8222
  let orgName = "";
8223
+ let orgId = "";
8208
8224
  let agentName = "";
8209
8225
  let waitMode;
8210
8226
  let authScope;
8211
8227
  try {
8212
8228
  waitMode = parseRegisterWaitMode(args);
8213
- authScope = parseAuthScope(args);
8229
+ authScope = args.includes("--auth-scope") ? parseAuthScope(args) : args.includes("--org-id") ? "folder" : "global";
8214
8230
  if (authScope === "folder") {
8215
8231
  pendingClaimPath(baseUrl, authScope);
8216
8232
  }
@@ -8220,6 +8236,7 @@ async function handleRegister(args) {
8220
8236
  }
8221
8237
  for (let i = 0; i < args.length; i++) {
8222
8238
  if (args[i] === "--org-name" && args[i + 1]) orgName = args[++i];
8239
+ else if (args[i] === "--org-id" && args[i + 1]) orgId = args[++i];
8223
8240
  else if (args[i] === "--agent-name" && args[i + 1]) agentName = args[++i];
8224
8241
  }
8225
8242
  if (!agentName) {
@@ -8231,6 +8248,7 @@ async function handleRegister(args) {
8231
8248
  }
8232
8249
  const payload = {};
8233
8250
  if (orgName) payload.org_name = orgName;
8251
+ if (orgId) payload.org_id = orgId;
8234
8252
  if (agentName) payload.agent_name = agentName;
8235
8253
  const { status, data } = await httpJson(
8236
8254
  "POST",
@@ -8321,12 +8339,14 @@ async function handleRegister(args) {
8321
8339
  async function handleWait(args) {
8322
8340
  const baseUrl = autoDetectBaseUrl().replace(/\/$/, "");
8323
8341
  let timeoutSeconds = 300;
8324
- let authScope;
8325
- try {
8326
- authScope = parseAuthScope(args);
8327
- } catch (error) {
8328
- console.error(error instanceof Error ? error.message : String(error));
8329
- return 2;
8342
+ let requestedScope;
8343
+ if (args.includes("--auth-scope")) {
8344
+ try {
8345
+ requestedScope = parseAuthScope(args);
8346
+ } catch (error) {
8347
+ console.error(error instanceof Error ? error.message : String(error));
8348
+ return 2;
8349
+ }
8330
8350
  }
8331
8351
  for (let i = 0; i < args.length; i++) {
8332
8352
  if (args[i] === "--timeout" && args[i + 1]) {
@@ -8336,7 +8356,9 @@ async function handleWait(args) {
8336
8356
  }
8337
8357
  }
8338
8358
  }
8339
- const pendingClaim = readPendingAuthClaim(baseUrl, authScope);
8359
+ const resumed = resolvePendingAuthClaimForResume(baseUrl, requestedScope);
8360
+ const pendingClaim = resumed.claim;
8361
+ const authScope = resumed.scope;
8340
8362
  const claimToken = pendingClaim?.claimToken ?? "";
8341
8363
  if (!pendingClaim) {
8342
8364
  const scopedApiKey = authScope === "folder" ? resolveProjectApiKeyForBaseUrl(baseUrl) : resolveGlobalApiKeyForBaseUrl(baseUrl);
@@ -8442,7 +8464,10 @@ async function handleStatus(args) {
8442
8464
  }
8443
8465
  const apiKey = authScope === "folder" ? resolveProjectApiKeyForBaseUrl(baseUrl) : authScope === "global" ? resolveGlobalApiKeyForBaseUrl(baseUrl) : resolveApiKeyForBaseUrl(baseUrl);
8444
8466
  if (!apiKey) {
8445
- const pendingClaim = authScope ? readPendingAuthClaim(baseUrl, authScope) : readPendingAuthClaim(baseUrl, "folder") ?? readPendingAuthClaim(baseUrl, "global");
8467
+ const { claim: pendingClaim } = resolvePendingAuthClaimForResume(
8468
+ baseUrl,
8469
+ authScope ?? void 0
8470
+ );
8446
8471
  if (pendingClaim) {
8447
8472
  printCommandEnvelope(
8448
8473
  {
@@ -8632,13 +8657,17 @@ Examples:
8632
8657
  deepline auth register --wait no
8633
8658
  deepline auth register --auth-scope folder --wait no
8634
8659
  `
8635
- ).option("--org-name <name>", "Workspace name to prefill").option("--agent-name <name>", "Agent name to register").option("--wait <mode>", "Wait mode: auto, yes, or no", "auto").option("--no-wait", "Alias for --wait no").option(
8660
+ ).option("--org-name <name>", "Workspace name to prefill").option(
8661
+ "--org-id <id>",
8662
+ "Bind to this workspace directly, skipping the browser picker"
8663
+ ).option("--agent-name <name>", "Agent name to register").option("--wait <mode>", "Wait mode: auto, yes, or no", "auto").option("--no-wait", "Alias for --wait no").option(
8636
8664
  "--auth-scope <scope>",
8637
8665
  "Credential scope: global or folder",
8638
8666
  "global"
8639
8667
  ).action(async (options) => {
8640
8668
  process.exitCode = await handleRegister([
8641
8669
  ...options.orgName ? ["--org-name", options.orgName] : [],
8670
+ ...options.orgId ? ["--org-id", String(options.orgId)] : [],
8642
8671
  ...options.agentName ? ["--agent-name", options.agentName] : [],
8643
8672
  ...options.noWait || options.wait === false ? ["--wait", "no"] : ["--wait", String(options.wait ?? "auto")],
8644
8673
  "--auth-scope",
@@ -34658,6 +34687,8 @@ async function runSetupCommand(options) {
34658
34687
  });
34659
34688
  const doctorChecks = asRecord3(doctorPayload?.checks);
34660
34689
  const apiCheck = asRecord3(doctorChecks?.api);
34690
+ const workspaceRecord = asRecord3(apiCheck?.workspace);
34691
+ const workspaceName = typeof workspaceRecord?.name === "string" && workspaceRecord.name.trim() ? workspaceRecord.name.trim() : null;
34661
34692
  printCommandEnvelope(
34662
34693
  {
34663
34694
  ok: true,
@@ -34681,7 +34712,10 @@ async function runSetupCommand(options) {
34681
34712
  {
34682
34713
  title: "setup",
34683
34714
  lines: [
34684
- "Deepline is installed and connected.",
34715
+ workspaceName ? `Deepline is installed and connected to ${workspaceName}.` : "Deepline is installed and connected.",
34716
+ ...workspaceName ? [
34717
+ "To link a different workspace, run: deepline auth register"
34718
+ ] : [],
34685
34719
  `Use ${DEEPLINE_GTM_SKILL} in your agent.`,
34686
34720
  ...DEEPLINE_GTM_STARTER_PROMPTS.map(
34687
34721
  (example, index) => `${index + 1}. ${example.title}: ${example.prompt}`
@@ -1060,7 +1060,7 @@ var SDK_RELEASE = {
1060
1060
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
1061
1061
  // getters keep their established compatibility behavior.
1062
1062
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
1063
- version: "0.3.53",
1063
+ version: "0.3.54",
1064
1064
  updateSummary: "Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.",
1065
1065
  packageCapabilities: {
1066
1066
  updatePreferences: 1
@@ -7986,6 +7986,16 @@ function savePendingClaim(baseUrl, claim) {
7986
7986
  mode: 384
7987
7987
  });
7988
7988
  }
7989
+ function resolvePendingAuthClaimForResume(baseUrl, requestedScope) {
7990
+ if (requestedScope) {
7991
+ const claim = readPendingAuthClaim(baseUrl, requestedScope);
7992
+ return { claim, scope: claim?.scope ?? requestedScope };
7993
+ }
7994
+ const folder = readPendingAuthClaim(baseUrl, "folder");
7995
+ if (folder) return { claim: folder, scope: folder.scope };
7996
+ const global = readPendingAuthClaim(baseUrl, "global");
7997
+ return { claim: global, scope: global?.scope ?? "global" };
7998
+ }
7989
7999
  function readPendingAuthClaim(baseUrl, scope) {
7990
8000
  let filePath;
7991
8001
  try {
@@ -8016,7 +8026,12 @@ function readPendingAuthClaim(baseUrl, scope) {
8016
8026
  return {
8017
8027
  claimToken,
8018
8028
  claimUrl: typeof parsed.claimUrl === "string" ? parsed.claimUrl.trim() : "",
8019
- scope
8029
+ // The record's own scope, when it has one. `register` writes this field
8030
+ // precisely so a resume can learn where the credential belongs; reading
8031
+ // back the caller's argument instead made it decorative, and a record
8032
+ // found by searching would have reported the scope of the search rather
8033
+ // than the scope it was created with.
8034
+ scope: parsed.scope === "folder" || parsed.scope === "global" ? parsed.scope : scope
8020
8035
  };
8021
8036
  } catch {
8022
8037
  return null;
@@ -8202,12 +8217,13 @@ async function printClaimSuccessBanner(baseUrl, apiKey, statusData) {
8202
8217
  async function handleRegister(args) {
8203
8218
  const baseUrl = autoDetectBaseUrl().replace(/\/$/, "");
8204
8219
  let orgName = "";
8220
+ let orgId = "";
8205
8221
  let agentName = "";
8206
8222
  let waitMode;
8207
8223
  let authScope;
8208
8224
  try {
8209
8225
  waitMode = parseRegisterWaitMode(args);
8210
- authScope = parseAuthScope(args);
8226
+ authScope = args.includes("--auth-scope") ? parseAuthScope(args) : args.includes("--org-id") ? "folder" : "global";
8211
8227
  if (authScope === "folder") {
8212
8228
  pendingClaimPath(baseUrl, authScope);
8213
8229
  }
@@ -8217,6 +8233,7 @@ async function handleRegister(args) {
8217
8233
  }
8218
8234
  for (let i = 0; i < args.length; i++) {
8219
8235
  if (args[i] === "--org-name" && args[i + 1]) orgName = args[++i];
8236
+ else if (args[i] === "--org-id" && args[i + 1]) orgId = args[++i];
8220
8237
  else if (args[i] === "--agent-name" && args[i + 1]) agentName = args[++i];
8221
8238
  }
8222
8239
  if (!agentName) {
@@ -8228,6 +8245,7 @@ async function handleRegister(args) {
8228
8245
  }
8229
8246
  const payload = {};
8230
8247
  if (orgName) payload.org_name = orgName;
8248
+ if (orgId) payload.org_id = orgId;
8231
8249
  if (agentName) payload.agent_name = agentName;
8232
8250
  const { status, data } = await httpJson(
8233
8251
  "POST",
@@ -8318,12 +8336,14 @@ async function handleRegister(args) {
8318
8336
  async function handleWait(args) {
8319
8337
  const baseUrl = autoDetectBaseUrl().replace(/\/$/, "");
8320
8338
  let timeoutSeconds = 300;
8321
- let authScope;
8322
- try {
8323
- authScope = parseAuthScope(args);
8324
- } catch (error) {
8325
- console.error(error instanceof Error ? error.message : String(error));
8326
- return 2;
8339
+ let requestedScope;
8340
+ if (args.includes("--auth-scope")) {
8341
+ try {
8342
+ requestedScope = parseAuthScope(args);
8343
+ } catch (error) {
8344
+ console.error(error instanceof Error ? error.message : String(error));
8345
+ return 2;
8346
+ }
8327
8347
  }
8328
8348
  for (let i = 0; i < args.length; i++) {
8329
8349
  if (args[i] === "--timeout" && args[i + 1]) {
@@ -8333,7 +8353,9 @@ async function handleWait(args) {
8333
8353
  }
8334
8354
  }
8335
8355
  }
8336
- const pendingClaim = readPendingAuthClaim(baseUrl, authScope);
8356
+ const resumed = resolvePendingAuthClaimForResume(baseUrl, requestedScope);
8357
+ const pendingClaim = resumed.claim;
8358
+ const authScope = resumed.scope;
8337
8359
  const claimToken = pendingClaim?.claimToken ?? "";
8338
8360
  if (!pendingClaim) {
8339
8361
  const scopedApiKey = authScope === "folder" ? resolveProjectApiKeyForBaseUrl(baseUrl) : resolveGlobalApiKeyForBaseUrl(baseUrl);
@@ -8439,7 +8461,10 @@ async function handleStatus(args) {
8439
8461
  }
8440
8462
  const apiKey = authScope === "folder" ? resolveProjectApiKeyForBaseUrl(baseUrl) : authScope === "global" ? resolveGlobalApiKeyForBaseUrl(baseUrl) : resolveApiKeyForBaseUrl(baseUrl);
8441
8463
  if (!apiKey) {
8442
- const pendingClaim = authScope ? readPendingAuthClaim(baseUrl, authScope) : readPendingAuthClaim(baseUrl, "folder") ?? readPendingAuthClaim(baseUrl, "global");
8464
+ const { claim: pendingClaim } = resolvePendingAuthClaimForResume(
8465
+ baseUrl,
8466
+ authScope ?? void 0
8467
+ );
8443
8468
  if (pendingClaim) {
8444
8469
  printCommandEnvelope(
8445
8470
  {
@@ -8629,13 +8654,17 @@ Examples:
8629
8654
  deepline auth register --wait no
8630
8655
  deepline auth register --auth-scope folder --wait no
8631
8656
  `
8632
- ).option("--org-name <name>", "Workspace name to prefill").option("--agent-name <name>", "Agent name to register").option("--wait <mode>", "Wait mode: auto, yes, or no", "auto").option("--no-wait", "Alias for --wait no").option(
8657
+ ).option("--org-name <name>", "Workspace name to prefill").option(
8658
+ "--org-id <id>",
8659
+ "Bind to this workspace directly, skipping the browser picker"
8660
+ ).option("--agent-name <name>", "Agent name to register").option("--wait <mode>", "Wait mode: auto, yes, or no", "auto").option("--no-wait", "Alias for --wait no").option(
8633
8661
  "--auth-scope <scope>",
8634
8662
  "Credential scope: global or folder",
8635
8663
  "global"
8636
8664
  ).action(async (options) => {
8637
8665
  process.exitCode = await handleRegister([
8638
8666
  ...options.orgName ? ["--org-name", options.orgName] : [],
8667
+ ...options.orgId ? ["--org-id", String(options.orgId)] : [],
8639
8668
  ...options.agentName ? ["--agent-name", options.agentName] : [],
8640
8669
  ...options.noWait || options.wait === false ? ["--wait", "no"] : ["--wait", String(options.wait ?? "auto")],
8641
8670
  "--auth-scope",
@@ -34746,6 +34775,8 @@ async function runSetupCommand(options) {
34746
34775
  });
34747
34776
  const doctorChecks = asRecord3(doctorPayload?.checks);
34748
34777
  const apiCheck = asRecord3(doctorChecks?.api);
34778
+ const workspaceRecord = asRecord3(apiCheck?.workspace);
34779
+ const workspaceName = typeof workspaceRecord?.name === "string" && workspaceRecord.name.trim() ? workspaceRecord.name.trim() : null;
34749
34780
  printCommandEnvelope(
34750
34781
  {
34751
34782
  ok: true,
@@ -34769,7 +34800,10 @@ async function runSetupCommand(options) {
34769
34800
  {
34770
34801
  title: "setup",
34771
34802
  lines: [
34772
- "Deepline is installed and connected.",
34803
+ workspaceName ? `Deepline is installed and connected to ${workspaceName}.` : "Deepline is installed and connected.",
34804
+ ...workspaceName ? [
34805
+ "To link a different workspace, run: deepline auth register"
34806
+ ] : [],
34773
34807
  `Use ${DEEPLINE_GTM_SKILL} in your agent.`,
34774
34808
  ...DEEPLINE_GTM_STARTER_PROMPTS.map(
34775
34809
  (example, index) => `${index + 1}. ${example.title}: ${example.prompt}`
package/dist/index.js CHANGED
@@ -816,7 +816,7 @@ var SDK_RELEASE = {
816
816
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
817
817
  // getters keep their established compatibility behavior.
818
818
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
819
- version: "0.3.53",
819
+ version: "0.3.54",
820
820
  updateSummary: "Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.",
821
821
  packageCapabilities: {
822
822
  updatePreferences: 1
package/dist/index.mjs CHANGED
@@ -738,7 +738,7 @@ var SDK_RELEASE = {
738
738
  // available at toolResponse.rawV2 while toolResponse.raw and all declared
739
739
  // getters keep their established compatibility behavior.
740
740
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
741
- version: "0.3.53",
741
+ version: "0.3.54",
742
742
  updateSummary: "Automatic CLI updates are now enabled by default. To opt out, run `deepline settings autoupdate off`; use `deepline settings autoupdate on` to re-enable updates or `deepline settings autoupdate pin <version>` to hold an exact release. This release also adds raw-v2 tool responses at toolResponse.rawV2 while preserving existing toolResponse.raw and declared getters.",
743
743
  packageCapabilities: {
744
744
  updatePreferences: 1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.3.53",
3
+ "version": "0.3.54",
4
4
  "description": "GTM data CLI and TypeScript SDK for coding agents",
5
5
  "license": "MIT",
6
6
  "homepage": "https://code.deepline.com",