@dxos/cli 0.8.4-main.28f8d3d → 0.8.4-main.406dc2a

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/cli",
3
- "version": "0.8.4-main.28f8d3d",
3
+ "version": "0.8.4-main.406dc2a",
4
4
  "description": "DXOS CLI",
5
5
  "keywords": [
6
6
  "dxos",
@@ -29,7 +29,7 @@
29
29
  "@oclif/plugin-autocomplete": "^3.2.6",
30
30
  "@oclif/plugin-help": "^6.2.16",
31
31
  "@oclif/plugin-plugins": "^5.4.15",
32
- "@oclif/plugin-update": "^4.6.6",
32
+ "@oclif/plugin-update": "^4.7.8",
33
33
  "@octokit/core": "^4.0.4",
34
34
  "chalk": "^4.1.0",
35
35
  "cli-progress": "^3.11.2",
@@ -39,8 +39,8 @@
39
39
  "fs-extra": "^8.1.0",
40
40
  "get-folder-size": "^2.0.1",
41
41
  "git-rev-sync": "^3.0.2",
42
- "ink": "^3.2.0",
43
- "ink-table": "~3.0.0",
42
+ "ink": "^6.3.1",
43
+ "ink-table": "^3.1.0",
44
44
  "inquirer": "^12.0.0",
45
45
  "isomorphic-ws": "^5.0.0",
46
46
  "js-yaml": "^4.1.0",
@@ -50,34 +50,33 @@
50
50
  "node-fetch": "^2.6.0",
51
51
  "pkg-up": "^3.1.0",
52
52
  "platform": "^1.3.6",
53
- "react": "~18.2.0",
53
+ "react": "~19.2.0",
54
54
  "ws": "^8.14.2",
55
- "wtfnode": "^0.9.1",
56
- "@dxos/agent": "0.8.4-main.28f8d3d",
57
- "@dxos/async": "0.8.4-main.28f8d3d",
58
- "@dxos/cli-composer": "0.8.4-main.28f8d3d",
59
- "@dxos/cli-base": "0.8.4-main.28f8d3d",
60
- "@dxos/client": "0.8.4-main.28f8d3d",
61
- "@dxos/client-services": "0.8.4-main.28f8d3d",
62
- "@dxos/compute": "0.8.4-main.28f8d3d",
63
- "@dxos/client-protocol": "0.8.4-main.28f8d3d",
64
- "@dxos/config": "0.8.4-main.28f8d3d",
65
- "@dxos/context": "0.8.4-main.28f8d3d",
66
- "@dxos/debug": "0.8.4-main.28f8d3d",
67
- "@dxos/echo": "0.8.4-main.28f8d3d",
68
- "@dxos/invariant": "0.8.4-main.28f8d3d",
69
- "@dxos/log": "0.8.4-main.28f8d3d",
70
- "@dxos/echo-schema": "0.8.4-main.28f8d3d",
71
- "@dxos/network-manager": "0.8.4-main.28f8d3d",
72
- "@dxos/observability": "0.8.4-main.28f8d3d",
73
- "@dxos/node-std": "0.8.4-main.28f8d3d",
74
- "@dxos/process": "0.8.4-main.28f8d3d",
75
- "@dxos/functions": "0.8.4-main.28f8d3d",
76
- "@dxos/protocols": "0.8.4-main.28f8d3d",
77
- "@dxos/rpc": "0.8.4-main.28f8d3d",
78
- "@dxos/random": "0.8.4-main.28f8d3d",
79
- "@dxos/schema": "0.8.4-main.28f8d3d",
80
- "@dxos/util": "0.8.4-main.28f8d3d"
55
+ "wtfnode": "^0.10.0",
56
+ "@dxos/agent": "0.8.4-main.406dc2a",
57
+ "@dxos/async": "0.8.4-main.406dc2a",
58
+ "@dxos/cli-base": "0.8.4-main.406dc2a",
59
+ "@dxos/client": "0.8.4-main.406dc2a",
60
+ "@dxos/client-protocol": "0.8.4-main.406dc2a",
61
+ "@dxos/cli-composer": "0.8.4-main.406dc2a",
62
+ "@dxos/client-services": "0.8.4-main.406dc2a",
63
+ "@dxos/compute": "0.8.4-main.406dc2a",
64
+ "@dxos/config": "0.8.4-main.406dc2a",
65
+ "@dxos/context": "0.8.4-main.406dc2a",
66
+ "@dxos/debug": "0.8.4-main.406dc2a",
67
+ "@dxos/echo": "0.8.4-main.406dc2a",
68
+ "@dxos/functions": "0.8.4-main.406dc2a",
69
+ "@dxos/log": "0.8.4-main.406dc2a",
70
+ "@dxos/node-std": "0.8.4-main.406dc2a",
71
+ "@dxos/observability": "0.8.4-main.406dc2a",
72
+ "@dxos/network-manager": "0.8.4-main.406dc2a",
73
+ "@dxos/process": "0.8.4-main.406dc2a",
74
+ "@dxos/random": "0.8.4-main.406dc2a",
75
+ "@dxos/protocols": "0.8.4-main.406dc2a",
76
+ "@dxos/schema": "0.8.4-main.406dc2a",
77
+ "@dxos/invariant": "0.8.4-main.406dc2a",
78
+ "@dxos/rpc": "0.8.4-main.406dc2a",
79
+ "@dxos/util": "0.8.4-main.406dc2a"
81
80
  },
82
81
  "devDependencies": {
83
82
  "@oclif/test": "^4.1.0",
@@ -87,9 +86,10 @@
87
86
  "@types/lodash.defaultsdeep": "^4.6.6",
88
87
  "@types/node-fetch": "^2.5.10",
89
88
  "@types/platform": "^1.3.4",
90
- "@types/react-dom": "~18.2.0",
89
+ "@types/react-dom": "~19.2.1",
91
90
  "oclif": "^4.15.12",
92
91
  "shx": "^0.3.3",
92
+ "ts-node": "10.9.1",
93
93
  "undici": "*"
94
94
  },
95
95
  "peerDependencies": {
@@ -1,34 +0,0 @@
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/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
7
- version: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
8
- composerScript: import("@oclif/core/interfaces").BooleanFlag<boolean>;
9
- functionId: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
10
- spaceKey: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
11
- noSpace: import("@oclif/core/interfaces").BooleanFlag<boolean>;
12
- json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
13
- verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
14
- 'dry-run': import("@oclif/core/interfaces").BooleanFlag<boolean>;
15
- profile: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
16
- config: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
17
- timeout: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
18
- target: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
- agent: import("@oclif/core/interfaces").BooleanFlag<boolean>;
20
- 'json-log': import("@oclif/core/interfaces").BooleanFlag<boolean>;
21
- 'json-logfile': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
22
- };
23
- static args: {
24
- file: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
25
- };
26
- run(): Promise<any>;
27
- private _loadScript;
28
- private _loadFunctionObject;
29
- private _upload;
30
- private _updateFunctionObject;
31
- private _updateComposerScript;
32
- private _getNextVersion;
33
- }
34
- //# sourceMappingURL=upload.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../../src/commands/function/upload.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAKzC,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC5D,OAAgB,cAAc,UAAQ;IACtC,OAAgB,WAAW,SAA2B;IAEtD,OAAgB,KAAK;;;;;;;;;;;;;;;;;MAQnB;IAEF,OAAgB,IAAI;;MAElB;IAEI,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;YAoCX,WAAW;YAgBX,mBAAmB;YAcnB,OAAO;IA0BrB,OAAO,CAAC,qBAAqB;YAgBf,qBAAqB;YA6BrB,eAAe;CAW9B"}
@@ -1,148 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
- import fs from 'node:fs';
5
- import { basename } from 'node:path';
6
- import path from 'path';
7
- import { Args, Flags } from '@oclif/core';
8
- import { asyncTimeout } from '@dxos/async';
9
- import { Obj, Ref } from '@dxos/echo';
10
- import { FunctionType, ScriptType, makeFunctionUrl, setUserFunctionUrlInMetadata } from '@dxos/functions';
11
- import { incrementSemverPatch, uploadWorkerFunction } from '@dxos/functions/edge';
12
- import { invariant } from '@dxos/invariant';
13
- import { DataType } from '@dxos/schema';
14
- import { BaseCommand } from '../../base';
15
- import { bundleScript, findFunctionByDeploymentId } from '../../util';
16
- // TODO: move to cli-composer
17
- export default class Upload extends BaseCommand {
18
- static enableJsonFlag = true;
19
- static description = 'Upload user function.';
20
- static flags = {
21
- ...BaseCommand.flags,
22
- name: Flags.string({ description: 'Function name.' }),
23
- version: Flags.string({ description: 'Function version.' }),
24
- composerScript: Flags.boolean({ description: 'Loads the script into composer.' }),
25
- functionId: Flags.string({ description: 'Existing UserFunction ID to update.' }),
26
- spaceKey: Flags.string({ description: 'Space key to create/update Script source in.' }),
27
- noSpace: Flags.boolean({ description: 'Only uploads a function, without creating a FunctionObject in ECHO.' }),
28
- };
29
- static args = {
30
- file: Args.string({ required: true }),
31
- };
32
- async run() {
33
- const { scriptFileContent, bundledScript } = await this._loadScript();
34
- if (this.flags.noSpace) {
35
- return this.execWithClient(async ({ client }) => {
36
- const identity = client.halo.identity.get();
37
- invariant(identity, 'Identity not available');
38
- const uploadResult = await this._upload(client, identity.identityKey, undefined, bundledScript);
39
- this.log(`Upload complete: ${uploadResult.functionId}, version ${uploadResult.version}`);
40
- });
41
- }
42
- return this.execWithSpace(async ({ client, space }) => {
43
- client.addTypes([FunctionType]);
44
- const identity = client.halo.identity.get();
45
- invariant(identity, 'Identity not available');
46
- const existingFunctionObject = await this._loadFunctionObject(space);
47
- const uploadResult = await this._upload(client, identity.identityKey, existingFunctionObject, bundledScript);
48
- const functionObject = this._updateFunctionObject(space, existingFunctionObject, uploadResult);
49
- if (this.flags.composerScript) {
50
- await this._updateComposerScript(client, space, functionObject, basename(this.args.file), scriptFileContent);
51
- }
52
- return uploadResult;
53
- }, { spaceKeys: this.flags.spaceKey ? [this.flags.spaceKey] : undefined });
54
- }
55
- async _loadScript() {
56
- let scriptFileContent;
57
- try {
58
- scriptFileContent = fs.readFileSync(this.args.file, 'utf8');
59
- }
60
- catch (err) {
61
- this.error(`Error reading file ${this.args.file}: ${err.message}`);
62
- }
63
- const bundleResult = await bundleScript(scriptFileContent);
64
- if (bundleResult.error || !bundleResult.bundle) {
65
- this.error(`Error bundling script ${this.args.file}: ${bundleResult.error?.message ?? 'empty output'}`);
66
- }
67
- return { scriptFileContent, bundledScript: bundleResult.bundle };
68
- }
69
- async _loadFunctionObject(space) {
70
- const matchingFunction = await findFunctionByDeploymentId(space, this.flags.functionId);
71
- if (this.flags.functionId && !matchingFunction) {
72
- this.warn(`Function ECHO object not found for ${this.flags.functionId}`);
73
- }
74
- if (this.flags.verbose && matchingFunction) {
75
- this.log(`Function ECHO object found, ID: ${matchingFunction.id}`);
76
- }
77
- return matchingFunction;
78
- }
79
- async _upload(client, ownerPublicKey, functionObject, bundledSource) {
80
- try {
81
- const result = await asyncTimeout(uploadWorkerFunction({
82
- client,
83
- ownerPublicKey,
84
- version: await this._getNextVersion(functionObject),
85
- functionId: this.flags.functionId,
86
- name: this.flags.name,
87
- source: bundledSource,
88
- }), 10_000);
89
- invariant(result.functionId, 'Upload failed.');
90
- this.log(`Uploaded function ${result.functionId}, version ${result.version}`);
91
- return result;
92
- }
93
- catch (err) {
94
- this.error(err.message);
95
- }
96
- }
97
- _updateFunctionObject(space, existingObject, uploadResult) {
98
- let functionObject = existingObject;
99
- if (!functionObject) {
100
- const name = path.basename(this.args.file, path.extname(this.args.file));
101
- functionObject = space.db.add(Obj.make(FunctionType, { name, version: uploadResult.version }));
102
- }
103
- functionObject.name = this.flags.name ?? functionObject.name;
104
- functionObject.version = uploadResult.version;
105
- setUserFunctionUrlInMetadata(Obj.getMeta(functionObject), makeFunctionUrl(uploadResult));
106
- return functionObject;
107
- }
108
- async _updateComposerScript(client, space, functionObject, scriptFileName, scriptFileContent) {
109
- client.addTypes([ScriptType, DataType.Text]);
110
- if (functionObject.source) {
111
- const script = await functionObject.source.load();
112
- const source = await script.source.load();
113
- source.content = scriptFileContent;
114
- if (this.flags.verbose) {
115
- this.log(`Updated source of ${script.id}`);
116
- }
117
- }
118
- else {
119
- const sourceObj = space.db.add(DataType.makeText(scriptFileContent));
120
- const obj = space.db.add(Obj.make(ScriptType, { name: this.flags.name ?? scriptFileName, source: Ref.make(sourceObj) }));
121
- functionObject.source = Ref.make(obj);
122
- await makeObjectNavigableInComposer(client, space, obj);
123
- if (this.flags.verbose) {
124
- this.log(`Created object, ID: ${obj.id}`);
125
- }
126
- }
127
- }
128
- async _getNextVersion(functionObject) {
129
- if (this.flags.version) {
130
- return this.flags.version;
131
- }
132
- if (functionObject) {
133
- return incrementSemverPatch(functionObject?.version ?? '0.0.0');
134
- }
135
- return '0.0.1';
136
- }
137
- }
138
- const makeObjectNavigableInComposer = async (client, space, obj) => {
139
- const collection = space.properties['dxos.org/type/Collection'];
140
- if (collection) {
141
- client.addTypes([DataType.Collection]);
142
- const composerCollection = await collection.load();
143
- if (composerCollection) {
144
- composerCollection.objects.push(Ref.make(obj));
145
- }
146
- }
147
- };
148
- //# sourceMappingURL=upload.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload.js","sourceRoot":"","sources":["../../../../src/commands/function/upload.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AAEF,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAI3C,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,eAAe,EAA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GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;AACH,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const bundleScript: (source: string) => Promise<{
2
- bundle?: string;
3
- error?: Error;
4
- }>;
5
- //# sourceMappingURL=bundle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../../../src/util/function/bundle.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY,GAAU,QAAQ,MAAM,KAAG,OAAO,CAAC;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAS7F,CAAC"}
@@ -1,13 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
- import { Bundler } from '@dxos/functions/bundler';
5
- export const bundleScript = async (source) => {
6
- const bundler = new Bundler({ platform: 'node', sandboxedModules: [], remoteModules: {} });
7
- const buildResult = await bundler.bundle({ source });
8
- if (buildResult.error || !buildResult.bundle) {
9
- return { error: buildResult.error || new Error('Bundle creation failed') };
10
- }
11
- return { bundle: buildResult.bundle };
12
- };
13
- //# sourceMappingURL=bundle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bundle.js","sourceRoot":"","sources":["../../../../src/util/function/bundle.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;AACF,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAElD,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,EAAE,MAAc,EAA+C,EAAE;IAChG,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,gBAAgB,EAAE,EAAE,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC;IAC3F,MAAM,WAAW,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;IAErD,IAAI,WAAW,CAAC,KAAK,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;QAC7C,OAAO,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,wBAAwB,CAAC,EAAE,CAAC;IAC7E,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC;AACxC,CAAC,CAAC"}