create-openagent 0.3.0 → 0.4.0
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/CHANGELOG.md +5 -0
- package/README.md +1 -1
- package/dist/index.js +15 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ explicit receiver trust, authenticated HTTP requests and animated avatars run
|
|
|
5
5
|
locally without a Life account or a hosted identity service.
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npx create-openagent@0.
|
|
8
|
+
npx create-openagent@0.4.0 my-agent-app --yes
|
|
9
9
|
cd my-agent-app
|
|
10
10
|
npm install
|
|
11
11
|
npm run dev
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { fileURLToPath } from "url";
|
|
|
8
8
|
// package.json
|
|
9
9
|
var package_default = {
|
|
10
10
|
name: "create-openagent",
|
|
11
|
-
version: "0.
|
|
11
|
+
version: "0.4.0",
|
|
12
12
|
description: "Create a working OpenAgentID app with local identity, real verification and live avatars.",
|
|
13
13
|
license: "Apache-2.0 OR MIT",
|
|
14
14
|
author: "L1fe Labs, Inc. <eng@l1fe.ai>",
|
|
@@ -155,7 +155,7 @@ function generateStarterTemplate(projectName) {
|
|
|
155
155
|
identity: "node src/identity.mjs",
|
|
156
156
|
test: "node --test test/*.test.mjs"
|
|
157
157
|
},
|
|
158
|
-
dependencies: { "@openagentid/sdk": "0.
|
|
158
|
+
dependencies: { "@openagentid/sdk": "0.6.0" }
|
|
159
159
|
}, null, 2) + "\n" },
|
|
160
160
|
{ path: ".gitignore", content: "node_modules/\n.openagent/\ncoverage/\n.env\n" },
|
|
161
161
|
{ path: "src/workspaces.mjs", content: workspaces },
|
|
@@ -433,17 +433,25 @@ var html = String.raw`<!doctype html>
|
|
|
433
433
|
<p id="identity"></p><div class="controls"><label>Family <select id="skin"></select></label>
|
|
434
434
|
<label>Kind <select id="shape"></select></label>
|
|
435
435
|
<label>Expression <select id="expression"><option value="">Follow actual status</option></select></label></div>
|
|
436
|
+
<fieldset><legend>Accessories</legend><div id="accessories" class="controls"></div></fieldset>
|
|
436
437
|
<p>In another terminal, run:</p><pre>npm run agent -- "Hello from my agent"</pre>
|
|
437
438
|
<p>This viewer is read-only. A completed request appears after the receiver verifies a fresh signed proof.</p>
|
|
438
439
|
<p>Keys stay on this computer. No account or identity service is required.</p></main></body></html>
|
|
439
440
|
`;
|
|
440
|
-
var css = String.raw`:root{font-family:system-ui,sans-serif;color:#ecf0f5;background:#10151c;color-scheme:dark}body{margin:0}main{max-width:760px;margin:0 auto;padding:48px 24px}h1{font-size:clamp(2rem,6vw,3.8rem);letter-spacing:-.05em;margin:12px 0}p{line-height:1.6;color:#bdc8d6}.eyebrow{font-size:.85rem;letter-spacing:.1em;text-transform:uppercase}#avatar{height:300px;display:flex;align-items:center;justify-content:center;margin:12px 0}#avatar svg{max-width:100%;height:280px;border-radius:50%;overflow:hidden}#identity{font-family:monospace;font-size:.85rem;overflow-wrap:anywhere}.controls{display:flex;gap:24px;flex-wrap:wrap}label{display:flex;gap:10px;align-items:center}select{appearance:none;padding:8px 38px 8px 12px;border-radius:8px;background-color:#222d3b;background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:right 17px center,right 12px center;background-size:5px 5px;background-repeat:no-repeat;color:inherit;border:1px solid #516176}@media(forced-colors:active){select{appearance:auto;background-image:none}}pre{padding:18px;white-space:pre-wrap;background:#1b2532;border-radius:12px;border:1px solid #344458}#status{font-weight:600;color:#fff}
|
|
441
|
+
var css = String.raw`:root{font-family:system-ui,sans-serif;color:#ecf0f5;background:#10151c;color-scheme:dark}body{margin:0}main{max-width:760px;margin:0 auto;padding:48px 24px}h1{font-size:clamp(2rem,6vw,3.8rem);letter-spacing:-.05em;margin:12px 0}p{line-height:1.6;color:#bdc8d6}.eyebrow{font-size:.85rem;letter-spacing:.1em;text-transform:uppercase}#avatar{height:300px;display:flex;align-items:center;justify-content:center;margin:12px 0}#avatar svg{max-width:100%;height:280px;border-radius:50%;overflow:hidden}#identity{font-family:monospace;font-size:.85rem;overflow-wrap:anywhere}.controls{display:flex;gap:24px;flex-wrap:wrap}label{display:flex;gap:10px;align-items:center}fieldset{border:0;margin:24px 0;padding:0;min-width:0}legend{padding:0;margin-bottom:12px}input[type=checkbox]{width:18px;height:18px;accent-color:#1687ff}select{appearance:none;padding:8px 38px 8px 12px;border-radius:8px;background-color:#222d3b;background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:right 17px center,right 12px center;background-size:5px 5px;background-repeat:no-repeat;color:inherit;border:1px solid #516176}@media(forced-colors:active){select{appearance:auto;background-image:none}}pre{padding:18px;white-space:pre-wrap;background:#1b2532;border-radius:12px;border:1px solid #344458}#status{font-weight:600;color:#fff}
|
|
441
442
|
`;
|
|
442
|
-
var viewer = String.raw`import { mountCharacter, getCharacterExpressions, getCharacterSkins } from '/character-player.js';
|
|
443
|
+
var viewer = String.raw`import { mountCharacter, getCharacterExpressions, getCharacterSkins, getCharacterAccessories } from '/character-player.js';
|
|
443
444
|
|
|
444
445
|
const skin = document.querySelector('#skin');
|
|
445
446
|
const shape = document.querySelector('#shape');
|
|
446
447
|
const catalog = getCharacterSkins();
|
|
448
|
+
const accessories = document.querySelector('#accessories');
|
|
449
|
+
const selectedAccessories = () => Array.from(accessories.querySelectorAll('input:checked'), input => input.value);
|
|
450
|
+
for (const accessory of getCharacterAccessories()) {
|
|
451
|
+
const label = document.createElement('label');
|
|
452
|
+
const input = document.createElement('input'); input.type = 'checkbox'; input.value = accessory.id;
|
|
453
|
+
label.append(input, document.createTextNode(accessory.label)); accessories.append(label);
|
|
454
|
+
}
|
|
447
455
|
const display = value => value.replaceAll('-', ' ').replace(/^./, letter => letter.toUpperCase());
|
|
448
456
|
skin.replaceChildren(...catalog.map(entry => new Option(entry.label, entry.id)));
|
|
449
457
|
skin.value = 'autos';
|
|
@@ -461,6 +469,7 @@ for (const value of getCharacterExpressions()) {
|
|
|
461
469
|
let player, did, revision = -1, latestStatus = 'idle', stopped = false, timer;
|
|
462
470
|
skin.addEventListener('change', () => { kinds(); player?.setAppearance({ skin: skin.value }); });
|
|
463
471
|
shape.addEventListener('change', () => player?.setAppearance({ shape: shape.value || null }));
|
|
472
|
+
accessories.addEventListener('change', () => player?.setAppearance({ accessories: selectedAccessories() }));
|
|
464
473
|
expression.addEventListener('change', () => player?.update({ status: latestStatus, expression: expression.value || null }));
|
|
465
474
|
async function refresh() {
|
|
466
475
|
try {
|
|
@@ -472,7 +481,7 @@ async function refresh() {
|
|
|
472
481
|
!['idle', 'working', 'success'].includes(state.status) || !Number.isSafeInteger(state.completedRequests) || state.completedRequests < 0) throw new Error('Invalid receiver state.');
|
|
473
482
|
if (!player || state.did !== did) {
|
|
474
483
|
player?.dispose(); document.querySelector('#avatar').replaceChildren();
|
|
475
|
-
did = state.did; player = mountCharacter(document.querySelector('#avatar'), did, { skin: skin.value, ...(shape.value ? { shape: shape.value } : {}), size: 280, reducedMotion: 'system' });
|
|
484
|
+
did = state.did; player = mountCharacter(document.querySelector('#avatar'), did, { skin: skin.value, accessories: selectedAccessories(), ...(shape.value ? { shape: shape.value } : {}), size: 280, reducedMotion: 'system' });
|
|
476
485
|
identity.textContent = did; revision = -1;
|
|
477
486
|
}
|
|
478
487
|
if (state.revision !== revision) {
|
|
@@ -493,7 +502,7 @@ Requires Node 20+. Run npm install, then npm run dev. Open the numeric loopback
|
|
|
493
502
|
|
|
494
503
|
npm run agent -- "Hello from my agent"
|
|
495
504
|
|
|
496
|
-
The command obtains a receiver-issued challenge, signs it with a persisted Ed25519 key, and sends a proof. After verification, the receiver hashes and echoes the message. The browser shows the real completed-request count, animated Autos by default, 16 optional families (including SpaceX and seasonal characters), distinct kinds, face framing and selectable expressions. It does not simulate work or broadcast runtime state elsewhere. Reduced motion follows your browser preference.
|
|
505
|
+
The command obtains a receiver-issued challenge, signs it with a persisted Ed25519 key, and sends a proof. After verification, the receiver hashes and echoes the message. The browser shows the real completed-request count, animated Autos by default, 16 optional families (including SpaceX and seasonal characters), distinct kinds, face framing, combinable glasses/headphones and selectable expressions. It does not simulate work or broadcast runtime state elsewhere. Reduced motion follows your browser preference.
|
|
497
506
|
|
|
498
507
|
On first setup, src/workspaces.mjs creates two separate local authorities, persists a unique receiver audience and explicitly imports the signer's public DID/key document into the receiver with trustIdentity. The receiver has no signing key for that agent. The public export is .openagent/identity.json. Private keys, challenge and replay state remain under .openagent/ and are excluded from git. Inspect public identity with npm run identity -- export. Never publish .openagent/ or serve it as static assets.
|
|
499
508
|
|
package/package.json
CHANGED