@skrr-ai/cli 0.1.117 → 0.1.118
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/commands/actions/browse.js +2 -1
- package/dist/commands/actions/install.d.ts +1 -0
- package/dist/commands/actions/install.js +21 -1
- package/dist/commands/actions/list.js +2 -1
- package/dist/commands/actions/show.js +2 -1
- package/dist/commands/skills/browse.js +2 -1
- package/dist/commands/skills/details.js +4 -2
- package/dist/commands/skills/featured.js +2 -1
- package/dist/commands/skills/install.d.ts +1 -0
- package/dist/commands/skills/install.js +21 -1
- package/dist/commands/skills/search.js +2 -1
- package/dist/commands/store/acquisitions/list.js +2 -1
- package/dist/commands/store/acquisitions/show.js +2 -1
- package/dist/commands/store/browse.js +4 -2
- package/dist/commands/store/install.d.ts +1 -0
- package/dist/commands/store/install.js +26 -2
- package/dist/commands/store/releases.js +4 -2
- package/dist/commands/store/show.js +3 -2
- package/dist/commands/store/tip.js +2 -2
- package/dist/generated/agent-guides.json +63 -41
- package/dist/lib/action-listings.js +2 -1
- package/dist/lib/api-fetch.js +3 -1
- package/dist/lib/node-adapter.js +4 -3
- package/dist/lib/store-listing.d.ts +6 -1
- package/dist/lib/store-listing.js +6 -1
- package/dist/lib/task-admission.js +27 -5
- package/dist/lib/task-runtime-headers.d.ts +11 -0
- package/dist/lib/task-runtime-headers.js +73 -0
- package/dist/lib/task-write-attribution.js +1 -1
- package/dist/lib/usd-micros.d.ts +27 -0
- package/dist/lib/usd-micros.js +67 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessPermissionControls.d.ts +17 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessPermissionControls.js +35 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessPermissionControls.d.ts +17 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessPermissionControls.js +44 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +11587 -11548
- package/oclif.manifest.json +24 -2
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ exports.ACCOUNT_ATTRIBUTION_NOTICE = exports.AGENT_BINDING_GUIDANCE = void 0;
|
|
|
4
4
|
exports.taskWriteAttribution = taskWriteAttribution;
|
|
5
5
|
exports.attributionLines = attributionLines;
|
|
6
6
|
exports.runtimeWriteAttribution = runtimeWriteAttribution;
|
|
7
|
-
exports.AGENT_BINDING_GUIDANCE = '
|
|
7
|
+
exports.AGENT_BINDING_GUIDANCE = 'Run `skrr tasks start <task>` to execute in the assigned Agent’s authenticated runtime. ' +
|
|
8
8
|
'An --agent flag or an environment Agent id cannot establish authenticated authorship.';
|
|
9
9
|
exports.ACCOUNT_ATTRIBUTION_NOTICE = 'Without authenticated Agent provenance, Task writes are attributed to the signed-in account. ' +
|
|
10
10
|
'An account-attributed assessment is not proof of an independent human check.';
|
package/dist/lib/usd-micros.d.ts
CHANGED
|
@@ -7,3 +7,30 @@
|
|
|
7
7
|
* Returns null for anything that is not a positive amount with ≤ 2 decimals.
|
|
8
8
|
*/
|
|
9
9
|
export declare function usdToMicros(amount: string): number | null;
|
|
10
|
+
/**
|
|
11
|
+
* The same parse, but "0" is a price too: `--expected-price 0` pins free.
|
|
12
|
+
* Returns null for anything that is not an amount with ≤ 2 decimals.
|
|
13
|
+
*/
|
|
14
|
+
export declare function usdToMicrosOrZero(amount: string): number | null;
|
|
15
|
+
/**
|
|
16
|
+
* `--expected-price` as micros: `undefined` when the flag was not passed,
|
|
17
|
+
* `null` when the value is not a USD amount.
|
|
18
|
+
*/
|
|
19
|
+
export declare function expectedPriceFlagMicros(value: string | undefined): number | null | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* The refusal text when `--expected-price` does not match what a paid
|
|
22
|
+
* install would now charge — one wording for every install command so the
|
|
23
|
+
* pin reads the same whichever listing it guarded (OSK-18256).
|
|
24
|
+
*/
|
|
25
|
+
export declare function expectedPriceMismatchMessage(expectedMicros: number, chargeMicros: number): string;
|
|
26
|
+
/**
|
|
27
|
+
* A `--json` payload with every unstated-unit store price restated in
|
|
28
|
+
* dollars: a numeric `price`, `listPrice` or `charge` (integer micro-USD,
|
|
29
|
+
* the one unit store prices travel the wire in — see `storePricing.ts` in
|
|
30
|
+
* `@skrr-ai/data-provider`) gains a sibling `<name>Usd` in dollars, so a
|
|
31
|
+
* reader never has to know the conversion (OSK-18256). Fields that already
|
|
32
|
+
* name their unit (`amountMicros`, `*Micros`) and anything that is not a
|
|
33
|
+
* finite number pass through untouched; the wire fields themselves keep
|
|
34
|
+
* their values.
|
|
35
|
+
*/
|
|
36
|
+
export declare function withUsdPrices<T>(payload: T): T;
|
package/dist/lib/usd-micros.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.usdToMicros = usdToMicros;
|
|
4
|
+
exports.usdToMicrosOrZero = usdToMicrosOrZero;
|
|
5
|
+
exports.expectedPriceFlagMicros = expectedPriceFlagMicros;
|
|
6
|
+
exports.expectedPriceMismatchMessage = expectedPriceMismatchMessage;
|
|
7
|
+
exports.withUsdPrices = withUsdPrices;
|
|
8
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
4
9
|
/**
|
|
5
10
|
* Parse a user-typed USD amount ("5", "2.50") into integer micros.
|
|
6
11
|
*
|
|
@@ -10,12 +15,72 @@ exports.usdToMicros = usdToMicros;
|
|
|
10
15
|
* Returns null for anything that is not a positive amount with ≤ 2 decimals.
|
|
11
16
|
*/
|
|
12
17
|
function usdToMicros(amount) {
|
|
18
|
+
const cents = parseUsdCents(amount);
|
|
19
|
+
if (cents === null || cents <= 0)
|
|
20
|
+
return null;
|
|
21
|
+
return cents * 10_000;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The same parse, but "0" is a price too: `--expected-price 0` pins free.
|
|
25
|
+
* Returns null for anything that is not an amount with ≤ 2 decimals.
|
|
26
|
+
*/
|
|
27
|
+
function usdToMicrosOrZero(amount) {
|
|
28
|
+
const cents = parseUsdCents(amount);
|
|
29
|
+
return cents === null ? null : cents * 10_000;
|
|
30
|
+
}
|
|
31
|
+
function parseUsdCents(amount) {
|
|
13
32
|
const trimmed = amount.trim();
|
|
14
33
|
if (!/^\d+(\.\d{1,2})?$/.test(trimmed))
|
|
15
34
|
return null;
|
|
16
35
|
const [whole, frac = ''] = trimmed.split('.');
|
|
17
36
|
const cents = Number(whole) * 100 + Number(frac.padEnd(2, '0'));
|
|
18
|
-
|
|
37
|
+
// cents * 10_000 must stay an exact integer micros value.
|
|
38
|
+
if (!Number.isSafeInteger(cents) || cents > Number.MAX_SAFE_INTEGER / 10_000)
|
|
19
39
|
return null;
|
|
20
|
-
return cents
|
|
40
|
+
return cents;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* `--expected-price` as micros: `undefined` when the flag was not passed,
|
|
44
|
+
* `null` when the value is not a USD amount.
|
|
45
|
+
*/
|
|
46
|
+
function expectedPriceFlagMicros(value) {
|
|
47
|
+
return value === undefined ? undefined : usdToMicrosOrZero(value);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The refusal text when `--expected-price` does not match what a paid
|
|
51
|
+
* install would now charge — one wording for every install command so the
|
|
52
|
+
* pin reads the same whichever listing it guarded (OSK-18256).
|
|
53
|
+
*/
|
|
54
|
+
function expectedPriceMismatchMessage(expectedMicros, chargeMicros) {
|
|
55
|
+
return (`--expected-price ${(0, data_provider_1.formatStoreAcquisitionPrice)(expectedMicros)} does not match the price ` +
|
|
56
|
+
`the listing now charges (${(0, data_provider_1.formatStoreAcquisitionPrice)(chargeMicros)}). ` +
|
|
57
|
+
'Nothing was installed — read the price again and ask the person before buying.');
|
|
58
|
+
}
|
|
59
|
+
/** Fields that carry a store price in integer micro-USD without saying so. */
|
|
60
|
+
const MICROS_PRICE_FIELDS = new Set(['price', 'listPrice', 'charge']);
|
|
61
|
+
/**
|
|
62
|
+
* A `--json` payload with every unstated-unit store price restated in
|
|
63
|
+
* dollars: a numeric `price`, `listPrice` or `charge` (integer micro-USD,
|
|
64
|
+
* the one unit store prices travel the wire in — see `storePricing.ts` in
|
|
65
|
+
* `@skrr-ai/data-provider`) gains a sibling `<name>Usd` in dollars, so a
|
|
66
|
+
* reader never has to know the conversion (OSK-18256). Fields that already
|
|
67
|
+
* name their unit (`amountMicros`, `*Micros`) and anything that is not a
|
|
68
|
+
* finite number pass through untouched; the wire fields themselves keep
|
|
69
|
+
* their values.
|
|
70
|
+
*/
|
|
71
|
+
function withUsdPrices(payload) {
|
|
72
|
+
if (Array.isArray(payload)) {
|
|
73
|
+
return payload.map((item) => withUsdPrices(item));
|
|
74
|
+
}
|
|
75
|
+
if (payload === null || typeof payload !== 'object') {
|
|
76
|
+
return payload;
|
|
77
|
+
}
|
|
78
|
+
const out = {};
|
|
79
|
+
for (const [key, value] of Object.entries(payload)) {
|
|
80
|
+
out[key] = withUsdPrices(value);
|
|
81
|
+
if (MICROS_PRICE_FIELDS.has(key) && typeof value === 'number' && Number.isFinite(value)) {
|
|
82
|
+
out[`${key}Usd`] = (0, data_provider_1.listingPriceMicrosToUsd)(value);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return out;
|
|
21
86
|
}
|
|
@@ -30,3 +30,20 @@ export interface HarnessPermissionControlReport {
|
|
|
30
30
|
* rather than a green badge. Additive fields are stripped for compatibility.
|
|
31
31
|
*/
|
|
32
32
|
export declare function parseHarnessPermissionControls(value: unknown): HarnessPermissionControls | null;
|
|
33
|
+
/** Last-reported local configuration and adapter protocol, never authority. */
|
|
34
|
+
export interface HarnessSessionPolicyReport {
|
|
35
|
+
version: 1;
|
|
36
|
+
configuredDefault: {
|
|
37
|
+
provider: 'claude';
|
|
38
|
+
engine: 'sdk' | 'cli';
|
|
39
|
+
permissionMode: 'default' | 'acceptEdits' | 'plan' | 'bypassPermissions';
|
|
40
|
+
} | null;
|
|
41
|
+
taskCommandApproval: {
|
|
42
|
+
protocol: 'task_command_once_v1';
|
|
43
|
+
adapters: readonly {
|
|
44
|
+
provider: 'claude';
|
|
45
|
+
engine: 'sdk';
|
|
46
|
+
}[];
|
|
47
|
+
} | null;
|
|
48
|
+
}
|
|
49
|
+
export declare function parseHarnessSessionPolicyReport(value: unknown): HarnessSessionPolicyReport | null;
|
|
@@ -18,7 +18,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var harnessPermissionControls_exports = {};
|
|
20
20
|
__export(harnessPermissionControls_exports, {
|
|
21
|
-
parseHarnessPermissionControls: () => parseHarnessPermissionControls
|
|
21
|
+
parseHarnessPermissionControls: () => parseHarnessPermissionControls,
|
|
22
|
+
parseHarnessSessionPolicyReport: () => parseHarnessSessionPolicyReport
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(harnessPermissionControls_exports);
|
|
24
25
|
const PLAN = ["harness", "reported-actions", "unsupported", "unknown"];
|
|
@@ -63,7 +64,39 @@ function parseHarnessPermissionControls(value) {
|
|
|
63
64
|
return null;
|
|
64
65
|
}
|
|
65
66
|
}
|
|
67
|
+
function parseHarnessSessionPolicyReport(value) {
|
|
68
|
+
try {
|
|
69
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
70
|
+
return null;
|
|
71
|
+
const row = value;
|
|
72
|
+
if (row.version !== 1)
|
|
73
|
+
return null;
|
|
74
|
+
let configuredDefault = null;
|
|
75
|
+
let taskCommandApproval = null;
|
|
76
|
+
const config = row.configuredDefault;
|
|
77
|
+
if (config && typeof config === "object" && !Array.isArray(config) && config.provider === "claude" && ["sdk", "cli"].includes(config.engine) && ["default", "acceptEdits", "plan", "bypassPermissions"].includes(config.permissionMode)) {
|
|
78
|
+
configuredDefault = Object.freeze({
|
|
79
|
+
provider: "claude",
|
|
80
|
+
engine: config.engine,
|
|
81
|
+
permissionMode: config.permissionMode
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
const approval = row.taskCommandApproval;
|
|
85
|
+
if (approval && typeof approval === "object" && !Array.isArray(approval) && approval.protocol === "task_command_once_v1" && Array.isArray(approval.adapters) && approval.adapters.length === 1 && approval.adapters[0]?.provider === "claude" && approval.adapters[0]?.engine === "sdk") {
|
|
86
|
+
taskCommandApproval = Object.freeze({
|
|
87
|
+
protocol: "task_command_once_v1",
|
|
88
|
+
adapters: Object.freeze([
|
|
89
|
+
Object.freeze({ provider: "claude", engine: "sdk" })
|
|
90
|
+
])
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return Object.freeze({ version: 1, configuredDefault, taskCommandApproval });
|
|
94
|
+
} catch {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
66
98
|
// Annotate the CommonJS export names for ESM import in node:
|
|
67
99
|
0 && (module.exports = {
|
|
68
|
-
parseHarnessPermissionControls
|
|
100
|
+
parseHarnessPermissionControls,
|
|
101
|
+
parseHarnessSessionPolicyReport
|
|
69
102
|
});
|
|
@@ -30,3 +30,20 @@ export interface HarnessPermissionControlReport {
|
|
|
30
30
|
* rather than a green badge. Additive fields are stripped for compatibility.
|
|
31
31
|
*/
|
|
32
32
|
export declare function parseHarnessPermissionControls(value: unknown): HarnessPermissionControls | null;
|
|
33
|
+
/** Last-reported local configuration and adapter protocol, never authority. */
|
|
34
|
+
export interface HarnessSessionPolicyReport {
|
|
35
|
+
version: 1;
|
|
36
|
+
configuredDefault: {
|
|
37
|
+
provider: 'claude';
|
|
38
|
+
engine: 'sdk' | 'cli';
|
|
39
|
+
permissionMode: 'default' | 'acceptEdits' | 'plan' | 'bypassPermissions';
|
|
40
|
+
} | null;
|
|
41
|
+
taskCommandApproval: {
|
|
42
|
+
protocol: 'task_command_once_v1';
|
|
43
|
+
adapters: readonly {
|
|
44
|
+
provider: 'claude';
|
|
45
|
+
engine: 'sdk';
|
|
46
|
+
}[];
|
|
47
|
+
} | null;
|
|
48
|
+
}
|
|
49
|
+
export declare function parseHarnessSessionPolicyReport(value: unknown): HarnessSessionPolicyReport | null;
|
|
@@ -57,3 +57,47 @@ export function parseHarnessPermissionControls(value) {
|
|
|
57
57
|
return null;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
+
export function parseHarnessSessionPolicyReport(value) {
|
|
61
|
+
try {
|
|
62
|
+
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
63
|
+
return null;
|
|
64
|
+
const row = value;
|
|
65
|
+
if (row.version !== 1)
|
|
66
|
+
return null;
|
|
67
|
+
let configuredDefault = null;
|
|
68
|
+
let taskCommandApproval = null;
|
|
69
|
+
const config = row.configuredDefault;
|
|
70
|
+
if (config &&
|
|
71
|
+
typeof config === 'object' &&
|
|
72
|
+
!Array.isArray(config) &&
|
|
73
|
+
config.provider === 'claude' &&
|
|
74
|
+
['sdk', 'cli'].includes(config.engine) &&
|
|
75
|
+
['default', 'acceptEdits', 'plan', 'bypassPermissions'].includes(config.permissionMode)) {
|
|
76
|
+
configuredDefault = Object.freeze({
|
|
77
|
+
provider: 'claude',
|
|
78
|
+
engine: config.engine,
|
|
79
|
+
permissionMode: config.permissionMode,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
const approval = row.taskCommandApproval;
|
|
83
|
+
if (approval &&
|
|
84
|
+
typeof approval === 'object' &&
|
|
85
|
+
!Array.isArray(approval) &&
|
|
86
|
+
approval.protocol === 'task_command_once_v1' &&
|
|
87
|
+
Array.isArray(approval.adapters) &&
|
|
88
|
+
approval.adapters.length === 1 &&
|
|
89
|
+
approval.adapters[0]?.provider === 'claude' &&
|
|
90
|
+
approval.adapters[0]?.engine === 'sdk') {
|
|
91
|
+
taskCommandApproval = Object.freeze({
|
|
92
|
+
protocol: 'task_command_once_v1',
|
|
93
|
+
adapters: Object.freeze([
|
|
94
|
+
Object.freeze({ provider: 'claude', engine: 'sdk' }),
|
|
95
|
+
]),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return Object.freeze({ version: 1, configuredDefault, taskCommandApproval });
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
}
|