@skrr-ai/cli 0.1.79 → 0.1.81
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/base-command.d.ts +4 -0
- package/dist/base-command.js +40 -4
- package/dist/commands/agents/visibility.d.ts +14 -0
- package/dist/commands/agents/visibility.js +52 -0
- package/dist/commands/create-token.d.ts +0 -1
- package/dist/commands/create-token.js +3 -1
- package/dist/commands/inbox/index.js +4 -2
- package/dist/commands/list-tokens.d.ts +0 -1
- package/dist/commands/list-tokens.js +1 -1
- package/dist/commands/login.d.ts +8 -3
- package/dist/commands/login.js +14 -4
- package/dist/commands/machines/dedicated/ssh-proxy.js +1 -0
- package/dist/commands/revoke-token.d.ts +0 -1
- package/dist/commands/revoke-token.js +1 -1
- package/dist/commands/spaces/workflows/events.js +9 -2
- package/dist/commands/store/follow.d.ts +1 -0
- package/dist/commands/store/follow.js +7 -1
- package/dist/commands/store/follows/list.d.ts +11 -0
- package/dist/commands/store/follows/list.js +29 -0
- package/dist/commands/store/follows/remove.d.ts +16 -0
- package/dist/commands/store/follows/remove.js +37 -0
- package/dist/commands/store/publishers/profile/draft.d.ts +17 -0
- package/dist/commands/store/publishers/profile/draft.js +54 -0
- package/dist/commands/store/publishers/profile/handle.d.ts +14 -0
- package/dist/commands/store/publishers/profile/handle.js +39 -0
- package/dist/commands/store/publishers/profile/hide.d.ts +12 -0
- package/dist/commands/store/publishers/profile/hide.js +39 -0
- package/dist/commands/store/publishers/profile/preview.d.ts +11 -0
- package/dist/commands/store/publishers/profile/preview.js +39 -0
- package/dist/commands/store/publishers/profile/publish.d.ts +12 -0
- package/dist/commands/store/publishers/profile/publish.js +41 -0
- package/dist/commands/store/publishers/profile/restore.d.ts +15 -0
- package/dist/commands/store/publishers/profile/restore.js +49 -0
- package/dist/commands/store/publishers/profile/revisions.d.ts +11 -0
- package/dist/commands/store/publishers/profile/revisions.js +30 -0
- package/dist/commands/store/publishers/profile/show.d.ts +11 -0
- package/dist/commands/store/publishers/profile/show.js +39 -0
- package/dist/commands/store/review.d.ts +26 -0
- package/dist/commands/store/review.js +93 -0
- package/dist/commands/store/reviews.d.ts +29 -0
- package/dist/commands/store/reviews.js +170 -0
- package/dist/commands/store/tip.d.ts +20 -0
- package/dist/commands/store/tip.js +57 -0
- package/dist/commands/tokens/create.d.ts +28 -0
- package/dist/commands/tokens/create.js +136 -0
- package/dist/commands/tokens/list.d.ts +11 -0
- package/dist/commands/tokens/list.js +53 -0
- package/dist/commands/tokens/revoke.d.ts +14 -0
- package/dist/commands/tokens/revoke.js +42 -0
- package/dist/lib/access-tokens.d.ts +59 -0
- package/dist/lib/access-tokens.js +50 -0
- package/dist/lib/agentic-stream.js +13 -4
- package/dist/lib/api-fetch.js +6 -2
- package/dist/lib/auth-core-init.d.ts +6 -0
- package/dist/lib/auth-core-init.js +28 -6
- package/dist/lib/brokered-dpop.d.ts +34 -0
- package/dist/lib/brokered-dpop.js +89 -0
- package/dist/lib/credential-resolver.d.ts +1 -1
- package/dist/lib/credential-resolver.js +8 -2
- package/dist/lib/daemonBroker.d.ts +84 -4
- package/dist/lib/daemonBroker.js +209 -40
- package/dist/lib/daemonBrokerRefusal.d.ts +26 -0
- package/dist/lib/daemonBrokerRefusal.js +83 -4
- package/dist/lib/daemonRestartWait.d.ts +39 -0
- package/dist/lib/daemonRestartWait.js +181 -0
- package/dist/lib/dedicated-service.js +10 -5
- package/dist/lib/dedicated-ssh.d.ts +9 -0
- package/dist/lib/dedicated-ssh.js +235 -63
- package/dist/lib/dedicated-terminal.js +6 -3
- package/dist/lib/dpop-auth.d.ts +35 -0
- package/dist/lib/dpop-auth.js +57 -0
- package/dist/lib/login.d.ts +6 -0
- package/dist/lib/login.js +13 -4
- package/dist/lib/node-adapter.js +6 -2
- package/dist/lib/publisher-profile-flags.d.ts +19 -0
- package/dist/lib/publisher-profile-flags.js +48 -0
- package/dist/lib/refresh.d.ts +1 -1
- package/dist/lib/refresh.js +6 -1
- package/dist/lib/ssh-ordered-bytes.d.ts +8 -0
- package/dist/lib/ssh-ordered-bytes.js +31 -0
- package/dist/lib/usd-micros.d.ts +9 -0
- package/dist/lib/usd-micros.js +21 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.d.ts +42 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.js +35 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialResolver.d.ts +22 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialResolver.js +29 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialSession.d.ts +49 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialSession.js +47 -9
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.d.ts +7 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.js +7 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceKey.d.ts +56 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceKey.js +42 -20
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/dpop.d.ts +101 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/dpop.js +179 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +23 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.d.ts +42 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.js +32 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialResolver.d.ts +22 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialResolver.js +27 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialSession.d.ts +49 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialSession.js +47 -9
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.d.ts +7 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.js +7 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceKey.d.ts +56 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceKey.js +39 -20
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/dpop.d.ts +101 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/dpop.js +138 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +5 -1
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +3895 -3882
- package/oclif.manifest.json +34985 -33643
- package/package.json +28 -4
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../../../../base-command");
|
|
6
|
+
const publisher_profile_flags_1 = require("../../../../lib/publisher-profile-flags");
|
|
7
|
+
/** Rename your public handle. The server refuses a lookalike of an existing one. */
|
|
8
|
+
class StorePublishersProfileHandle extends base_command_1.BaseCommand {
|
|
9
|
+
static description = 'Rename your public publisher handle (a lookalike handle is refused)';
|
|
10
|
+
static examples = ['<%= config.bin %> store publishers profile handle acme-labs'];
|
|
11
|
+
static args = {
|
|
12
|
+
handle: core_1.Args.string({
|
|
13
|
+
description: 'The new handle (with or without @)',
|
|
14
|
+
required: true,
|
|
15
|
+
ignoreStdin: true,
|
|
16
|
+
}),
|
|
17
|
+
};
|
|
18
|
+
static flags = { 'publish-as': publisher_profile_flags_1.publishAsFlag, json: publisher_profile_flags_1.jsonFlag };
|
|
19
|
+
async run() {
|
|
20
|
+
this.requireAuth();
|
|
21
|
+
const { args, flags } = await this.parse(StorePublishersProfileHandle);
|
|
22
|
+
const handle = args.handle.replace(/^@/, '');
|
|
23
|
+
try {
|
|
24
|
+
const result = await data_provider_1.dataService.renameStorePublisherProfileHandle({
|
|
25
|
+
publishAs: flags['publish-as'],
|
|
26
|
+
handle,
|
|
27
|
+
});
|
|
28
|
+
if (flags.json) {
|
|
29
|
+
this.log(JSON.stringify(result, null, 2));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.log(`Handle is now @${handle}.`);
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
this.handleApiError(err);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.default = StorePublishersProfileHandle;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../../base-command';
|
|
2
|
+
/** Take the public profile down; published revisions stay restorable. */
|
|
3
|
+
export default class StorePublishersProfileHide extends BaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
'publish-as': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
revision: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../../../../base-command");
|
|
6
|
+
const publisher_profile_flags_1 = require("../../../../lib/publisher-profile-flags");
|
|
7
|
+
/** Take the public profile down; published revisions stay restorable. */
|
|
8
|
+
class StorePublishersProfileHide extends base_command_1.BaseCommand {
|
|
9
|
+
static description = 'Hide your public publisher profile (published revisions stay restorable)';
|
|
10
|
+
static examples = ['<%= config.bin %> store publishers profile hide'];
|
|
11
|
+
static flags = {
|
|
12
|
+
'publish-as': publisher_profile_flags_1.publishAsFlag,
|
|
13
|
+
revision: core_1.Flags.integer({
|
|
14
|
+
description: 'Apply only if the profile is still at this revision (default: its current one)',
|
|
15
|
+
min: 0,
|
|
16
|
+
}),
|
|
17
|
+
json: publisher_profile_flags_1.jsonFlag,
|
|
18
|
+
};
|
|
19
|
+
async run() {
|
|
20
|
+
this.requireAuth();
|
|
21
|
+
const { flags } = await this.parse(StorePublishersProfileHide);
|
|
22
|
+
try {
|
|
23
|
+
const publishAs = flags['publish-as'];
|
|
24
|
+
const result = await data_provider_1.dataService.hideStorePublisherProfile({
|
|
25
|
+
publishAs,
|
|
26
|
+
expectedRevision: await (0, publisher_profile_flags_1.currentRevision)(publishAs, flags.revision),
|
|
27
|
+
});
|
|
28
|
+
if (flags.json) {
|
|
29
|
+
this.log(JSON.stringify(result, null, 2));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.log('Hidden. Restore a revision or publish again to make it public.');
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
this.handleApiError(err);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.default = StorePublishersProfileHide;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../../base-command';
|
|
2
|
+
/** Render a draft exactly as the public page would, without saving anything. */
|
|
3
|
+
export default class StorePublishersProfilePreview extends BaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
'publish-as': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
file: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../../../../base-command");
|
|
6
|
+
const publisher_profile_flags_1 = require("../../../../lib/publisher-profile-flags");
|
|
7
|
+
/** Render a draft exactly as the public page would, without saving anything. */
|
|
8
|
+
class StorePublishersProfilePreview extends base_command_1.BaseCommand {
|
|
9
|
+
static description = 'Preview a publisher profile draft as the public page would render it (writes nothing)';
|
|
10
|
+
static examples = [
|
|
11
|
+
'<%= config.bin %> store publishers profile preview --file draft.json',
|
|
12
|
+
];
|
|
13
|
+
static flags = {
|
|
14
|
+
'publish-as': publisher_profile_flags_1.publishAsFlag,
|
|
15
|
+
file: core_1.Flags.string({ description: 'JSON file holding the draft', required: true }),
|
|
16
|
+
};
|
|
17
|
+
async run() {
|
|
18
|
+
this.requireAuth();
|
|
19
|
+
const { flags } = await this.parse(StorePublishersProfilePreview);
|
|
20
|
+
let draft;
|
|
21
|
+
try {
|
|
22
|
+
draft = (0, publisher_profile_flags_1.readDraftFile)(flags.file);
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
this.error(err.message);
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const result = await data_provider_1.dataService.previewStorePublisherProfile({
|
|
29
|
+
publishAs: flags['publish-as'],
|
|
30
|
+
draft,
|
|
31
|
+
});
|
|
32
|
+
this.log(JSON.stringify(result, null, 2));
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
this.handleApiError(err);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.default = StorePublishersProfilePreview;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../../base-command';
|
|
2
|
+
/** Publish the current draft as a new public revision. */
|
|
3
|
+
export default class StorePublishersProfilePublish extends BaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
'publish-as': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
revision: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const node_crypto_1 = require("node:crypto");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
|
+
const base_command_1 = require("../../../../base-command");
|
|
7
|
+
const publisher_profile_flags_1 = require("../../../../lib/publisher-profile-flags");
|
|
8
|
+
/** Publish the current draft as a new public revision. */
|
|
9
|
+
class StorePublishersProfilePublish extends base_command_1.BaseCommand {
|
|
10
|
+
static description = 'Publish your current publisher profile draft as a new public revision';
|
|
11
|
+
static examples = ['<%= config.bin %> store publishers profile publish'];
|
|
12
|
+
static flags = {
|
|
13
|
+
'publish-as': publisher_profile_flags_1.publishAsFlag,
|
|
14
|
+
revision: core_1.Flags.integer({
|
|
15
|
+
description: 'Apply only if the profile is still at this revision (default: its current one)',
|
|
16
|
+
min: 0,
|
|
17
|
+
}),
|
|
18
|
+
json: publisher_profile_flags_1.jsonFlag,
|
|
19
|
+
};
|
|
20
|
+
async run() {
|
|
21
|
+
this.requireAuth();
|
|
22
|
+
const { flags } = await this.parse(StorePublishersProfilePublish);
|
|
23
|
+
try {
|
|
24
|
+
const publishAs = flags['publish-as'];
|
|
25
|
+
const result = await data_provider_1.dataService.publishStorePublisherProfile({
|
|
26
|
+
publishAs,
|
|
27
|
+
expectedRevision: await (0, publisher_profile_flags_1.currentRevision)(publishAs, flags.revision),
|
|
28
|
+
idempotencyKey: (0, node_crypto_1.randomUUID)(),
|
|
29
|
+
});
|
|
30
|
+
if (flags.json) {
|
|
31
|
+
this.log(JSON.stringify(result, null, 2));
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
this.log('Published.');
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
this.handleApiError(err);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.default = StorePublishersProfilePublish;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../../base-command';
|
|
2
|
+
/** Re-publish an earlier revision. Hidden revisions are not restore candidates. */
|
|
3
|
+
export default class StorePublishersProfileRestore extends BaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
revisionId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
static flags: {
|
|
10
|
+
'publish-as': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
+
revision: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
+
};
|
|
14
|
+
run(): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const node_crypto_1 = require("node:crypto");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
|
+
const base_command_1 = require("../../../../base-command");
|
|
7
|
+
const publisher_profile_flags_1 = require("../../../../lib/publisher-profile-flags");
|
|
8
|
+
/** Re-publish an earlier revision. Hidden revisions are not restore candidates. */
|
|
9
|
+
class StorePublishersProfileRestore extends base_command_1.BaseCommand {
|
|
10
|
+
static description = 'Restore an earlier published revision of your publisher profile';
|
|
11
|
+
static examples = ['<%= config.bin %> store publishers profile restore ppr_abc123'];
|
|
12
|
+
static args = {
|
|
13
|
+
revisionId: core_1.Args.string({
|
|
14
|
+
description: 'Revision id (from `profile revisions`)',
|
|
15
|
+
required: true,
|
|
16
|
+
ignoreStdin: true,
|
|
17
|
+
}),
|
|
18
|
+
};
|
|
19
|
+
static flags = {
|
|
20
|
+
'publish-as': publisher_profile_flags_1.publishAsFlag,
|
|
21
|
+
revision: core_1.Flags.integer({
|
|
22
|
+
description: 'Apply only if the profile is still at this revision (default: its current one)',
|
|
23
|
+
min: 0,
|
|
24
|
+
}),
|
|
25
|
+
json: publisher_profile_flags_1.jsonFlag,
|
|
26
|
+
};
|
|
27
|
+
async run() {
|
|
28
|
+
this.requireAuth();
|
|
29
|
+
const { args, flags } = await this.parse(StorePublishersProfileRestore);
|
|
30
|
+
try {
|
|
31
|
+
const publishAs = flags['publish-as'];
|
|
32
|
+
const result = await data_provider_1.dataService.restoreStorePublisherProfileRevision({
|
|
33
|
+
publishAs,
|
|
34
|
+
revisionId: args.revisionId,
|
|
35
|
+
expectedRevision: await (0, publisher_profile_flags_1.currentRevision)(publishAs, flags.revision),
|
|
36
|
+
idempotencyKey: (0, node_crypto_1.randomUUID)(),
|
|
37
|
+
});
|
|
38
|
+
if (flags.json) {
|
|
39
|
+
this.log(JSON.stringify(result, null, 2));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.log(`Restored ${args.revisionId}.`);
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
this.handleApiError(err);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.default = StorePublishersProfileRestore;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../../base-command';
|
|
2
|
+
/** Published revisions of your publisher profile — the restore candidates. */
|
|
3
|
+
export default class StorePublishersProfileRevisions extends BaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
'publish-as': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
|
+
const base_command_1 = require("../../../../base-command");
|
|
6
|
+
const publisher_profile_flags_1 = require("../../../../lib/publisher-profile-flags");
|
|
7
|
+
/** Published revisions of your publisher profile — the restore candidates. */
|
|
8
|
+
class StorePublishersProfileRevisions extends base_command_1.BaseCommand {
|
|
9
|
+
static description = 'List published revisions of your publisher profile (the restore candidates)';
|
|
10
|
+
static examples = ['<%= config.bin %> store publishers profile revisions --limit 10'];
|
|
11
|
+
static flags = {
|
|
12
|
+
'publish-as': publisher_profile_flags_1.publishAsFlag,
|
|
13
|
+
limit: core_1.Flags.integer({ description: 'How many revisions to return', min: 1 }),
|
|
14
|
+
};
|
|
15
|
+
async run() {
|
|
16
|
+
this.requireAuth();
|
|
17
|
+
const { flags } = await this.parse(StorePublishersProfileRevisions);
|
|
18
|
+
try {
|
|
19
|
+
const result = await data_provider_1.dataService.getStorePublisherProfileRevisions({
|
|
20
|
+
publishAs: flags['publish-as'],
|
|
21
|
+
limit: flags.limit,
|
|
22
|
+
});
|
|
23
|
+
this.log(JSON.stringify(result, null, 2));
|
|
24
|
+
}
|
|
25
|
+
catch (err) {
|
|
26
|
+
this.handleApiError(err);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.default = StorePublishersProfileRevisions;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseCommand } from '../../../../base-command';
|
|
2
|
+
/** The private publisher-profile console: draft, visibility and CAS revision. */
|
|
3
|
+
export default class StorePublishersProfileShow extends BaseCommand {
|
|
4
|
+
static description: string;
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static flags: {
|
|
7
|
+
'publish-as': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
4
|
+
const base_command_1 = require("../../../../base-command");
|
|
5
|
+
const publisher_profile_flags_1 = require("../../../../lib/publisher-profile-flags");
|
|
6
|
+
/** The private publisher-profile console: draft, visibility and CAS revision. */
|
|
7
|
+
class StorePublishersProfileShow extends base_command_1.BaseCommand {
|
|
8
|
+
static description = 'Show your publisher profile console — draft, visibility and the revision a write must name';
|
|
9
|
+
static examples = [
|
|
10
|
+
'<%= config.bin %> store publishers profile show',
|
|
11
|
+
'<%= config.bin %> store publishers profile show --publish-as ws_123 --json > draft.json',
|
|
12
|
+
];
|
|
13
|
+
static flags = { 'publish-as': publisher_profile_flags_1.publishAsFlag, json: publisher_profile_flags_1.jsonFlag };
|
|
14
|
+
async run() {
|
|
15
|
+
this.requireAuth();
|
|
16
|
+
const { flags } = await this.parse(StorePublishersProfileShow);
|
|
17
|
+
try {
|
|
18
|
+
const result = await data_provider_1.dataService.getStorePublisherProfileEditor(flags['publish-as']);
|
|
19
|
+
if (flags.json) {
|
|
20
|
+
this.log(JSON.stringify(result, null, 2));
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const { profile } = result;
|
|
24
|
+
this.log(`Profile: ${profile.profileId} (${profile.publisher.type} ${profile.publisher.id})`);
|
|
25
|
+
this.log(`Visibility: ${profile.visibility}`);
|
|
26
|
+
this.log(`Revision: ${profile.revision}`);
|
|
27
|
+
this.log(`Published: ${profile.publishedRevision
|
|
28
|
+
? `#${profile.publishedRevision.number} at ${profile.publishedRevision.publishedAt}`
|
|
29
|
+
: 'never'}`);
|
|
30
|
+
this.log(`Name: ${profile.draft.displayName ?? '(unset)'}`);
|
|
31
|
+
if (profile.draft.headline)
|
|
32
|
+
this.log(`Headline: ${profile.draft.headline}`);
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
this.handleApiError(err);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.default = StorePublishersProfileShow;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { StoreAgentRatedRelease } from '@skrr-ai/data-provider';
|
|
2
|
+
import { BaseCommand } from '../../base-command';
|
|
3
|
+
/** `1.2 (release 3)`, or the honest "unknown release" for a pre-release install. */
|
|
4
|
+
export declare function describeRatedRelease(release: StoreAgentRatedRelease | null | undefined): string;
|
|
5
|
+
/**
|
|
6
|
+
* Rate a Store agent you installed, optionally with a written review.
|
|
7
|
+
*
|
|
8
|
+
* The release the rating is recorded against is NOT a flag: the server stamps
|
|
9
|
+
* it from your own install, so a review cannot claim a version its author
|
|
10
|
+
* never ran. Rating again replaces your earlier rating; omitting --text keeps
|
|
11
|
+
* the review text you already wrote, and --clear-text removes it.
|
|
12
|
+
*/
|
|
13
|
+
export default class StoreReview extends BaseCommand {
|
|
14
|
+
static description: string;
|
|
15
|
+
static examples: string[];
|
|
16
|
+
static args: {
|
|
17
|
+
agentId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
18
|
+
};
|
|
19
|
+
static flags: {
|
|
20
|
+
rating: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
|
+
text: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
22
|
+
'clear-text': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
23
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
24
|
+
};
|
|
25
|
+
run(): Promise<void>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.describeRatedRelease = describeRatedRelease;
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
|
+
const base_command_1 = require("../../base-command");
|
|
7
|
+
/** `1.2 (release 3)`, or the honest "unknown release" for a pre-release install. */
|
|
8
|
+
function describeRatedRelease(release) {
|
|
9
|
+
if (!release)
|
|
10
|
+
return 'an unknown release';
|
|
11
|
+
const label = release.versionLabel ? `v${release.versionLabel}` : release.id;
|
|
12
|
+
return release.releaseNumber != null ? `${label} (release ${release.releaseNumber})` : label;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Rate a Store agent you installed, optionally with a written review.
|
|
16
|
+
*
|
|
17
|
+
* The release the rating is recorded against is NOT a flag: the server stamps
|
|
18
|
+
* it from your own install, so a review cannot claim a version its author
|
|
19
|
+
* never ran. Rating again replaces your earlier rating; omitting --text keeps
|
|
20
|
+
* the review text you already wrote, and --clear-text removes it.
|
|
21
|
+
*/
|
|
22
|
+
class StoreReview extends base_command_1.BaseCommand {
|
|
23
|
+
static description = 'Rate a Store agent you installed (1-5 stars), optionally with a written review';
|
|
24
|
+
static examples = [
|
|
25
|
+
'<%= config.bin %> store review agent_abc --rating 5',
|
|
26
|
+
'<%= config.bin %> store review agent_abc --rating 4 --text "Great at triage, slow on long threads"',
|
|
27
|
+
'<%= config.bin %> store review agent_abc --rating 4 --clear-text',
|
|
28
|
+
'<%= config.bin %> store reviews agent_abc --mine',
|
|
29
|
+
];
|
|
30
|
+
static args = {
|
|
31
|
+
agentId: core_1.Args.string({
|
|
32
|
+
description: 'The Store agent to rate',
|
|
33
|
+
required: true,
|
|
34
|
+
ignoreStdin: true,
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
37
|
+
static flags = {
|
|
38
|
+
rating: core_1.Flags.integer({
|
|
39
|
+
description: `Star rating, ${data_provider_1.STORE_AGENT_RATING_MIN}-${data_provider_1.STORE_AGENT_RATING_MAX}`,
|
|
40
|
+
required: true,
|
|
41
|
+
min: data_provider_1.STORE_AGENT_RATING_MIN,
|
|
42
|
+
max: data_provider_1.STORE_AGENT_RATING_MAX,
|
|
43
|
+
}),
|
|
44
|
+
text: core_1.Flags.string({
|
|
45
|
+
description: `Written review (at most ${data_provider_1.STORE_AGENT_REVIEW_MAX_LENGTH} characters). Omit to keep your existing review text`,
|
|
46
|
+
exclusive: ['clear-text'],
|
|
47
|
+
}),
|
|
48
|
+
'clear-text': core_1.Flags.boolean({
|
|
49
|
+
description: 'Remove your written review and keep only the star rating',
|
|
50
|
+
exclusive: ['text'],
|
|
51
|
+
}),
|
|
52
|
+
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
53
|
+
};
|
|
54
|
+
async run() {
|
|
55
|
+
this.requireAuth();
|
|
56
|
+
const { args, flags } = await this.parse(StoreReview);
|
|
57
|
+
let review;
|
|
58
|
+
if (flags['clear-text']) {
|
|
59
|
+
review = '';
|
|
60
|
+
}
|
|
61
|
+
else if (flags.text !== undefined) {
|
|
62
|
+
review = flags.text.trim();
|
|
63
|
+
if (!review) {
|
|
64
|
+
this.error('--text is empty. Pass review text, or --clear-text to remove your review.', {
|
|
65
|
+
exit: 2,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
if (review.length > data_provider_1.STORE_AGENT_REVIEW_MAX_LENGTH) {
|
|
69
|
+
this.error(`--text is ${review.length} characters; a review holds at most ${data_provider_1.STORE_AGENT_REVIEW_MAX_LENGTH}.`, { exit: 2 });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
const result = await data_provider_1.dataService.rateAgent({
|
|
74
|
+
agentId: args.agentId,
|
|
75
|
+
rating: flags.rating,
|
|
76
|
+
...(review !== undefined ? { review } : {}),
|
|
77
|
+
});
|
|
78
|
+
if (flags.json) {
|
|
79
|
+
this.log(JSON.stringify(result, null, 2));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
this.log(`Rated ${args.agentId} ${result.userRating}/${data_provider_1.STORE_AGENT_RATING_MAX} on ${describeRatedRelease(result.ratedRelease)}.`);
|
|
83
|
+
this.log(result.userReview
|
|
84
|
+
? `Review: ${result.userReview}`
|
|
85
|
+
: 'No written review (star rating only).');
|
|
86
|
+
this.log(`Listing now averages ${Number(result.rating).toFixed(1)} from ${result.ratingCount} rating(s).`);
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
this.handleApiError(err, { subject: `Rating ${args.agentId}` });
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
exports.default = StoreReview;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { StoreAgentReview } from '@skrr-ai/data-provider';
|
|
2
|
+
import { BaseCommand } from '../../base-command';
|
|
3
|
+
/** Plain-text lines for one written review and the publisher's reply to it. */
|
|
4
|
+
export declare function describeReview(review: StoreAgentReview): string[];
|
|
5
|
+
/**
|
|
6
|
+
* Read a Store agent's written reviews, or your own rating of it, and — as the
|
|
7
|
+
* agent's publisher — answer a review publicly.
|
|
8
|
+
*
|
|
9
|
+
* Star-only ratings are not listed; they are anonymous contributions to the
|
|
10
|
+
* average. Only the agent's author may reply, and the server decides that
|
|
11
|
+
* (`viewerIsPublisher`), not this command.
|
|
12
|
+
*/
|
|
13
|
+
export default class StoreReviews extends BaseCommand {
|
|
14
|
+
static description: string;
|
|
15
|
+
static examples: string[];
|
|
16
|
+
static args: {
|
|
17
|
+
agentId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
18
|
+
};
|
|
19
|
+
static flags: {
|
|
20
|
+
limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
21
|
+
cursor: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
22
|
+
mine: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
23
|
+
reply: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
24
|
+
body: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
25
|
+
'remove-reply': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
26
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
27
|
+
};
|
|
28
|
+
run(): Promise<void>;
|
|
29
|
+
}
|