@openape/apes 1.30.0 → 1.31.1
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/chunk-3LH4FT4R.js +138 -0
- package/dist/chunk-3LH4FT4R.js.map +1 -0
- package/dist/{chunk-NYJSBFLG.js → chunk-MMBFV5WN.js} +14 -6
- package/dist/{chunk-NYJSBFLG.js.map → chunk-MMBFV5WN.js.map} +1 -1
- package/dist/cli.js +690 -644
- package/dist/cli.js.map +1 -1
- package/dist/{http-UPOTOYQV.js → http-SILH37L7.js} +2 -2
- package/dist/index.d.ts +30 -2
- package/dist/index.js +9 -4
- package/dist/index.js.map +1 -1
- package/dist/{orchestrator-P7QFDBBK.js → orchestrator-6PZXCE54.js} +2 -2
- package/dist/{server-X4HHOCKV.js → server-32CG5WG2.js} +3 -3
- package/package.json +5 -5
- package/dist/chunk-QMMRZPD2.js +0 -47
- package/dist/chunk-QMMRZPD2.js.map +0 -1
- /package/dist/{http-UPOTOYQV.js.map → http-SILH37L7.js.map} +0 -0
- /package/dist/{orchestrator-P7QFDBBK.js.map → orchestrator-6PZXCE54.js.map} +0 -0
- /package/dist/{server-X4HHOCKV.js.map → server-32CG5WG2.js.map} +0 -0
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
getAgentChallengeEndpoint,
|
|
9
9
|
getDelegationsEndpoint,
|
|
10
10
|
getGrantsEndpoint
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MMBFV5WN.js";
|
|
12
12
|
import "./chunk-OBF7IMQ2.js";
|
|
13
13
|
export {
|
|
14
14
|
ApiError,
|
|
@@ -20,4 +20,4 @@ export {
|
|
|
20
20
|
getDelegationsEndpoint,
|
|
21
21
|
getGrantsEndpoint
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=http-
|
|
23
|
+
//# sourceMappingURL=http-SILH37L7.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ResolvedCommand } from '@openape/shapes';
|
|
2
2
|
export { AdapterMeta, BuiltGrantRequest, GrantRequestOptions, LoadedAdapter, RegistryEntry, RegistryIndex, ResolvedCapability, ResolvedCommand, ShapesAdapter, ShapesOperation, appendAuditLog, buildExactCommandGrantRequest, buildStructuredCliGrantRequest, extractShellCommandString, fetchRegistry, findAdapter, findConflictingAdapters, getInstalledDigest, installAdapter, isInstalled, loadAdapter, loadOrInstallAdapter, parseShellCommand, removeAdapter, resolveAdapterPath, resolveCapabilityRequest, resolveCommand, searchAdapters, tryLoadAdapter } from '@openape/shapes';
|
|
3
|
-
export { ApeShellResult, ChatMessage, RpcSessionMap, RunOptions, RunResult, RunStreamHandlers, RuntimeConfig, TOOLS, ToolDefinition, TraceEntry, runApeShell, runLoop, taskTools } from '@openape/agent-runtime';
|
|
3
|
+
export { ApeShellResult, ChatMessage, RpcSessionMap, RunOptions, RunResult, RunStreamHandlers, RuntimeConfig, TOOLS, ToolDefinition, TraceEntry, addReadRoot, runApeShell, runLoop, taskTools } from '@openape/agent-runtime';
|
|
4
4
|
|
|
5
5
|
interface SimilarGrantsInfo {
|
|
6
6
|
similar_grants: Array<{
|
|
@@ -143,6 +143,34 @@ declare function apiFetch<T = unknown>(path: string, options?: {
|
|
|
143
143
|
token?: string;
|
|
144
144
|
}): Promise<T>;
|
|
145
145
|
|
|
146
|
+
interface MaterializeOptions {
|
|
147
|
+
dir?: string;
|
|
148
|
+
keyPath?: string;
|
|
149
|
+
/** Target env map (defaults to process.env). Injected in tests. */
|
|
150
|
+
env?: NodeJS.ProcessEnv;
|
|
151
|
+
/** Env names applied by a previous materialize, to drop on revoke. */
|
|
152
|
+
previouslyApplied?: Iterable<string>;
|
|
153
|
+
log?: (line: string) => void;
|
|
154
|
+
}
|
|
155
|
+
interface MaterializeResult {
|
|
156
|
+
applied: string[];
|
|
157
|
+
failed: string[];
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Open every sealed blob in the secrets dir and set the corresponding
|
|
161
|
+
* env var. Any env that was applied before but whose blob is now gone
|
|
162
|
+
* (revoke) is deleted. Best-effort per blob — a corrupt/foreign blob
|
|
163
|
+
* is logged and skipped, never throws.
|
|
164
|
+
*/
|
|
165
|
+
declare function materializeSecrets(opts?: MaterializeOptions): MaterializeResult;
|
|
166
|
+
/**
|
|
167
|
+
* Materialize once, then fs.watch the secrets dir and re-materialize
|
|
168
|
+
* on any change (rotate/revoke take effect live — the user's M2 v1
|
|
169
|
+
* choice). Returns a stop function. Safe to call when the dir doesn't
|
|
170
|
+
* exist yet (watch attaches once it appears on the next agent start).
|
|
171
|
+
*/
|
|
172
|
+
declare function startSecretsWatcher(opts?: MaterializeOptions): () => void;
|
|
173
|
+
|
|
146
174
|
/**
|
|
147
175
|
* Parse a human-readable duration string into seconds.
|
|
148
176
|
* Supported formats: 30s, 5m, 1h, 7d
|
|
@@ -158,4 +186,4 @@ declare class CliExit extends Error {
|
|
|
158
186
|
constructor(exitCode?: number);
|
|
159
187
|
}
|
|
160
188
|
|
|
161
|
-
export { type ApesConfig, ApiError, type AuthData, CliError, CliExit, apiFetch, clearAuth, createShapesGrant, discoverEndpoints, extractOption, extractWrappedCommand, fetchGrantToken, findExistingGrant, getAuthToken, getIdpUrl, getRequesterIdentity, loadAuth, loadConfig, parseDuration, saveAuth, saveConfig, verifyAndExecute, waitForGrantStatus };
|
|
189
|
+
export { type ApesConfig, ApiError, type AuthData, CliError, CliExit, apiFetch, clearAuth, createShapesGrant, discoverEndpoints, extractOption, extractWrappedCommand, fetchGrantToken, findExistingGrant, getAuthToken, getIdpUrl, getRequesterIdentity, loadAuth, loadConfig, materializeSecrets, parseDuration, saveAuth, saveConfig, startSecretsWatcher, verifyAndExecute, waitForGrantStatus };
|
package/dist/index.js
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
CliError,
|
|
4
4
|
CliExit,
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
materializeSecrets,
|
|
6
|
+
parseDuration,
|
|
7
|
+
startSecretsWatcher
|
|
8
|
+
} from "./chunk-3LH4FT4R.js";
|
|
7
9
|
import {
|
|
8
10
|
createShapesGrant,
|
|
9
11
|
extractOption,
|
|
@@ -17,7 +19,7 @@ import {
|
|
|
17
19
|
ApiError,
|
|
18
20
|
apiFetch,
|
|
19
21
|
discoverEndpoints
|
|
20
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-MMBFV5WN.js";
|
|
21
23
|
import {
|
|
22
24
|
clearAuth,
|
|
23
25
|
getAuthToken,
|
|
@@ -51,13 +53,14 @@ import {
|
|
|
51
53
|
searchAdapters,
|
|
52
54
|
tryLoadAdapter
|
|
53
55
|
} from "@openape/shapes";
|
|
54
|
-
import { runLoop, RpcSessionMap, taskTools, TOOLS, runApeShell } from "@openape/agent-runtime";
|
|
56
|
+
import { runLoop, RpcSessionMap, taskTools, TOOLS, runApeShell, addReadRoot } from "@openape/agent-runtime";
|
|
55
57
|
export {
|
|
56
58
|
ApiError,
|
|
57
59
|
CliError,
|
|
58
60
|
CliExit,
|
|
59
61
|
RpcSessionMap,
|
|
60
62
|
TOOLS,
|
|
63
|
+
addReadRoot,
|
|
61
64
|
apiFetch,
|
|
62
65
|
appendAuditLog,
|
|
63
66
|
buildExactCommandGrantRequest,
|
|
@@ -83,6 +86,7 @@ export {
|
|
|
83
86
|
loadAuth,
|
|
84
87
|
loadConfig,
|
|
85
88
|
loadOrInstallAdapter,
|
|
89
|
+
materializeSecrets,
|
|
86
90
|
parseDuration,
|
|
87
91
|
parseShellCommand,
|
|
88
92
|
removeAdapter,
|
|
@@ -94,6 +98,7 @@ export {
|
|
|
94
98
|
saveAuth,
|
|
95
99
|
saveConfig,
|
|
96
100
|
searchAdapters,
|
|
101
|
+
startSecretsWatcher,
|
|
97
102
|
taskTools,
|
|
98
103
|
tryLoadAdapter,
|
|
99
104
|
verifyAndExecute,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Pure shapes library — re-exported from @openape/shapes\nexport {\n appendAuditLog,\n buildExactCommandGrantRequest,\n buildStructuredCliGrantRequest,\n extractShellCommandString,\n fetchRegistry,\n findAdapter,\n findConflictingAdapters,\n getInstalledDigest,\n installAdapter,\n isInstalled,\n loadAdapter,\n loadOrInstallAdapter,\n parseShellCommand,\n removeAdapter,\n resolveAdapterPath,\n resolveCapabilityRequest,\n resolveCommand,\n searchAdapters,\n tryLoadAdapter,\n} from '@openape/shapes'\n\nexport type {\n AdapterMeta,\n BuiltGrantRequest,\n GrantRequestOptions,\n LoadedAdapter,\n RegistryEntry,\n RegistryIndex,\n ResolvedCapability,\n ResolvedCommand,\n ShapesAdapter,\n ShapesOperation,\n} from '@openape/shapes'\n\n// Grant-orchestration + CLI glue — stayed in apes\nexport { createShapesGrant, fetchGrantToken, findExistingGrant, verifyAndExecute, waitForGrantStatus } from './shapes/grants.js'\nexport { extractOption, extractWrappedCommand } from './shapes/commands/explain.js'\n\n// Apes-specific exports\nexport { loadAuth, saveAuth, clearAuth, loadConfig, saveConfig, getIdpUrl, getAuthToken, getRequesterIdentity } from './config'\nexport type { AuthData, ApesConfig } from './config'\nexport { apiFetch, discoverEndpoints, ApiError } from './http'\nexport { parseDuration } from './duration'\nexport { CliError, CliExit } from './errors'\n\n// Agent-runtime: callable in-process from the chat-bridge so it doesn't\n// need to spawn `apes agents serve --rpc` per turn. Same loop the\n// stdio-RPC server runs internally — see commands/agents/serve.ts.\nexport { runLoop, RpcSessionMap, taskTools, TOOLS, runApeShell } from '@openape/agent-runtime'\nexport type {\n ChatMessage,\n RunOptions,\n RunResult,\n RuntimeConfig,\n RunStreamHandlers,\n TraceEntry,\n ToolDefinition,\n ApeShellResult,\n} from '@openape/agent-runtime'\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Pure shapes library — re-exported from @openape/shapes\nexport {\n appendAuditLog,\n buildExactCommandGrantRequest,\n buildStructuredCliGrantRequest,\n extractShellCommandString,\n fetchRegistry,\n findAdapter,\n findConflictingAdapters,\n getInstalledDigest,\n installAdapter,\n isInstalled,\n loadAdapter,\n loadOrInstallAdapter,\n parseShellCommand,\n removeAdapter,\n resolveAdapterPath,\n resolveCapabilityRequest,\n resolveCommand,\n searchAdapters,\n tryLoadAdapter,\n} from '@openape/shapes'\n\nexport type {\n AdapterMeta,\n BuiltGrantRequest,\n GrantRequestOptions,\n LoadedAdapter,\n RegistryEntry,\n RegistryIndex,\n ResolvedCapability,\n ResolvedCommand,\n ShapesAdapter,\n ShapesOperation,\n} from '@openape/shapes'\n\n// Grant-orchestration + CLI glue — stayed in apes\nexport { createShapesGrant, fetchGrantToken, findExistingGrant, verifyAndExecute, waitForGrantStatus } from './shapes/grants.js'\nexport { extractOption, extractWrappedCommand } from './shapes/commands/explain.js'\n\n// Apes-specific exports\nexport { loadAuth, saveAuth, clearAuth, loadConfig, saveConfig, getIdpUrl, getAuthToken, getRequesterIdentity } from './config'\nexport type { AuthData, ApesConfig } from './config'\nexport { apiFetch, discoverEndpoints, ApiError } from './http'\nexport { materializeSecrets, startSecretsWatcher } from './lib/agent-secrets-runtime'\nexport { parseDuration } from './duration'\nexport { CliError, CliExit } from './errors'\n\n// Agent-runtime: callable in-process from the chat-bridge so it doesn't\n// need to spawn `apes agents serve --rpc` per turn. Same loop the\n// stdio-RPC server runs internally — see commands/agents/serve.ts.\nexport { runLoop, RpcSessionMap, taskTools, TOOLS, runApeShell, addReadRoot } from '@openape/agent-runtime'\nexport type {\n ChatMessage,\n RunOptions,\n RunResult,\n RuntimeConfig,\n RunStreamHandlers,\n TraceEntry,\n ToolDefinition,\n ApeShellResult,\n} from '@openape/agent-runtime'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA8BP,SAAS,SAAS,eAAe,WAAW,OAAO,aAAa,mBAAmB;","names":[]}
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
import {
|
|
21
21
|
apiFetch,
|
|
22
22
|
getGrantsEndpoint
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-MMBFV5WN.js";
|
|
24
24
|
import {
|
|
25
25
|
loadAuth
|
|
26
26
|
} from "./chunk-OBF7IMQ2.js";
|
|
@@ -779,4 +779,4 @@ async function runInteractiveShell() {
|
|
|
779
779
|
export {
|
|
780
780
|
runInteractiveShell
|
|
781
781
|
};
|
|
782
|
-
//# sourceMappingURL=orchestrator-
|
|
782
|
+
//# sourceMappingURL=orchestrator-6PZXCE54.js.map
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
apiFetch,
|
|
13
13
|
getGrantsEndpoint
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-MMBFV5WN.js";
|
|
15
15
|
import {
|
|
16
16
|
getAuthToken,
|
|
17
17
|
getIdpUrl,
|
|
@@ -305,7 +305,7 @@ function registerAdapterTools(server) {
|
|
|
305
305
|
async function startMcpServer(transport, port) {
|
|
306
306
|
const server = new McpServer({
|
|
307
307
|
name: "apes",
|
|
308
|
-
version: true ? "1.
|
|
308
|
+
version: true ? "1.31.1" : "0.1.0"
|
|
309
309
|
});
|
|
310
310
|
registerStaticTools(server);
|
|
311
311
|
registerAdapterTools(server);
|
|
@@ -333,4 +333,4 @@ async function startMcpServer(transport, port) {
|
|
|
333
333
|
export {
|
|
334
334
|
startMcpServer
|
|
335
335
|
};
|
|
336
|
-
//# sourceMappingURL=server-
|
|
336
|
+
//# sourceMappingURL=server-32CG5WG2.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openape/apes",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.31.1",
|
|
4
4
|
"turbo": {
|
|
5
5
|
"tags": [
|
|
6
6
|
"publishable"
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
"consola": "^3.4.2",
|
|
30
30
|
"giget": "^2.0.0",
|
|
31
31
|
"@lydell/node-pty": "1.2.0-beta.12",
|
|
32
|
-
"shell-quote": "^1.8.
|
|
32
|
+
"shell-quote": "^1.8.4",
|
|
33
33
|
"zod": "^4.3.6",
|
|
34
34
|
"@openape/cli-auth": "0.5.0",
|
|
35
|
-
"@openape/core": "0.18.0",
|
|
36
|
-
"@openape/agent-runtime": "0.2.1",
|
|
37
35
|
"@openape/grants": "0.12.1",
|
|
36
|
+
"@openape/core": "0.18.0",
|
|
37
|
+
"@openape/agent-runtime": "0.2.2",
|
|
38
38
|
"@openape/shapes": "0.7.1",
|
|
39
39
|
"@openape/proxy": "0.4.6"
|
|
40
40
|
},
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"tsup": "^8.5.1",
|
|
48
48
|
"typescript": "^5.8.2",
|
|
49
49
|
"vitest": "^4.1.7",
|
|
50
|
-
"@openape/server": "0.3.
|
|
50
|
+
"@openape/server": "0.3.15"
|
|
51
51
|
},
|
|
52
52
|
"license": "MIT",
|
|
53
53
|
"author": "Patrick Hofmann <phofmann@delta-mind.at>",
|
package/dist/chunk-QMMRZPD2.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// src/errors.ts
|
|
4
|
-
var CliError = class extends Error {
|
|
5
|
-
constructor(message, exitCode = 1) {
|
|
6
|
-
super(message);
|
|
7
|
-
this.exitCode = exitCode;
|
|
8
|
-
this.name = "CliError";
|
|
9
|
-
}
|
|
10
|
-
exitCode;
|
|
11
|
-
};
|
|
12
|
-
var CliExit = class extends Error {
|
|
13
|
-
constructor(exitCode = 0) {
|
|
14
|
-
super("");
|
|
15
|
-
this.exitCode = exitCode;
|
|
16
|
-
this.name = "CliExit";
|
|
17
|
-
}
|
|
18
|
-
exitCode;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
// src/duration.ts
|
|
22
|
-
function parseDuration(value) {
|
|
23
|
-
const match = value.match(/^(\d+)\s*([smhd])$/);
|
|
24
|
-
if (!match) {
|
|
25
|
-
throw new Error(`Invalid duration format: "${value}". Use e.g. 30m, 1h, 7d`);
|
|
26
|
-
}
|
|
27
|
-
const amount = Number.parseInt(match[1], 10);
|
|
28
|
-
switch (match[2]) {
|
|
29
|
-
case "s":
|
|
30
|
-
return amount;
|
|
31
|
-
case "m":
|
|
32
|
-
return amount * 60;
|
|
33
|
-
case "h":
|
|
34
|
-
return amount * 3600;
|
|
35
|
-
case "d":
|
|
36
|
-
return amount * 86400;
|
|
37
|
-
default:
|
|
38
|
-
throw new Error(`Unknown duration unit: ${match[2]}`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export {
|
|
43
|
-
CliError,
|
|
44
|
-
CliExit,
|
|
45
|
-
parseDuration
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=chunk-QMMRZPD2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/errors.ts","../src/duration.ts"],"sourcesContent":["export class CliError extends Error {\n constructor(message: string, public exitCode: number = 1) {\n super(message)\n this.name = 'CliError'\n }\n}\n\nexport class CliExit extends Error {\n constructor(public exitCode: number = 0) {\n super('')\n this.name = 'CliExit'\n }\n}\n","/**\n * Parse a human-readable duration string into seconds.\n * Supported formats: 30s, 5m, 1h, 7d\n */\nexport function parseDuration(value: string): number {\n const match = value.match(/^(\\d+)\\s*([smhd])$/)\n if (!match) {\n throw new Error(`Invalid duration format: \"${value}\". Use e.g. 30m, 1h, 7d`)\n }\n const amount = Number.parseInt(match[1]!, 10)\n switch (match[2]) {\n case 's': return amount\n case 'm': return amount * 60\n case 'h': return amount * 3600\n case 'd': return amount * 86400\n default: throw new Error(`Unknown duration unit: ${match[2]}`)\n }\n}\n"],"mappings":";;;AAAO,IAAM,WAAN,cAAuB,MAAM;AAAA,EAClC,YAAY,SAAwB,WAAmB,GAAG;AACxD,UAAM,OAAO;AADqB;AAElC,SAAK,OAAO;AAAA,EACd;AAAA,EAHoC;AAItC;AAEO,IAAM,UAAN,cAAsB,MAAM;AAAA,EACjC,YAAmB,WAAmB,GAAG;AACvC,UAAM,EAAE;AADS;AAEjB,SAAK,OAAO;AAAA,EACd;AAAA,EAHmB;AAIrB;;;ACRO,SAAS,cAAc,OAAuB;AACnD,QAAM,QAAQ,MAAM,MAAM,oBAAoB;AAC9C,MAAI,CAAC,OAAO;AACV,UAAM,IAAI,MAAM,6BAA6B,KAAK,yBAAyB;AAAA,EAC7E;AACA,QAAM,SAAS,OAAO,SAAS,MAAM,CAAC,GAAI,EAAE;AAC5C,UAAQ,MAAM,CAAC,GAAG;AAAA,IAChB,KAAK;AAAK,aAAO;AAAA,IACjB,KAAK;AAAK,aAAO,SAAS;AAAA,IAC1B,KAAK;AAAK,aAAO,SAAS;AAAA,IAC1B,KAAK;AAAK,aAAO,SAAS;AAAA,IAC1B;AAAS,YAAM,IAAI,MAAM,0BAA0B,MAAM,CAAC,CAAC,EAAE;AAAA,EAC/D;AACF;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|