clawdentity 0.0.0 → 0.0.2

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
@@ -17080,6 +17080,9 @@ var ENV_KEY_MAP = {
17080
17080
  registryUrl: "CLAWDENTITY_REGISTRY_URL",
17081
17081
  apiKey: "CLAWDENTITY_API_KEY"
17082
17082
  };
17083
+ var LEGACY_ENV_KEY_MAP = {
17084
+ registryUrl: ["CLAWDENTITY_REGISTRY"]
17085
+ };
17083
17086
  var DEFAULT_CONFIG = {
17084
17087
  registryUrl: DEFAULT_REGISTRY_URL
17085
17088
  };
@@ -17126,7 +17129,10 @@ var readConfig = async () => {
17126
17129
  var resolveConfig = async () => {
17127
17130
  const config2 = await readConfig();
17128
17131
  for (const key of Object.keys(ENV_KEY_MAP)) {
17129
- const envVar = process.env[ENV_KEY_MAP[key]];
17132
+ const envKeys = [ENV_KEY_MAP[key], ...LEGACY_ENV_KEY_MAP[key] ?? []];
17133
+ const envVar = envKeys.map((envKey) => process.env[envKey]).find((value) => {
17134
+ return typeof value === "string" && value.length > 0;
17135
+ });
17130
17136
  if (typeof envVar === "string" && envVar.length > 0) {
17131
17137
  config2[key] = envVar;
17132
17138
  }
@@ -18416,12 +18422,21 @@ var getValidatedKey = (key) => {
18416
18422
  logger5.warn("cli.invalid_config_key", { key });
18417
18423
  return void 0;
18418
18424
  };
18425
+ var getEnvRegistryUrlOverride = () => {
18426
+ const envCandidates = [
18427
+ process.env.CLAWDENTITY_REGISTRY_URL,
18428
+ process.env.CLAWDENTITY_REGISTRY
18429
+ ];
18430
+ return envCandidates.find((value) => {
18431
+ return typeof value === "string" && value.length > 0;
18432
+ });
18433
+ };
18419
18434
  var createConfigCommand = () => {
18420
18435
  const configCommand = new Command4("config").description(
18421
18436
  "Manage local CLI configuration"
18422
18437
  );
18423
- configCommand.command("init").description("Initialize local config file").action(
18424
- withErrorHandling("config init", async () => {
18438
+ configCommand.command("init").description("Initialize local config file").option("--registry-url <url>", "Initialize config with registry URL").action(
18439
+ withErrorHandling("config init", async (options) => {
18425
18440
  const configFilePath = getConfigFilePath();
18426
18441
  try {
18427
18442
  await access2(configFilePath);
@@ -18433,9 +18448,15 @@ var createConfigCommand = () => {
18433
18448
  }
18434
18449
  }
18435
18450
  const config2 = await readConfig();
18436
- await writeConfig(config2);
18451
+ const registryUrl = options.registryUrl ?? getEnvRegistryUrlOverride() ?? config2.registryUrl;
18452
+ await writeConfig({
18453
+ ...config2,
18454
+ registryUrl
18455
+ });
18437
18456
  writeStdoutLine(`Initialized config at ${configFilePath}`);
18438
- writeStdoutLine(JSON.stringify(maskApiKey(config2), null, 2));
18457
+ writeStdoutLine(
18458
+ JSON.stringify(maskApiKey({ ...config2, registryUrl }), null, 2)
18459
+ );
18439
18460
  })
18440
18461
  );
18441
18462
  configCommand.command("set <key> <value>").description("Set a config value").action(
package/dist/index.js CHANGED
@@ -17080,6 +17080,9 @@ var ENV_KEY_MAP = {
17080
17080
  registryUrl: "CLAWDENTITY_REGISTRY_URL",
17081
17081
  apiKey: "CLAWDENTITY_API_KEY"
17082
17082
  };
17083
+ var LEGACY_ENV_KEY_MAP = {
17084
+ registryUrl: ["CLAWDENTITY_REGISTRY"]
17085
+ };
17083
17086
  var DEFAULT_CONFIG = {
17084
17087
  registryUrl: DEFAULT_REGISTRY_URL
17085
17088
  };
@@ -17126,7 +17129,10 @@ var readConfig = async () => {
17126
17129
  var resolveConfig = async () => {
17127
17130
  const config2 = await readConfig();
17128
17131
  for (const key of Object.keys(ENV_KEY_MAP)) {
17129
- const envVar = process.env[ENV_KEY_MAP[key]];
17132
+ const envKeys = [ENV_KEY_MAP[key], ...LEGACY_ENV_KEY_MAP[key] ?? []];
17133
+ const envVar = envKeys.map((envKey) => process.env[envKey]).find((value) => {
17134
+ return typeof value === "string" && value.length > 0;
17135
+ });
17130
17136
  if (typeof envVar === "string" && envVar.length > 0) {
17131
17137
  config2[key] = envVar;
17132
17138
  }
@@ -18416,12 +18422,21 @@ var getValidatedKey = (key) => {
18416
18422
  logger5.warn("cli.invalid_config_key", { key });
18417
18423
  return void 0;
18418
18424
  };
18425
+ var getEnvRegistryUrlOverride = () => {
18426
+ const envCandidates = [
18427
+ process.env.CLAWDENTITY_REGISTRY_URL,
18428
+ process.env.CLAWDENTITY_REGISTRY
18429
+ ];
18430
+ return envCandidates.find((value) => {
18431
+ return typeof value === "string" && value.length > 0;
18432
+ });
18433
+ };
18419
18434
  var createConfigCommand = () => {
18420
18435
  const configCommand = new Command4("config").description(
18421
18436
  "Manage local CLI configuration"
18422
18437
  );
18423
- configCommand.command("init").description("Initialize local config file").action(
18424
- withErrorHandling("config init", async () => {
18438
+ configCommand.command("init").description("Initialize local config file").option("--registry-url <url>", "Initialize config with registry URL").action(
18439
+ withErrorHandling("config init", async (options) => {
18425
18440
  const configFilePath = getConfigFilePath();
18426
18441
  try {
18427
18442
  await access2(configFilePath);
@@ -18433,9 +18448,15 @@ var createConfigCommand = () => {
18433
18448
  }
18434
18449
  }
18435
18450
  const config2 = await readConfig();
18436
- await writeConfig(config2);
18451
+ const registryUrl = options.registryUrl ?? getEnvRegistryUrlOverride() ?? config2.registryUrl;
18452
+ await writeConfig({
18453
+ ...config2,
18454
+ registryUrl
18455
+ });
18437
18456
  writeStdoutLine(`Initialized config at ${configFilePath}`);
18438
- writeStdoutLine(JSON.stringify(maskApiKey(config2), null, 2));
18457
+ writeStdoutLine(
18458
+ JSON.stringify(maskApiKey({ ...config2, registryUrl }), null, 2)
18459
+ );
18439
18460
  })
18440
18461
  );
18441
18462
  configCommand.command("set <key> <value>").description("Set a config value").action(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawdentity",
3
- "version": "0.0.0",
3
+ "version": "0.0.2",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -38,8 +38,9 @@ Use this skill when any of the following are requested:
38
38
 
39
39
  ## Invite Input Assumption
40
40
 
41
- Provide a valid invite code string before running this skill.
42
- Invite creation is outside this skill scope; this skill focuses on setup, pairing, and relay validation.
41
+ Invite creation is outside this skill scope. This skill consumes two invite types:
42
+ - Registry onboarding invite code (`clw_inv_...`) to obtain PAT when local API key is missing.
43
+ - OpenClaw peer relay invite code (`clawd1_...`) for `openclaw setup`.
43
44
 
44
45
  ## Human + Agent Flow (strict user-style)
45
46
 
@@ -59,14 +60,20 @@ Use these commands as the default execution path for skill utilization:
59
60
 
60
61
  - Initialize local CLI config:
61
62
  - `clawdentity config init`
63
+ - `clawdentity config init --registry-url <registry-url>` (supports first-run registry URL override)
64
+ - or set env before init: `CLAWDENTITY_REGISTRY=<registry-url>` (supports env-based first-run override)
62
65
  - Configure registry URL and API key when missing:
63
66
  - `clawdentity config set registryUrl <registry-url>`
67
+ - Complete registry onboarding when API key is missing:
68
+ - `clawdentity invite redeem <registry-invite-code>`
69
+ - `clawdentity invite redeem <registry-invite-code> --registry-url <registry-url>`
70
+ - Configure API key only for non-invite fallback:
64
71
  - `clawdentity config set apiKey <api-key>`
65
72
  - Create and inspect local OpenClaw agent identity:
66
73
  - `clawdentity agent create <agent-name> --framework openclaw`
67
74
  - `clawdentity agent inspect <agent-name>`
68
75
  - Apply OpenClaw invite setup:
69
- - `clawdentity openclaw setup <agent-name> --invite-code <invite-code>`
76
+ - `clawdentity openclaw setup <agent-name> --invite-code <peer-relay-invite-code>`
70
77
  - Start connector runtime for relay handoff:
71
78
  - `clawdentity connector start <agent-name>`
72
79
  - Optional persistent connector autostart:
@@ -90,7 +97,10 @@ Successful confirm establishes mutual trust for the two agent DIDs. After confir
90
97
 
91
98
  1. Confirm prerequisites with the human.
92
99
  - Confirm `clawdentity` CLI is installed and runnable.
93
- - Confirm API key exists for this agent (if missing, ask the human for it).
100
+ - Confirm local agent name.
101
+ - Confirm OpenClaw peer relay invite code (`clawd1_...`).
102
+ - If API key is missing, request registry onboarding invite code (`clw_inv_...`) first.
103
+ - Only ask for API key when neither local API key nor registry onboarding invite code is available.
94
104
  - Confirm OpenClaw state directory path if non-default.
95
105
  - Confirm OpenClaw base URL if local endpoint is non-default.
96
106
 
@@ -98,24 +108,31 @@ Successful confirm establishes mutual trust for the two agent DIDs. After confir
98
108
  - Ensure `~/.openclaw/workspace/skills/clawdentity-openclaw-relay/relay-to-peer.mjs` exists.
99
109
  - If missing, install/update skill package contents before setup.
100
110
 
101
- 3. Configure local Clawdentity identity for this OpenClaw agent.
111
+ 3. Initialize local Clawdentity config.
102
112
  - Run `clawdentity config init`.
103
- - If needed, ask the human for API key and run `clawdentity config set apiKey <key>`.
113
+ - Use `clawdentity config init --registry-url <registry-url>` when registry URL override is required.
114
+
115
+ 4. Complete registry onboarding auth before agent creation.
116
+ - If API key already exists, continue.
117
+ - Else redeem registry onboarding invite:
118
+ - `clawdentity invite redeem <registry-invite-code>`
119
+ - optional: `--registry-url <registry-url>`
120
+ - If registry invite code is unavailable, fallback to API key path:
121
+ - ask human for API key
122
+ - run `clawdentity config set apiKey <api-key>`
123
+
124
+ 5. Configure local Clawdentity identity for this OpenClaw agent.
104
125
  - Create identity: `clawdentity agent create <agent-name> --framework openclaw`.
105
126
  - Verify identity: `clawdentity agent inspect <agent-name>`.
106
127
 
107
- 4. Ask the human for invite code.
108
- - Prompt exactly for one invite code string.
109
- - Do not ask for DID/proxy URL when invite code is present.
110
-
111
- 5. Run automated setup from invite code.
128
+ 6. Run automated setup from peer relay invite code.
112
129
  - Execute:
113
- `clawdentity openclaw setup <agent-name> --invite-code <invite-code>`
130
+ `clawdentity openclaw setup <agent-name> --invite-code <peer-relay-invite-code>`
114
131
  - Use `--openclaw-dir <path>` when state directory is non-default.
115
132
  - Use `--openclaw-base-url <url>` when local OpenClaw HTTP endpoint is non-default.
116
133
  - Use `--peer-alias <alias>` only when alias override is required.
117
134
 
118
- 6. Verify setup outputs.
135
+ 7. Verify setup outputs.
119
136
  - Confirm setup reports:
120
137
  - peer alias
121
138
  - peer DID
@@ -125,17 +142,17 @@ Successful confirm establishes mutual trust for the two agent DIDs. After confir
125
142
  - relay runtime config path
126
143
  - Confirm `~/.clawdentity/openclaw-agent-name` is set to the local agent name.
127
144
 
128
- 7. Start connector runtime for local relay handoff.
145
+ 8. Start connector runtime for local relay handoff.
129
146
  - Run `clawdentity connector start <agent-name>`.
130
147
  - Optional: run `clawdentity connector service install <agent-name>` for persistent autostart.
131
148
 
132
- 8. Complete trust pairing bootstrap.
149
+ 9. Complete trust pairing bootstrap.
133
150
  - Run pairing start (`POST /pair/start`) from the owner/initiator side.
134
151
  - Share returned one-time `pairingCode` with responder side.
135
152
  - Run pairing confirm (`POST /pair/confirm`) from responder side.
136
153
  - Confirm pairing success before relay test.
137
154
 
138
- 9. Validate with user-style relay test.
155
+ 10. Validate with user-style relay test.
139
156
  - Run `clawdentity openclaw doctor` to verify setup health and remediation hints.
140
157
  - Run `clawdentity openclaw relay test --peer <alias>` to execute a probe.
141
158
  - Confirm probe success and connector-mediated delivery logs.
@@ -144,10 +161,12 @@ Successful confirm establishes mutual trust for the two agent DIDs. After confir
144
161
  ## Required question policy
145
162
 
146
163
  Ask the human only when required inputs are missing:
147
- - Missing Clawdentity API key.
164
+ - Missing local agent name.
165
+ - Missing peer relay invite code (`clawd1_...`).
166
+ - Missing registry onboarding invite code (`clw_inv_...`) when API key is absent.
167
+ - Missing Clawdentity API key only when registry onboarding invite code is unavailable.
148
168
  - Unclear OpenClaw state directory.
149
169
  - Non-default OpenClaw base URL.
150
- - Missing invite code.
151
170
  - Local connector runtime or peer network route is unknown or unreachable from agent runtime.
152
171
 
153
172
  ## Failure Handling
@@ -158,7 +177,7 @@ If setup or relay fails:
158
177
  - Ensure connector runtime is active (`clawdentity connector start <agent-name>`).
159
178
  - Re-run `clawdentity openclaw doctor`.
160
179
  - Re-run `clawdentity openclaw relay test --peer <alias>`.
161
- - Re-run the same user-style flow from step 5 onward only after health checks pass.
180
+ - Re-run the same user-style flow from step 6 onward only after health checks pass.
162
181
 
163
182
  ## Bundled Resources
164
183