@newtype-ai/nit 0.4.16 → 0.4.18

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.
@@ -125,7 +125,7 @@ async function resolveHead(nitDir) {
125
125
  return (await fs2.readFile(refPath, "utf-8")).trim();
126
126
  } catch {
127
127
  throw new Error(
128
- `Branch ref ${head.ref} does not exist. Repository may be empty.`
128
+ `Branch ref ${head.ref} does not exist. Workspace may be empty.`
129
129
  );
130
130
  }
131
131
  }
@@ -3270,22 +3270,14 @@ var NIT_DIR = ".nit";
3270
3270
  var CARD_FILE = "agent-card.json";
3271
3271
  var DEFAULT_API_BASE = "https://api.newtype-ai.org";
3272
3272
  function findNitDir(startDir) {
3273
- let dir = resolve2(startDir || process.cwd());
3274
- while (true) {
3275
- const candidate = join5(dir, NIT_DIR);
3276
- try {
3277
- const s = statSync(candidate);
3278
- if (s.isDirectory()) return candidate;
3279
- } catch {
3280
- }
3281
- const parent = resolve2(dir, "..");
3282
- if (parent === dir) {
3283
- throw new Error(
3284
- "Not a nit repository (or any parent directory). Run `nit init` first."
3285
- );
3286
- }
3287
- dir = parent;
3273
+ const dir = resolve2(startDir || process.cwd());
3274
+ const candidate = join5(dir, NIT_DIR);
3275
+ try {
3276
+ const s = statSync(candidate);
3277
+ if (s.isDirectory()) return candidate;
3278
+ } catch {
3288
3279
  }
3280
+ throw new Error("Not a nit workspace. Run `nit init` first.");
3289
3281
  }
3290
3282
  function projectDir(nitDir) {
3291
3283
  return resolve2(nitDir, "..");
@@ -3365,6 +3357,8 @@ async function init(options) {
3365
3357
  if (!card.url) {
3366
3358
  card.url = `https://agent-${agentId}.newtype-ai.org`;
3367
3359
  }
3360
+ const walletAddresses = await getWalletAddresses(nitDir);
3361
+ card.wallet = { solana: walletAddresses.solana, evm: walletAddresses.ethereum };
3368
3362
  await writeWorkingCard(nitDir, card);
3369
3363
  const cardJson = JSON.stringify(card, null, 2);
3370
3364
  const cardHash = await writeObject(nitDir, "card", cardJson);
@@ -3385,7 +3379,6 @@ async function init(options) {
3385
3379
  skillsDir
3386
3380
  });
3387
3381
  const nitSkillPath = await createNitSkill(skillsDir);
3388
- const walletAddresses = await getWalletAddresses(nitDir);
3389
3382
  return {
3390
3383
  agentId,
3391
3384
  publicKey: publicKeyField,
@@ -3502,6 +3495,8 @@ async function commit(message, options) {
3502
3495
  card = await resolveSkillPointers(card, projDir);
3503
3496
  const pubBase64 = await loadPublicKey(nitDir);
3504
3497
  card.publicKey = formatPublicKeyField(pubBase64);
3498
+ const walletAddrs = await getWalletAddresses(nitDir);
3499
+ card.wallet = { solana: walletAddrs.solana, evm: walletAddrs.ethereum };
3505
3500
  await writeWorkingCard(nitDir, card);
3506
3501
  const cardJson = JSON.stringify(card, null, 2);
3507
3502
  const cardHash = await writeObject(nitDir, "card", cardJson);
package/dist/cli.js CHANGED
@@ -25,7 +25,7 @@ import {
25
25
  sign,
26
26
  signTx,
27
27
  status
28
- } from "./chunk-VFH4LLX2.js";
28
+ } from "./chunk-MZBUNLHW.js";
29
29
  import "./chunk-M6SR6QMR.js";
30
30
  import "./chunk-4HRQSCNQ.js";
31
31
 
@@ -40,7 +40,7 @@ var FETCH_TIMEOUT_MS = 3e3;
40
40
  var REGISTRY_URL = "https://registry.npmjs.org/@newtype-ai/nit/latest";
41
41
  function getCurrentVersion() {
42
42
  try {
43
- return "0.4.16";
43
+ return "0.4.18";
44
44
  } catch {
45
45
  return "0.0.0";
46
46
  }
@@ -210,7 +210,7 @@ async function main() {
210
210
  }
211
211
  async function cmdInit() {
212
212
  const result = await init();
213
- console.log(bold("Initialized nit repository"));
213
+ console.log(bold("Initialized nit workspace"));
214
214
  console.log();
215
215
  console.log(` Agent ID: ${green(result.agentId)}`);
216
216
  console.log(` Public key: ${dim(result.publicKey)}`);
package/dist/index.d.ts CHANGED
@@ -55,6 +55,11 @@ interface AgentCard {
55
55
  url: string;
56
56
  /** Format: "ed25519:<base64>" — present only on main branch */
57
57
  publicKey?: string;
58
+ /** Chain wallet addresses derived from the agent's Ed25519 keypair. */
59
+ wallet?: {
60
+ solana: string;
61
+ evm: string;
62
+ };
58
63
  defaultInputModes: string[];
59
64
  defaultOutputModes: string[];
60
65
  skills: AgentCardSkill[];
@@ -283,8 +288,8 @@ declare function signEvmHash(nitDir: string, hash: Uint8Array): Promise<{
283
288
  declare function signSolanaBytes(nitDir: string, message: Uint8Array): Promise<Uint8Array>;
284
289
 
285
290
  /**
286
- * Walk up from startDir looking for a .nit/ directory.
287
- * Returns the path to .nit/ or throws if not found.
291
+ * Find .nit/ in the given directory (or cwd).
292
+ * Identity is explicit no upward directory walking.
288
293
  */
289
294
  declare function findNitDir(startDir?: string): string;
290
295
  interface InitResult {
@@ -297,7 +302,7 @@ interface InitResult {
297
302
  nitSkillPath: string;
298
303
  }
299
304
  /**
300
- * Initialize a new nit repository in the project directory.
305
+ * Initialize a new nit workspace in the project directory.
301
306
  *
302
307
  * 1. Create .nit/ directory structure
303
308
  * 2. Generate Ed25519 keypair
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ import {
32
32
  signSolanaBytes,
33
33
  signTx,
34
34
  status
35
- } from "./chunk-VFH4LLX2.js";
35
+ } from "./chunk-MZBUNLHW.js";
36
36
  import {
37
37
  NIT_NAMESPACE,
38
38
  deriveAgentId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newtype-ai/nit",
3
- "version": "0.4.16",
3
+ "version": "0.4.18",
4
4
  "description": "Version control for agent cards",
5
5
  "type": "module",
6
6
  "bin": {