@integrity-labs/agt-cli 0.28.392 → 0.28.393

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/dist/bin/agt.js CHANGED
@@ -40,7 +40,7 @@ import {
40
40
  success,
41
41
  table,
42
42
  warn
43
- } from "../chunk-SET6SREA.js";
43
+ } from "../chunk-HG2MMV5F.js";
44
44
  import {
45
45
  AnchorSessionClient,
46
46
  CHANNEL_REGISTRY,
@@ -70,7 +70,7 @@ import {
70
70
  renderTemplate,
71
71
  resolveChannels,
72
72
  serializeManifestForSlackCli
73
- } from "../chunk-IJF4W6LC.js";
73
+ } from "../chunk-7HONFACG.js";
74
74
  import "../chunk-XWVM4KPK.js";
75
75
 
76
76
  // src/bin/agt.ts
@@ -4829,7 +4829,7 @@ import { execFileSync, execSync } from "child_process";
4829
4829
  import { existsSync as existsSync10, realpathSync as realpathSync2 } from "fs";
4830
4830
  import chalk18 from "chalk";
4831
4831
  import ora16 from "ora";
4832
- var cliVersion = true ? "0.28.392" : "dev";
4832
+ var cliVersion = true ? "0.28.393" : "dev";
4833
4833
  async function fetchLatestVersion() {
4834
4834
  const host2 = getHost();
4835
4835
  if (!host2) return null;
@@ -6001,7 +6001,7 @@ function handleError(err) {
6001
6001
  }
6002
6002
 
6003
6003
  // src/bin/agt.ts
6004
- var cliVersion2 = true ? "0.28.392" : "dev";
6004
+ var cliVersion2 = true ? "0.28.393" : "dev";
6005
6005
  var program = new Command();
6006
6006
  program.name("agt").description("Augmented CLI \u2014 agent provisioning and management").version(cliVersion2).option("--json", "Emit machine-readable JSON output (suppress spinners and colors)").option("--skip-update-check", "Skip the automatic update check on startup");
6007
6007
  program.hook("preAction", async (thisCommand, actionCommand) => {
@@ -4049,6 +4049,59 @@ var OAUTH_PROVIDERS = {
4049
4049
  extraAuthorizeParams: {},
4050
4050
  clientAuthMethod: "basic",
4051
4051
  userInfoUrl: "https://api.xero.com/connections"
4052
+ },
4053
+ // LinkedIn Ads (Marketing API). Confidential client with a static secret and
4054
+ // refresh tokens (~60-day access token, ~1-year rotating refresh token), so it
4055
+ // mirrors the Xero shape: clientAuthMethod 'body', supportsRefresh true, no
4056
+ // PKCE. The shared authorize/callback/refresh machinery handles the rest.
4057
+ //
4058
+ // The single shared app is Augmented Team's own LinkedIn developer app
4059
+ // (client id/secret in OAUTH_LINKEDIN_ADS_CLIENT_ID / _SECRET) - every org
4060
+ // connects its own ad accounts against it; only the per-connection tokens
4061
+ // differ. Register `${API_PUBLIC_URL}/integrations/oauth/callback` as an
4062
+ // Authorized redirect URL on the LinkedIn app.
4063
+ //
4064
+ // NOTE (linkedin-verify): the grantable scope set depends on which LinkedIn
4065
+ // API products the app is approved for (Advertising API, Lead Sync API,
4066
+ // Community Management API). Keep this list to scopes the app actually holds -
4067
+ // requesting an ungranted scope makes LinkedIn reject the authorize request.
4068
+ "linkedin-ads": {
4069
+ definitionId: "linkedin-ads",
4070
+ authorizeUrl: "https://www.linkedin.com/oauth/v2/authorization",
4071
+ tokenUrl: "https://www.linkedin.com/oauth/v2/accessToken",
4072
+ defaultScopes: [
4073
+ "openid",
4074
+ "profile",
4075
+ "email",
4076
+ // Advertising API: read + manage campaigns/creatives, and reporting.
4077
+ "r_ads",
4078
+ "rw_ads",
4079
+ "r_ads_reporting",
4080
+ // Community Management API: organization page/follower/share statistics.
4081
+ "r_organization_social",
4082
+ // Lead Sync API: read lead-generation forms + responses.
4083
+ // linkedin-verify: `linkedin_ads_create_lead_form` WRITES a lead form, and
4084
+ // it is not obvious that `rw_ads` covers that - Lead Sync may need its own
4085
+ // write scope. Resolve this during the verification pass against the app's
4086
+ // approved products. Do NOT guess a scope string here: an ungranted or
4087
+ // misspelled scope makes LinkedIn reject the whole authorize request, so a
4088
+ // wrong guess breaks every connect, not just lead forms.
4089
+ "r_marketing_leadgen_automation"
4090
+ ],
4091
+ // Read-only variant: reporting + organization stats, no campaign/creative
4092
+ // mutation. Used when an install is (re)connected with read_only: true.
4093
+ readOnlyScopes: [
4094
+ "openid",
4095
+ "profile",
4096
+ "email",
4097
+ "r_ads",
4098
+ "r_ads_reporting",
4099
+ "r_organization_social"
4100
+ ],
4101
+ supportsRefresh: true,
4102
+ extraAuthorizeParams: {},
4103
+ clientAuthMethod: "body",
4104
+ userInfoUrl: "https://api.linkedin.com/v2/userinfo"
4052
4105
  }
4053
4106
  };
4054
4107
  function getOAuthProvider(definitionId) {
@@ -4083,7 +4136,12 @@ var HTTP_PROBE_PROVIDERS = /* @__PURE__ */ new Set([
4083
4136
  // reflects real API reachability, not a `buffer` binary on PATH. This wins
4084
4137
  // over its toolkit source_type, so the probe is honest regardless of how the
4085
4138
  // toolkit row is classified.
4086
- "buffer"
4139
+ "buffer",
4140
+ // LinkedIn Ads is a native OAuth + brokered-REST integration (Xero's shape),
4141
+ // so its honest health signal is the same: a central read-only check that the
4142
+ // stored token still authenticates. Routes to the OIDC userinfo probe in
4143
+ // connectivity-http-probes.ts.
4144
+ "linkedin-ads"
4087
4145
  // ENG-6100: GitHub is deliberately NOT here. This set drives the ASYNC
4088
4146
  // connectivity monitor's routing, where github (source_type='native')
4089
4147
  // stays host-side (cli_command — `gh`, the credential the agent actually
@@ -4875,6 +4933,11 @@ async function probeHttpProvider(definitionId, credentials, fetchImpl = fetch) {
4875
4933
  return { status: "down", message: "No Xero organisations connected" };
4876
4934
  return { status: "ok", message: `Connected to ${conns[0]?.tenantName ?? "Xero"}` };
4877
4935
  });
4936
+ case "linkedin-ads":
4937
+ return probeBearerJson("https://api.linkedin.com/v2/userinfo", credentials, fetchImpl, (body) => {
4938
+ const user = body;
4939
+ return { status: "ok", message: `Connected as ${user.name ?? user.email ?? "unknown"}` };
4940
+ });
4878
4941
  case "v0":
4879
4942
  return probeBearerJson("https://api.v0.dev/v1/user", credentials, fetchImpl, (body) => {
4880
4943
  const user = body;
@@ -12377,4 +12440,4 @@ export {
12377
12440
  stopAllSessionsAndWait,
12378
12441
  getProjectDir
12379
12442
  };
12380
- //# sourceMappingURL=chunk-IJF4W6LC.js.map
12443
+ //# sourceMappingURL=chunk-7HONFACG.js.map