bpmax-cli 0.1.44-beta.10 → 0.1.44-beta.11

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.js CHANGED
@@ -444,7 +444,7 @@ function normalizePath2(path9) {
444
444
  // package.json
445
445
  var package_default = {
446
446
  name: "bpmax-cli",
447
- version: "0.1.44-beta.10",
447
+ version: "0.1.44-beta.11",
448
448
  description: "CLI for BPMAX environments with multi-profile config and local login callback flow",
449
449
  type: "module",
450
450
  bin: {
@@ -804,14 +804,24 @@ function createApiClient(profile) {
804
804
  $workspace: normalizeWorkspaceForApi(String(workspaceParam)),
805
805
  $language: config.params?.$language ?? profile.config.language
806
806
  };
807
- if (profile.config.api_key) {
807
+ const executionToken = process.env.BPMAX_EXECUTION_TOKEN;
808
+ if (executionToken || profile.config.api_key) {
808
809
  const headers = AxiosHeaders.from(config.headers || {});
809
- headers.set("Authorization", `Bearer ${profile.config.api_key}`);
810
+ headers.set("Authorization", `Bearer ${executionToken || profile.config.api_key}`);
810
811
  if (profile.config.terminal_id) {
811
812
  headers.set("X-BPMAX-CLI-Terminal-Id", profile.config.terminal_id);
812
813
  }
813
814
  headers.set("X-BPMAX-CLI-Version", VERSION);
814
815
  headers.set("X-BPMAX-CLI-Command", commandHeaderSummary());
816
+ if (process.env.BPMAX_AI_ACTION_KEY) {
817
+ headers.set("X-BPMAX-AI-Action-Key", process.env.BPMAX_AI_ACTION_KEY);
818
+ }
819
+ if (process.env.BPMAX_AI_SESSION_KEY) {
820
+ headers.set("X-BPMAX-AI-Session-Key", process.env.BPMAX_AI_SESSION_KEY);
821
+ }
822
+ if (process.env.BPMAX_AI_TRACE_ID) {
823
+ headers.set("X-BPMAX-AI-Trace-Id", process.env.BPMAX_AI_TRACE_ID);
824
+ }
815
825
  config.headers = headers;
816
826
  }
817
827
  return config;
@@ -10128,10 +10138,22 @@ function configDirFromArgv(argv) {
10128
10138
  }
10129
10139
  return void 0;
10130
10140
  }
10131
- program.name(CLI_NAME).description("BPMAX multi-environment CLI").version(VERSION).option("--config-dir <dir>", "Root directory for bpmax-cli local state");
10141
+ program.name(CLI_NAME).description("BPMAX multi-environment CLI").version(VERSION).option("--config-dir <dir>", "Root directory for bpmax-cli local state").option("--execution-token <token>", "Short-lived BPMAX AI execution token").option("--action-key <actionKey>", "AI action key for execution audit").option("--session-key <sessionKey>", "AI conversation session key").option("--trace-id <traceId>", "AI execution trace id");
10132
10142
  program.hook("preAction", (thisCommand) => {
10133
10143
  const options = thisCommand.optsWithGlobals();
10134
10144
  setConfigDir(options.configDir);
10145
+ if (options.executionToken) {
10146
+ process.env.BPMAX_EXECUTION_TOKEN = options.executionToken;
10147
+ }
10148
+ if (options.actionKey) {
10149
+ process.env.BPMAX_AI_ACTION_KEY = options.actionKey;
10150
+ }
10151
+ if (options.sessionKey) {
10152
+ process.env.BPMAX_AI_SESSION_KEY = options.sessionKey;
10153
+ }
10154
+ if (options.traceId) {
10155
+ process.env.BPMAX_AI_TRACE_ID = options.traceId;
10156
+ }
10135
10157
  beginCommandAuditScope();
10136
10158
  });
10137
10159
  program.hook("postAction", async () => {