@dxos/cli 0.6.7-staging.e9eb1ed → 0.6.8-main.046e6cf

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.
@@ -5,5 +5,5 @@ export default class List extends BaseCommand<typeof List> {
5
5
  static description: string;
6
6
  run(): Promise<any>;
7
7
  }
8
- export declare const printFunctions: (functions?: FunctionManifest['functions']) => void;
8
+ export declare const printFunctions: (functions?: FunctionManifest["functions"]) => void;
9
9
  //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1,26 @@
1
+ import { BaseCommand } from '../../base';
2
+ export default class Upload extends BaseCommand<typeof Upload> {
3
+ static enableJsonFlag: boolean;
4
+ static description: string;
5
+ static flags: {
6
+ name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
7
+ spaceKey: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
8
+ objectId: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ functionId: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ 'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ profile: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ timeout: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ target: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ agent: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
+ 'json-log': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
19
+ 'json-logfile': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
20
+ };
21
+ static args: {
22
+ file: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
23
+ };
24
+ run(): Promise<any>;
25
+ }
26
+ //# sourceMappingURL=upload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../../src/commands/userfunction/upload.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAIzC,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC5D,OAAgB,cAAc,UAAQ;IACtC,OAAgB,WAAW,SAA2B;IAEtD,OAAgB,KAAK;;;;;;;;;;;;;;;MASnB;IAEF,OAAgB,IAAI;;MAElB;IAEI,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CA2G1B"}
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ //
3
+ // Copyright 2024 DXOS.org
4
+ //
5
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ const core_1 = require("@oclif/core");
10
+ const node_fs_1 = __importDefault(require("node:fs"));
11
+ const echo_1 = require("@dxos/client/echo");
12
+ const echo_schema_1 = require("@dxos/echo-schema");
13
+ const invariant_1 = require("@dxos/invariant");
14
+ const types_1 = require("@dxos/plugin-markdown/types");
15
+ const edge_1 = require("@dxos/plugin-script/edge");
16
+ const types_2 = require("@dxos/plugin-script/types");
17
+ const base_1 = require("../../base");
18
+ // TODO: move to cli-composer
19
+ class Upload extends base_1.BaseCommand {
20
+ async run() {
21
+ let scriptContent;
22
+ try {
23
+ scriptContent = node_fs_1.default.readFileSync(this.args.file, 'utf8');
24
+ }
25
+ catch (err) {
26
+ this.error(`Error reading file ${this.args.file}: ${err.message}`);
27
+ }
28
+ const handleUpload = async ({ client, space }) => {
29
+ client.addTypes([types_2.ScriptType, types_1.TextType]);
30
+ const identity = client.halo.identity.get();
31
+ (0, invariant_1.invariant)(identity, 'Identity not available');
32
+ let existingFunctionId;
33
+ let existingObject;
34
+ let functionUrlFromExistingObject;
35
+ if (this.flags.functionId) {
36
+ existingFunctionId = this.flags.functionId;
37
+ }
38
+ // Find existing object and functionId in metadata if it exists
39
+ if (space && this.flags.objectId) {
40
+ const qr = await space.db.query(echo_1.Filter.schema(types_2.ScriptType)).run();
41
+ existingObject = qr.objects.find((o) => o.id === this.flags.objectId);
42
+ if (!existingObject) {
43
+ this.error(`Object not found: ${this.flags.spaceKey}/${this.flags.objectId}`);
44
+ }
45
+ functionUrlFromExistingObject = await (0, edge_1.getUserFunctionUrlInMetadata)((0, echo_schema_1.getMeta)(existingObject));
46
+ if (functionUrlFromExistingObject) {
47
+ existingFunctionId = functionUrlFromExistingObject.split('/').at(-1);
48
+ if (existingFunctionId !== this.flags.functionId) {
49
+ this.warn(`provided functionId ${this.flags.functionId} does not match existing functionId ${existingFunctionId}, using existing functionId`);
50
+ }
51
+ }
52
+ if (this.flags.verbose) {
53
+ this.log(`Uploading to existing FunctionId ${existingFunctionId} read from ${this.flags.spaceKey}/${this.flags.objectId}`);
54
+ }
55
+ }
56
+ const ownerDid = (0, edge_1.publicKeyToDid)(identity.identityKey);
57
+ let result;
58
+ try {
59
+ result = await (0, edge_1.uploadWorkerFunction)({
60
+ halo: client.halo,
61
+ clientConfig: client.config,
62
+ ownerDid,
63
+ functionId: existingFunctionId,
64
+ name: this.flags.name,
65
+ source: scriptContent,
66
+ credentialLoadTimeout: 5000,
67
+ });
68
+ if (result.result !== 'success' || result.functionId === undefined) {
69
+ this.error(`Upload failed: ${result.errorMessage}`);
70
+ }
71
+ this.log(`Uploaded function: ${result.functionId}`);
72
+ }
73
+ catch (err) {
74
+ this.error(err.message);
75
+ }
76
+ // If we haven't been provided an ECHO space/object, we're done.
77
+ if (!space) {
78
+ return;
79
+ }
80
+ if (existingObject) {
81
+ // Update existing object
82
+ await (0, echo_1.loadObjectReferences)(existingObject, (obj) => obj.source);
83
+ if (!existingObject.source) {
84
+ this.error('Object source not found');
85
+ }
86
+ existingObject.source.content = scriptContent;
87
+ if (this.flags.verbose) {
88
+ this.log(`Updated source in ${this.flags.spaceKey}/${this.flags.objectId} (${existingObject.source.id})`);
89
+ }
90
+ if (!functionUrlFromExistingObject) {
91
+ await (0, edge_1.setUserFunctionUrlInMetadata)((0, echo_schema_1.getMeta)(existingObject), `/${ownerDid}/${result.functionId}`);
92
+ }
93
+ else {
94
+ if (existingFunctionId !== result.functionId) {
95
+ this.error('functionId mismatch');
96
+ }
97
+ }
98
+ }
99
+ else {
100
+ // Create new object
101
+ // TODO: make object navigable in Composer.
102
+ const sourceObj = space.db.add((0, echo_schema_1.create)(types_1.TextType, { content: scriptContent }));
103
+ const obj = space.db.add((0, echo_schema_1.create)(types_2.ScriptType, { name: this.flags.name, source: sourceObj }));
104
+ await (0, edge_1.setUserFunctionUrlInMetadata)((0, echo_schema_1.getMeta)(obj), result.functionId);
105
+ if (this.flags.verbose) {
106
+ this.log(`Created object: ${this.flags.spaceKey}/${obj.id}`);
107
+ }
108
+ }
109
+ };
110
+ if (this.flags.spaceKey) {
111
+ return await this.execWithSpace(async ({ client, space }) => await handleUpload({ client, space }), {
112
+ spaceKeys: [this.flags.spaceKey],
113
+ });
114
+ }
115
+ return await this.execWithClient(async ({ client }) => await handleUpload({ client }));
116
+ }
117
+ }
118
+ Upload.enableJsonFlag = true;
119
+ Upload.description = 'Upload user function.';
120
+ Upload.flags = {
121
+ ...base_1.BaseCommand.flags,
122
+ name: core_1.Flags.string({ description: 'Function name.' }),
123
+ spaceKey: core_1.Flags.string({ description: 'Space key to create/update Script source in.' }),
124
+ objectId: core_1.Flags.string({ description: 'Existing Script Object ID to update.' }),
125
+ functionId: core_1.Flags.string({
126
+ description: 'Existing UserFunction ID to update.',
127
+ conflict: ['objectId', 'spaceKey'],
128
+ }),
129
+ };
130
+ Upload.args = {
131
+ file: core_1.Args.string({ required: true }),
132
+ };
133
+ exports.default = Upload;
134
+ //# sourceMappingURL=upload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../../src/commands/userfunction/upload.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;AAEF,sCAA0C;AAC1C,sDAAyB;AAGzB,4CAAiE;AAEjE,mDAA6E;AAC7E,+CAA4C;AAC5C,uDAAuD;AACvD,mDAMkC;AAClC,qDAAuD;AAEvD,qCAAyC;AAEzC,6BAA6B;AAE7B,MAAqB,MAAO,SAAQ,kBAA0B;IAmB5D,KAAK,CAAC,GAAG;QACP,IAAI,aAAiC,CAAC;QACtC,IAAI,CAAC;YACH,aAAa,GAAG,iBAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC1D,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,KAAK,CAAC,sBAAsB,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACrE,CAAC;QAED,MAAM,YAAY,GAAG,KAAK,EAAE,EAAE,MAAM,EAAE,KAAK,EAAqC,EAAE,EAAE;YAClF,MAAM,CAAC,QAAQ,CAAC,CAAC,kBAAU,EAAE,gBAAQ,CAAC,CAAC,CAAC;YACxC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;YAC5C,IAAA,qBAAS,EAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;YAE9C,IAAI,kBAAsC,CAAC;YAC3C,IAAI,cAA0D,CAAC;YAC/D,IAAI,6BAAiD,CAAC;YACtD,I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"default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.run = void 0;
21
20
  var core_1 = require("@oclif/core");
22
21
  Object.defineProperty(exports, "run", { enumerable: true, get: function () { return core_1.run; } });
23
22
  __exportStar(require("./base"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;AAEF,oCAAkC;AAAzB,2FAAA,GAAG,OAAA;AAEZ,yCAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;AAEF,oCAAkC;AAAzB,2FAAA,GAAG,OAAA;AAEZ,yCAAuB"}
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/util/publish/config.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAStC,eAAO,MAAM,UAAU,gBAAsB,MAAM,KAA+B,QAAQ,MAAM,CAoB/F,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/util/publish/config.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAStC,eAAO,MAAM,UAAU,gBAAsB,MAAM,KAA+B,OAAO,CAAC,MAAM,CAoB/F,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ipfs-upload.d.ts","sourceRoot":"","sources":["../../../../src/util/publish/ipfs-upload.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAK/D,UAAU,aAAa;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAGD,eAAO,MAAM,YAAY,eAAsB,aAAa,QAAQ,MAAM,YAAY,aAAa,KAAG,QAAQ,GAAG,CA2ChH,CAAC"}
1
+ {"version":3,"file":"ipfs-upload.d.ts","sourceRoot":"","sources":["../../../../src/util/publish/ipfs-upload.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAK/D,UAAU,aAAa;IACrB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAGD,eAAO,MAAM,YAAY,eAAsB,aAAa,QAAQ,MAAM,YAAY,aAAa,KAAG,OAAO,CAAC,GAAG,CA2ChH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../../src/util/publish/publish.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAa3D,UAAU,cAAc;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,eAAO,MAAM,OAAO,yDAAgE,cAAc,KAAG,QAAQ,GAAG,CAiC/G,CAAC"}
1
+ {"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../../src/util/publish/publish.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAa3D,UAAU,cAAc;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,eAAO,MAAM,OAAO,yDAAgE,cAAc,KAAG,OAAO,CAAC,GAAG,CAiC/G,CAAC"}
@@ -5233,7 +5233,7 @@
5233
5233
  "name": {
5234
5234
  "description": "Tunnel name",
5235
5235
  "name": "name",
5236
- "default": "two-single-five-december",
5236
+ "default": "sweet-saturn-nuts-low",
5237
5237
  "hasDynamicHelp": false,
5238
5238
  "multiple": false,
5239
5239
  "type": "option"
@@ -5370,6 +5370,145 @@
5370
5370
  "list.js"
5371
5371
  ]
5372
5372
  },
5373
+ "userfunction:upload": {
5374
+ "aliases": [],
5375
+ "args": {
5376
+ "file": {
5377
+ "name": "file",
5378
+ "required": true
5379
+ }
5380
+ },
5381
+ "description": "Upload user function.",
5382
+ "flags": {
5383
+ "json": {
5384
+ "description": "Output as JSON.",
5385
+ "name": "json",
5386
+ "allowNo": false,
5387
+ "type": "boolean"
5388
+ },
5389
+ "verbose": {
5390
+ "char": "v",
5391
+ "description": "Verbose output",
5392
+ "name": "verbose",
5393
+ "allowNo": false,
5394
+ "type": "boolean"
5395
+ },
5396
+ "dry-run": {
5397
+ "description": "Dry run.",
5398
+ "name": "dry-run",
5399
+ "allowNo": false,
5400
+ "type": "boolean"
5401
+ },
5402
+ "profile": {
5403
+ "description": "User profile.",
5404
+ "env": "DX_PROFILE",
5405
+ "name": "profile",
5406
+ "default": "default",
5407
+ "hasDynamicHelp": false,
5408
+ "multiple": false,
5409
+ "type": "option"
5410
+ },
5411
+ "config": {
5412
+ "aliases": [
5413
+ "c"
5414
+ ],
5415
+ "dependsOn": [
5416
+ "profile"
5417
+ ],
5418
+ "description": "Config file.",
5419
+ "env": "DX_CONFIG",
5420
+ "name": "config",
5421
+ "default": "/home/runner/.config/dx/profile/default.yml",
5422
+ "hasDynamicHelp": false,
5423
+ "helpValue": "path",
5424
+ "multiple": false,
5425
+ "type": "option"
5426
+ },
5427
+ "timeout": {
5428
+ "aliases": [
5429
+ "t"
5430
+ ],
5431
+ "description": "Timeout (ms).",
5432
+ "name": "timeout",
5433
+ "default": 60000,
5434
+ "hasDynamicHelp": false,
5435
+ "multiple": false,
5436
+ "type": "option"
5437
+ },
5438
+ "target": {
5439
+ "description": "Target websocket server.",
5440
+ "name": "target",
5441
+ "hasDynamicHelp": false,
5442
+ "multiple": false,
5443
+ "type": "option"
5444
+ },
5445
+ "agent": {
5446
+ "description": "Run command with agent.",
5447
+ "env": "DX_NO_AGENT",
5448
+ "name": "agent",
5449
+ "allowNo": true,
5450
+ "type": "boolean"
5451
+ },
5452
+ "json-log": {
5453
+ "description": "When running in foreground, log JSON format",
5454
+ "name": "json-log",
5455
+ "allowNo": false,
5456
+ "type": "boolean"
5457
+ },
5458
+ "json-logfile": {
5459
+ "description": "JSON log file destination, or 'stdout' or 'stderr'",
5460
+ "name": "json-logfile",
5461
+ "default": "stderr",
5462
+ "hasDynamicHelp": false,
5463
+ "multiple": false,
5464
+ "type": "option"
5465
+ },
5466
+ "name": {
5467
+ "description": "Function name.",
5468
+ "name": "name",
5469
+ "hasDynamicHelp": false,
5470
+ "multiple": false,
5471
+ "type": "option"
5472
+ },
5473
+ "spaceKey": {
5474
+ "description": "Space key to create/update Script source in.",
5475
+ "name": "spaceKey",
5476
+ "hasDynamicHelp": false,
5477
+ "multiple": false,
5478
+ "type": "option"
5479
+ },
5480
+ "objectId": {
5481
+ "description": "Existing Script Object ID to update.",
5482
+ "name": "objectId",
5483
+ "hasDynamicHelp": false,
5484
+ "multiple": false,
5485
+ "type": "option"
5486
+ },
5487
+ "functionId": {
5488
+ "description": "Existing UserFunction ID to update.",
5489
+ "name": "functionId",
5490
+ "hasDynamicHelp": false,
5491
+ "multiple": false,
5492
+ "type": "option"
5493
+ }
5494
+ },
5495
+ "hasDynamicHelp": false,
5496
+ "hiddenAliases": [],
5497
+ "id": "userfunction:upload",
5498
+ "pluginAlias": "@dxos/cli",
5499
+ "pluginName": "@dxos/cli",
5500
+ "pluginType": "core",
5501
+ "strict": true,
5502
+ "enableJsonFlag": true,
5503
+ "isESM": false,
5504
+ "relativePath": [
5505
+ "dist",
5506
+ "src",
5507
+ "commands",
5508
+ "userfunction",
5509
+ "upload.js"
5510
+ ]
5511
+ },
5373
5512
  "function:trigger:list": {
5374
5513
  "aliases": [],
5375
5514
  "args": {},
@@ -5866,5 +6005,5 @@
5866
6005
  ]
5867
6006
  }
5868
6007
  },
5869
- "version": "0.6.7-staging.e9eb1ed"
6008
+ "version": "0.6.8-main.046e6cf"
5870
6009
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/cli",
3
- "version": "0.6.7-staging.e9eb1ed",
3
+ "version": "0.6.8-main.046e6cf",
4
4
  "description": "DXOS CLI",
5
5
  "keywords": [
6
6
  "dxos",
@@ -52,32 +52,34 @@
52
52
  "uuid": "^9.0.0",
53
53
  "ws": "^8.14.2",
54
54
  "wtfnode": "^0.9.1",
55
- "@dxos/agent": "0.6.7-staging.e9eb1ed",
56
- "@dxos/async": "0.6.7-staging.e9eb1ed",
57
- "@dxos/bare-template": "0.6.7-staging.e9eb1ed",
58
- "@dxos/cli-base": "0.6.7-staging.e9eb1ed",
59
- "@dxos/cli-composer": "0.6.7-staging.e9eb1ed",
60
- "@dxos/client": "0.6.7-staging.e9eb1ed",
61
- "@dxos/client-protocol": "0.6.7-staging.e9eb1ed",
62
- "@dxos/client-services": "0.6.7-staging.e9eb1ed",
63
- "@dxos/config": "0.6.7-staging.e9eb1ed",
64
- "@dxos/context": "0.6.7-staging.e9eb1ed",
65
- "@dxos/debug": "0.6.7-staging.e9eb1ed",
66
- "@dxos/echo-schema": "0.6.7-staging.e9eb1ed",
67
- "@dxos/functions": "0.6.7-staging.e9eb1ed",
68
- "@dxos/hello-template": "0.6.7-staging.e9eb1ed",
69
- "@dxos/invariant": "0.6.7-staging.e9eb1ed",
70
- "@dxos/network-manager": "0.6.7-staging.e9eb1ed",
71
- "@dxos/node-std": "0.6.7-staging.e9eb1ed",
72
- "@dxos/log": "0.6.7-staging.e9eb1ed",
73
- "@dxos/observability": "0.6.7-staging.e9eb1ed",
74
- "@dxos/process": "0.6.7-staging.e9eb1ed",
75
- "@dxos/plate": "0.6.7-staging.e9eb1ed",
76
- "@dxos/random": "0.6.7-staging.e9eb1ed",
77
- "@dxos/rpc": "0.6.7-staging.e9eb1ed",
78
- "@dxos/util": "0.6.7-staging.e9eb1ed",
79
- "@dxos/protocols": "0.6.7-staging.e9eb1ed",
80
- "@dxos/tasks-template": "0.6.7-staging.e9eb1ed"
55
+ "@dxos/agent": "0.6.8-main.046e6cf",
56
+ "@dxos/bare-template": "0.6.8-main.046e6cf",
57
+ "@dxos/async": "0.6.8-main.046e6cf",
58
+ "@dxos/cli-base": "0.6.8-main.046e6cf",
59
+ "@dxos/cli-composer": "0.6.8-main.046e6cf",
60
+ "@dxos/client-protocol": "0.6.8-main.046e6cf",
61
+ "@dxos/client-services": "0.6.8-main.046e6cf",
62
+ "@dxos/client": "0.6.8-main.046e6cf",
63
+ "@dxos/config": "0.6.8-main.046e6cf",
64
+ "@dxos/debug": "0.6.8-main.046e6cf",
65
+ "@dxos/echo-schema": "0.6.8-main.046e6cf",
66
+ "@dxos/context": "0.6.8-main.046e6cf",
67
+ "@dxos/functions": "0.6.8-main.046e6cf",
68
+ "@dxos/network-manager": "0.6.8-main.046e6cf",
69
+ "@dxos/invariant": "0.6.8-main.046e6cf",
70
+ "@dxos/hello-template": "0.6.8-main.046e6cf",
71
+ "@dxos/node-std": "0.6.8-main.046e6cf",
72
+ "@dxos/observability": "0.6.8-main.046e6cf",
73
+ "@dxos/log": "0.6.8-main.046e6cf",
74
+ "@dxos/plate": "0.6.8-main.046e6cf",
75
+ "@dxos/plugin-markdown": "0.6.8-main.046e6cf",
76
+ "@dxos/plugin-script": "0.6.8-main.046e6cf",
77
+ "@dxos/process": "0.6.8-main.046e6cf",
78
+ "@dxos/protocols": "0.6.8-main.046e6cf",
79
+ "@dxos/random": "0.6.8-main.046e6cf",
80
+ "@dxos/rpc": "0.6.8-main.046e6cf",
81
+ "@dxos/tasks-template": "0.6.8-main.046e6cf",
82
+ "@dxos/util": "0.6.8-main.046e6cf"
81
83
  },
82
84
  "devDependencies": {
83
85
  "@effect/schema": "^0.67.16",
@@ -91,13 +93,13 @@
91
93
  "@types/node": "^18.11.9",
92
94
  "@types/node-fetch": "^2.5.10",
93
95
  "@types/platform": "^1.3.4",
94
- "@types/react-dom": "^18.0.6",
96
+ "@types/react-dom": "~18.2.0",
95
97
  "effect": "^3.2.7",
96
98
  "fast-check": "^3.19.0",
97
99
  "oclif": "^4.13.0",
98
100
  "prettier": "^3.2.4",
99
101
  "shx": "^0.3.3",
100
- "typescript": "^5.4.5",
102
+ "typescript": "^5.5.4",
101
103
  "zone.js": ">=0.11.4 <0.12.0-0 || >=0.13.0 <0.14.0-0 || >=0.14.0 <0.15.0-0"
102
104
  },
103
105
  "engines": {