@ai-ecoverse/slicc-agent 6.11.1 → 6.11.2
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/README.md +11 -3
- package/dist/control.js.map +1 -1
- package/dist/host.js.map +1 -1
- package/dist/secrets/extension.js +35 -15
- package/dist/secrets/extension.js.map +2 -2
- package/dist/secrets/names.js +175 -26
- package/dist/secrets/names.js.map +3 -3
- package/dist/secrets/view.js +12 -2
- package/dist/secrets/view.js.map +2 -2
- package/dist/spectrum/messages.js +6 -2
- package/dist/spectrum/messages.js.map +2 -2
- package/dist/types/control.d.ts +2 -2
- package/dist/types/host.d.ts +2 -2
- package/dist/types/secrets/extension.d.ts +10 -6
- package/dist/types/secrets/names.d.ts +34 -6
- package/dist/types/secrets/view.d.ts +7 -2
- package/package.json +2 -1
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import type { JsonValue } from '@earendil-works/chord';
|
|
2
2
|
import { type Extension, type ToolExecutionResult } from '@earendil-works/pi-durable';
|
|
3
|
-
import type { Names,
|
|
3
|
+
import type { Names, SecretListing } from './names.ts';
|
|
4
4
|
import type { Scrub } from './scrub.ts';
|
|
5
5
|
import type { Vault } from './vault.ts';
|
|
6
|
-
import { listedLine, SECRETS_KIND } from './view.ts';
|
|
7
|
-
export { listedLine, SECRETS_KIND };
|
|
6
|
+
import { exposedLine, listedLine, SECRETS_KIND, unavailableLine } from './view.ts';
|
|
7
|
+
export { exposedLine, listedLine, SECRETS_KIND, unavailableLine };
|
|
8
8
|
export declare const SECRETS = "slicc-secrets";
|
|
9
9
|
export declare const SECRETS_COMMAND = "/secrets";
|
|
10
10
|
export declare const SHELL_GRANTS: readonly ['fnox', 'exec', '--shell-grants', '--'];
|
|
11
|
-
export declare const MODEL_LINE = "Credentials are env vars (`$NAME`) holding placeholders
|
|
11
|
+
export declare const MODEL_LINE = "Credentials are env vars (`$NAME`) holding placeholders, listed below with where each works (`fnox list` shows the fnox config). The vault fills in the real value only in the listed header, for the listed domain, method and path, over HTTPS (curl, git, fetch). Adding a rule means editing `/etc/fnox/config.toml` with sudo, which the user approves. `fnox exec` gives real values only for secrets the user enabled for exec, and the secrets listed as 'in every bash' already hold real values in your commands. Everything is logged, and stored values are replaced by their placeholder in everything you see; edit around placeholders, since files show them too. Never ask the user to paste a credential into the chat.";
|
|
12
12
|
export declare function scrubResult(result: ToolExecutionResult, scrub: Pick<Scrub, 'texts'>): Promise<ToolExecutionResult | undefined>;
|
|
13
|
-
export declare
|
|
14
|
-
export declare function
|
|
13
|
+
export declare const NO_SECRETS = "No secrets are configured: the fnox config has no keys and the vault no sealed secrets.";
|
|
14
|
+
export declare function renderSecrets(listing: SecretListing): string;
|
|
15
|
+
export declare function secretsEntry(listing: SecretListing): {
|
|
15
16
|
kind: string;
|
|
16
17
|
data: {
|
|
17
18
|
names: JsonValue;
|
|
19
|
+
error: string | null;
|
|
20
|
+
exposed: string[];
|
|
18
21
|
};
|
|
19
22
|
model: {
|
|
20
23
|
role: 'user';
|
|
@@ -22,6 +25,7 @@ export declare function secretsEntry(names: readonly SecretName[]): {
|
|
|
22
25
|
timestamp: number;
|
|
23
26
|
}[];
|
|
24
27
|
};
|
|
28
|
+
export declare function granting(listing: SecretListing): boolean;
|
|
25
29
|
export declare function shellGrants(names: Pick<Names, 'state'>): (argv: readonly string[]) => readonly string[];
|
|
26
30
|
export declare function secretsExtension(deps: {
|
|
27
31
|
names: Pick<Names, 'state'>;
|
|
@@ -6,19 +6,47 @@ export interface SecretRule {
|
|
|
6
6
|
header?: string;
|
|
7
7
|
methods?: string[];
|
|
8
8
|
paths?: string[];
|
|
9
|
+
proposed?: true;
|
|
9
10
|
}
|
|
10
11
|
export interface SecretName {
|
|
11
12
|
name: string;
|
|
12
|
-
placeholder: string;
|
|
13
|
+
placeholder: string | null;
|
|
13
14
|
exec: false | 'any' | 'argv' | 'shell';
|
|
14
15
|
rules: SecretRule[];
|
|
16
|
+
fnox: boolean;
|
|
15
17
|
}
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
export interface SecretListing {
|
|
19
|
+
names: SecretName[];
|
|
20
|
+
error: string | null;
|
|
21
|
+
exposed: string[];
|
|
22
|
+
}
|
|
23
|
+
export declare const DESCRIBE = "fnox env --json --describe";
|
|
24
|
+
export declare const RULES = "fnox proxy rules --json";
|
|
25
|
+
export declare const SEALED_LIST = "exec 3<>/dev/sealed && printf '%s' '{\"v\":1,\"op\":\"list\"}' >&3 && cat <&3";
|
|
26
|
+
export declare const NO_PROXY = "No [proxy] configuration found";
|
|
27
|
+
export declare const MISSING = "fnox isn't installed";
|
|
28
|
+
export declare const EXPOSED = "shell grants are off: fnox exec would also give every command the unsealed fnox secrets";
|
|
29
|
+
export declare function guarded(command: string): string;
|
|
30
|
+
export declare class Unavailable extends Error {
|
|
31
|
+
readonly detail: string | undefined;
|
|
32
|
+
constructor(shown: string, detail?: string);
|
|
33
|
+
}
|
|
34
|
+
export interface FnoxKey {
|
|
35
|
+
name: string;
|
|
36
|
+
injected: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare function parseDescribe(text: string): FnoxKey[];
|
|
39
|
+
export declare function parseRules(text: string): Map<string, SecretRule[]>;
|
|
40
|
+
export declare function parseSealed(text: string): Omit<SecretName, 'fnox'>[];
|
|
41
|
+
export declare function joinNames(keys: readonly FnoxKey[], proposed: ReadonlyMap<string, SecretRule[]>, sealed: readonly Omit<SecretName, 'fnox'>[]): SecretListing;
|
|
42
|
+
export interface Listed {
|
|
43
|
+
listing: SecretListing;
|
|
44
|
+
details: string[];
|
|
45
|
+
}
|
|
46
|
+
export declare function listNames(env: ExecutionEnv, context: Context): Promise<Listed>;
|
|
19
47
|
export interface Names {
|
|
20
|
-
readonly state: MutableReplicatedState<
|
|
48
|
+
readonly state: MutableReplicatedState<SecretListing>;
|
|
21
49
|
refresh(context: Context): Promise<void>;
|
|
22
50
|
close(): void;
|
|
23
51
|
}
|
|
24
|
-
export declare function secretNames(env: ExecutionEnv, vault: Pick<Vault, 'state'
|
|
52
|
+
export declare function secretNames(env: ExecutionEnv, vault: Pick<Vault, 'state' | 'texts'>, warn?: (message: string) => void): Names;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SecretListing } from './names.ts';
|
|
2
2
|
import type { VaultState } from './vault.ts';
|
|
3
3
|
export declare const SECRETS_KIND = "slicc.secrets";
|
|
4
4
|
export interface VaultHold {
|
|
@@ -6,4 +6,9 @@ export interface VaultHold {
|
|
|
6
6
|
held: number;
|
|
7
7
|
}
|
|
8
8
|
export declare function vaultHold(state: VaultState | undefined): VaultHold | null;
|
|
9
|
-
export declare function
|
|
9
|
+
export declare function unavailableLine(reason: string): string;
|
|
10
|
+
export declare function exposedLine(exposed: readonly string[]): string;
|
|
11
|
+
export declare function listedLine(listing: Pick<SecretListing, 'names'> & {
|
|
12
|
+
error?: string | null;
|
|
13
|
+
exposed?: string[];
|
|
14
|
+
}): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/slicc-agent",
|
|
3
|
-
"version": "6.11.
|
|
3
|
+
"version": "6.11.2",
|
|
4
4
|
"description": "SLICC's agent core on pi durable: an agent worker, session storage, remoting and pi extensions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
"@ai-ecoverse/slicc-scrub": "1.0.0",
|
|
70
70
|
"@ai-ecoverse/slicc-shared-web": "1.24.2",
|
|
71
71
|
"@ai-ecoverse/slicc-spectrum": "1.94.0",
|
|
72
|
+
"@ai-ecoverse/wasi-fnox": "1.39.0-5",
|
|
72
73
|
"@ai-ecoverse/wasm-bash": "5.3.0-20",
|
|
73
74
|
"@ai-ecoverse/wasm-coreutils": "9.12.0-10",
|
|
74
75
|
"@ai-ecoverse/wasm-git": "2.55.0-17",
|