@jini-ai/platform 0.7.2 → 0.7.3-next.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/CHANGELOG.md +2 -2
- package/README.md +16 -4
- package/dist/asset-cache.d.ts +13 -3
- package/dist/asset-cache.js +163 -154
- package/dist/blob-storage.d.ts +3 -32
- package/dist/blob-storage.js +1 -9
- package/dist/child-environment.d.ts +0 -16
- package/dist/child-environment.js +0 -25
- package/dist/command.d.ts +6 -11
- package/dist/command.js +8 -54
- package/dist/download-lock.d.ts +4 -0
- package/dist/download-lock.js +82 -0
- package/dist/download-maintenance.d.ts +5 -0
- package/dist/download-maintenance.js +82 -0
- package/dist/download-state.d.ts +8 -0
- package/dist/download-state.js +126 -0
- package/dist/download-store.d.ts +22 -0
- package/dist/download-store.js +174 -0
- package/dist/download-target.d.ts +10 -0
- package/dist/download-target.js +102 -0
- package/dist/download-transfer.d.ts +12 -0
- package/dist/download-transfer.js +174 -0
- package/dist/download-types.d.ts +162 -0
- package/dist/download-types.js +31 -0
- package/dist/download.d.ts +1 -89
- package/dist/download.js +8 -738
- package/dist/fetch-with-timeout.d.ts +7 -32
- package/dist/fetch-with-timeout.js +1 -77
- package/dist/fs/app-data-root.d.ts +28 -0
- package/dist/fs/app-data-root.js +35 -0
- package/dist/fs/atomic-write.js +1 -1
- package/dist/fs/boot-identity.d.ts +1 -4
- package/dist/fs/directory-delete-guard.d.ts +93 -0
- package/dist/fs/directory-delete-guard.js +148 -0
- package/dist/fs/directory-registry.js +45 -35
- package/dist/fs/directory-relocation.d.ts +82 -0
- package/dist/fs/directory-relocation.js +99 -0
- package/dist/fs/directory-running-lock.d.ts +1 -1
- package/dist/fs/directory-running-lock.js +24 -21
- package/dist/fs/directory-sync.js +1 -1
- package/dist/fs/directory-user-config.js +30 -3
- package/dist/fs/directory-workspace.d.ts +34 -30
- package/dist/fs/directory-workspace.js +70 -29
- package/dist/fs/durable-json.d.ts +6 -15
- package/dist/fs/durable-json.js +38 -35
- package/dist/fs/errno.d.ts +12 -3
- package/dist/fs/errno.js +5 -3
- package/dist/fs/file-lock.d.ts +3 -87
- package/dist/fs/file-lock.js +16 -30
- package/dist/fs/guarded-reader.js +335 -315
- package/dist/fs/index.d.ts +5 -0
- package/dist/fs/index.js +5 -0
- package/dist/fs/recent-directories.d.ts +46 -0
- package/dist/fs/recent-directories.js +68 -0
- package/dist/fs/remove-directory-tree.d.ts +20 -0
- package/dist/fs/remove-directory-tree.js +28 -0
- package/dist/fs/user-data-directories.js +2 -2
- package/dist/fs/workspace-directory.js +2 -1
- package/dist/fs.d.ts +16 -4
- package/dist/fs.js +4 -4
- package/dist/home-expansion.d.ts +7 -2
- package/dist/home-expansion.js +3 -3
- package/dist/http/guarded/client.d.ts +1 -2
- package/dist/http/guarded/client.js +2 -1
- package/dist/http/guarded/index.d.ts +0 -3
- package/dist/http/guarded/node-ports.d.ts +1 -1
- package/dist/http/guarded/transport.fetch.d.ts +2 -3
- package/dist/http/guarded/transport.fetch.js +64 -58
- package/dist/http.d.ts +3 -1
- package/dist/http.js +2 -2
- package/dist/index.d.ts +10 -11
- package/dist/index.js +7 -6
- package/dist/mail/activity/activity.d.ts +136 -0
- package/dist/mail/activity/activity.js +172 -0
- package/dist/mail/activity/ports.d.ts +113 -0
- package/dist/mail/activity/suppressions.d.ts +82 -0
- package/dist/mail/activity/suppressions.js +119 -0
- package/dist/mail/activity/vocabulary.d.ts +10 -0
- package/dist/mail/activity/vocabulary.js +8 -0
- package/dist/mail/builtin-providers.d.ts +12 -6
- package/dist/mail/builtin-providers.js +14 -11
- package/dist/mail/delivery-wrapper.js +2 -1
- package/dist/mail/email-sender-registry.d.ts +1 -1
- package/dist/mail/email-sender-registry.js +1 -1
- package/dist/mail/email-template-operations.d.ts +186 -0
- package/dist/mail/email-template-operations.js +226 -0
- package/dist/mail/email-template.d.ts +120 -0
- package/dist/mail/email-template.js +243 -0
- package/dist/mail/index.d.ts +4 -0
- package/dist/mail/index.js +3 -0
- package/dist/mail/prepare-sender-email.d.ts +1 -10
- package/dist/mail/prepare-sender-email.js +1 -11
- package/dist/mail/resolve-mailer.d.ts +2 -1
- package/dist/mail/resolve-mailer.js +5 -2
- package/dist/mail/senders.d.ts +0 -1
- package/dist/mail/senders.js +0 -1
- package/dist/mail/smtp.d.ts +1 -31
- package/dist/net/address.d.ts +1 -8
- package/dist/net/address.js +1 -18
- package/dist/net/index.d.ts +1 -1
- package/dist/net/index.js +1 -1
- package/dist/net/local-http-probe.js +1 -1
- package/dist/net/local-http-request.js +1 -1
- package/dist/process-probes.d.ts +36 -0
- package/dist/process-probes.js +151 -0
- package/dist/process-top-footprint.d.ts +7 -0
- package/dist/process-top-footprint.js +30 -0
- package/dist/process.d.ts +29 -31
- package/dist/process.js +18 -196
- package/dist/proxy-env.d.ts +12 -3
- package/dist/proxy-env.js +9 -8
- package/dist/resource-paths.d.ts +15 -3
- package/dist/resource-paths.js +7 -5
- package/dist/sandbox-env.d.ts +26 -5
- package/dist/sandbox-env.js +7 -7
- package/dist/secrets/credential-sets/contracts.d.ts +0 -1
- package/dist/secrets/credential-sets/contracts.js +0 -1
- package/dist/secrets/credential-sets/index.d.ts +2 -3
- package/dist/secrets/credential-sets/index.js +1 -1
- package/dist/secrets/credential-sets/provider-matches.d.ts +1 -1
- package/dist/secrets/credential-sets/provider-matches.js +1 -1
- package/dist/secrets/credential-sets/vault-archive.d.ts +1 -1
- package/dist/secrets/credential-sets/vault-archive.js +14 -8
- package/dist/secrets/credential-sets/vault.aad.d.ts +1 -1
- package/dist/secrets/credential-sets/vault.meta.d.ts +1 -1
- package/dist/secrets/credential-sets/vault.meta.js +1 -1
- package/dist/secrets/credential-sets/vault.repo.memory.d.ts +1 -1
- package/dist/secrets/credential-sets/vault.repo.memory.js +1 -1
- package/dist/secrets/credential-sets/vault.reseal-refused.d.ts +23 -0
- package/dist/secrets/credential-sets/vault.reseal-refused.js +36 -0
- package/dist/secrets/credential-sets/vault.service.d.ts +25 -5
- package/dist/secrets/credential-sets/vault.service.js +42 -8
- package/dist/secrets/index.d.ts +0 -3
- package/dist/secrets/index.js +5 -0
- package/dist/secrets/keyring.env.d.ts +1 -1
- package/dist/secrets/legacy-owner.d.ts +61 -0
- package/dist/secrets/legacy-owner.js +196 -0
- package/dist/secrets/root-key/decide.d.ts +89 -0
- package/dist/secrets/root-key/decide.js +60 -0
- package/dist/secrets/sealer-contract.d.ts +19 -0
- package/dist/secrets/sealer-contract.js +37 -0
- package/dist/secrets/secret-sealer.aesgcm.d.ts +1 -1
- package/dist/secrets/testing.d.ts +1 -0
- package/dist/secrets/testing.js +1 -0
- package/dist/shell.d.ts +4 -1
- package/dist/shell.js +1 -1
- package/dist/system.d.ts +6 -0
- package/dist/system.js +9 -0
- package/dist/terminal.d.ts +11 -96
- package/dist/terminal.js +80 -56
- package/dist/web/agent-tools.d.ts +107 -0
- package/dist/web/agent-tools.js +49 -0
- package/dist/web/index.d.ts +1 -0
- package/dist/web/index.js +1 -0
- package/package.json +39 -13
- package/dist/http/guarded/ports.d.ts +0 -56
- package/dist/http/guarded/types.d.ts +0 -8
- package/dist/http/guarded/types.js +0 -2
- package/dist/mail/email-sender.d.ts +0 -109
- package/dist/mail/email-sender.js +0 -10
- package/dist/net/endpoint-policy.d.ts +0 -39
- package/dist/net/endpoint-policy.js +0 -218
- package/dist/secrets/credential-sets/aad.d.ts +0 -7
- package/dist/secrets/credential-sets/aad.js +0 -7
- package/dist/secrets/credential-sets/repo.memory.d.ts +0 -44
- package/dist/secrets/credential-sets/repo.memory.js +0 -80
- package/dist/secrets/credential-sets/vault.types.d.ts +0 -27
- package/dist/secrets/credential-sets/vault.types.js +0 -49
- /package/dist/{http/guarded → mail/activity}/ports.js +0 -0
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file `VendorCredentialSetRepoPort`'s in-memory adapter — the ADR-006 rule-of-two test double,
|
|
3
|
-
* mirroring `../deployments/publish-credentials/repo.memory.ts`'s shape byte-for-byte with
|
|
4
|
-
* `providerId` swapped for `vendorId`. See that file's own header for the full reasoning (row
|
|
5
|
-
* keying, the enforced UNIQUE constraint matching better-sqlite3's own error wording, why no
|
|
6
|
-
* explicit lock is needed for the `isDefault` group invariant in a single-threaded JS process).
|
|
7
|
-
*/
|
|
8
|
-
export class InMemoryVendorCredentialSetRepo {
|
|
9
|
-
constructor(_required, _optional = {}) { }
|
|
10
|
-
rows = new Map();
|
|
11
|
-
static rowKey(workspaceId, id) {
|
|
12
|
-
return `${workspaceId}::${id}`;
|
|
13
|
-
}
|
|
14
|
-
assertLabelAvailable(workspaceId, vendorId, label, excludingId) {
|
|
15
|
-
for (const row of this.rows.values()) {
|
|
16
|
-
if (row.workspaceId !== workspaceId || row.vendorId !== vendorId || row.label !== label)
|
|
17
|
-
continue;
|
|
18
|
-
if (excludingId !== undefined && row.id === excludingId)
|
|
19
|
-
continue;
|
|
20
|
-
throw new Error(`UNIQUE constraint failed: vendor_credential_sets.workspace_id, vendor_credential_sets.vendor_id, vendor_credential_sets.label`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
clearOtherDefaults(workspaceId, vendorId, keepId) {
|
|
24
|
-
for (const [key, row] of this.rows) {
|
|
25
|
-
if (row.workspaceId !== workspaceId || row.vendorId !== vendorId || row.id === keepId || !row.isDefault)
|
|
26
|
-
continue;
|
|
27
|
-
this.rows.set(key, { ...row, isDefault: false });
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
async insert(record, _optional = {}) {
|
|
31
|
-
this.assertLabelAvailable(record.workspaceId, record.vendorId, record.label);
|
|
32
|
-
this.rows.set(InMemoryVendorCredentialSetRepo.rowKey(record.workspaceId, record.id), { ...record });
|
|
33
|
-
if (record.isDefault)
|
|
34
|
-
this.clearOtherDefaults(record.workspaceId, record.vendorId, record.id);
|
|
35
|
-
}
|
|
36
|
-
async update(record, _optional = {}) {
|
|
37
|
-
this.assertLabelAvailable(record.workspaceId, record.vendorId, record.label, record.id);
|
|
38
|
-
this.rows.set(InMemoryVendorCredentialSetRepo.rowKey(record.workspaceId, record.id), { ...record });
|
|
39
|
-
if (record.isDefault)
|
|
40
|
-
this.clearOtherDefaults(record.workspaceId, record.vendorId, record.id);
|
|
41
|
-
}
|
|
42
|
-
async findById(input, _optional = {}) {
|
|
43
|
-
return this.rows.get(InMemoryVendorCredentialSetRepo.rowKey(input.workspaceId, input.id)) ?? null;
|
|
44
|
-
}
|
|
45
|
-
async findDefaultByVendor(input, _optional = {}) {
|
|
46
|
-
for (const row of this.rows.values()) {
|
|
47
|
-
if (row.workspaceId === input.workspaceId && row.vendorId === input.vendorId && row.isDefault)
|
|
48
|
-
return row;
|
|
49
|
-
}
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
async listByVendor(input, _optional = {}) {
|
|
53
|
-
return [...this.rows.values()].filter((row) => row.workspaceId === input.workspaceId && row.vendorId === input.vendorId);
|
|
54
|
-
}
|
|
55
|
-
async listByWorkspace(input, _optional = {}) {
|
|
56
|
-
return [...this.rows.values()].filter((row) => row.workspaceId === input.workspaceId);
|
|
57
|
-
}
|
|
58
|
-
async delete(input, _optional = {}) {
|
|
59
|
-
const key = InMemoryVendorCredentialSetRepo.rowKey(input.workspaceId, input.id);
|
|
60
|
-
const removed = this.rows.get(key);
|
|
61
|
-
this.rows.delete(key);
|
|
62
|
-
if (!removed?.isDefault)
|
|
63
|
-
return;
|
|
64
|
-
const remaining = [...this.rows.values()].filter((row) => row.workspaceId === removed.workspaceId && row.vendorId === removed.vendorId);
|
|
65
|
-
if (remaining.length === 0)
|
|
66
|
-
return;
|
|
67
|
-
const promoted = remaining.reduce((latest, row) => (row.updatedAt > latest.updatedAt ? row : latest));
|
|
68
|
-
this.rows.set(InMemoryVendorCredentialSetRepo.rowKey(promoted.workspaceId, promoted.id), { ...promoted, isDefault: true });
|
|
69
|
-
}
|
|
70
|
-
/** Mirrors the SQLite adapter's targeted single-column write — see
|
|
71
|
-
* `VendorCredentialSetRepoPort.updateAccountLabel`'s own doc. No-op if the row vanished. */
|
|
72
|
-
async updateAccountLabel(input, _optional = {}) {
|
|
73
|
-
const key = InMemoryVendorCredentialSetRepo.rowKey(input.workspaceId, input.id);
|
|
74
|
-
const existing = this.rows.get(key);
|
|
75
|
-
if (!existing)
|
|
76
|
-
return;
|
|
77
|
-
this.rows.set(key, { ...existing, accountLabel: input.accountLabel });
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=repo.memory.js.map
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { VaultOptions, VaultRecord, VaultPutRecord, VaultQuery, VaultDefaultQuery, VaultErrorCode } from '@jini-ai/core/contracts/vault';
|
|
2
|
-
export type { VaultKind, CredentialType, CredentialMeta, VaultJson, VaultMeta, VaultOptions, VaultContext, VaultIdentity, VaultRecord, VaultSummary, VaultPutRecord, VaultQuery, VaultDefaultQuery, VaultSingletonQuery, VaultBatchOp, VaultBatchResult, VaultCopyResult, VaultMetaParser, VaultMetaParsers, VaultRepoPort } from '@jini-ai/core/contracts/vault';
|
|
3
|
-
export declare const VAULT_KINDS: readonly ["site-assistant", "personal-execution", "media-provider", "publish-peer", "database-destination", "vendor", "source-control", "mcp-env", "mcp-auth", "api-connection"];
|
|
4
|
-
/** Safe error codes never contain submitted values or encrypted material. */
|
|
5
|
-
export declare class VaultError extends Error {
|
|
6
|
-
readonly code: VaultErrorCode;
|
|
7
|
-
constructor({ code }: {
|
|
8
|
-
code: VaultError["code"];
|
|
9
|
-
}, _options?: VaultOptions);
|
|
10
|
-
}
|
|
11
|
-
/** The record belongs to the query's exact workspace, kind, owner and principal; an omitted provider
|
|
12
|
-
* matches every provider. @complexity O(1). */
|
|
13
|
-
export declare function isInVaultQueryScope({ record, query }: {
|
|
14
|
-
record: Pick<VaultRecord, keyof VaultQuery>;
|
|
15
|
-
query: VaultQuery;
|
|
16
|
-
}, _options?: VaultOptions): boolean;
|
|
17
|
-
/** Unambiguous scope encoding keeps adapter default/identity checks on the same contract. */
|
|
18
|
-
export declare function vaultGroupKey({ record }: {
|
|
19
|
-
record: VaultDefaultQuery;
|
|
20
|
-
}, _options?: VaultOptions): string;
|
|
21
|
-
/** Adapters guard CAS and immutable identity even for callers below the service. */
|
|
22
|
-
export declare function assertVaultReplacement({ record, existing, expectedRevision }: {
|
|
23
|
-
record: VaultPutRecord;
|
|
24
|
-
existing: VaultRecord | null;
|
|
25
|
-
expectedRevision: number | null;
|
|
26
|
-
}, _options?: VaultOptions): void;
|
|
27
|
-
//# sourceMappingURL=vault.types.d.ts.map
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export const VAULT_KINDS = ["site-assistant", "personal-execution", "media-provider", "publish-peer",
|
|
2
|
-
"database-destination", "vendor", "source-control", "mcp-env", "mcp-auth", "api-connection"];
|
|
3
|
-
/** Safe error codes never contain submitted values or encrypted material. */
|
|
4
|
-
export class VaultError extends Error {
|
|
5
|
-
code;
|
|
6
|
-
constructor({ code }, _options = {}) {
|
|
7
|
-
super(`Secrets vault: ${code}`);
|
|
8
|
-
this.code = code;
|
|
9
|
-
this.name = "VaultError";
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
/** The record belongs to the query's exact workspace, kind, owner and principal; an omitted provider
|
|
13
|
-
* matches every provider. @complexity O(1). */
|
|
14
|
-
export function isInVaultQueryScope({ record, query }, _options = {}) {
|
|
15
|
-
const sameOwner = record.workspaceId === query.workspaceId && record.kind === query.kind && record.ownerKey === query.ownerKey;
|
|
16
|
-
const sameProvider = query.provider === undefined || record.provider === query.provider;
|
|
17
|
-
return sameOwner && record.principalId === query.principalId && sameProvider;
|
|
18
|
-
}
|
|
19
|
-
/** Unambiguous scope encoding keeps adapter default/identity checks on the same contract. */
|
|
20
|
-
export function vaultGroupKey({ record }, _options = {}) {
|
|
21
|
-
return JSON.stringify([record.workspaceId, record.kind, record.ownerKey, record.principalId, record.provider]);
|
|
22
|
-
}
|
|
23
|
-
/** Fields fixed at create and checked on every replacement. */
|
|
24
|
-
// Provider groups defaults, but is not authenticated identity (see buildVaultAad).
|
|
25
|
-
const IMMUTABLE_FIELDS = ["workspaceId", "kind", "ownerKey", "principalId", "id", "binding", "createdAt"];
|
|
26
|
-
function assertRevision({ record, existing, expectedRevision }) {
|
|
27
|
-
if (expectedRevision === null ? existing !== null : existing?.revision !== expectedRevision)
|
|
28
|
-
throw new VaultError({ code: "conflict" });
|
|
29
|
-
if (!Number.isSafeInteger(record.revision) || record.revision !== (expectedRevision ?? 0) + 1)
|
|
30
|
-
throw new VaultError({ code: "invalid-record" });
|
|
31
|
-
}
|
|
32
|
-
function assertSameIdentity({ record, existing }) {
|
|
33
|
-
if (IMMUTABLE_FIELDS.some(field => record[field] !== existing[field]))
|
|
34
|
-
throw new VaultError({ code: "context" });
|
|
35
|
-
if (existing.kind === "vendor") {
|
|
36
|
-
// Missing subtype identifies a pre-unification vendor; an explicit null is not a default.
|
|
37
|
-
const previousType = existing.meta.credentialType === undefined ? "vendor" : existing.meta.credentialType;
|
|
38
|
-
const nextType = record.meta.credentialType === undefined ? "vendor" : record.meta.credentialType;
|
|
39
|
-
if (nextType !== previousType)
|
|
40
|
-
throw new VaultError({ code: "context" });
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/** Adapters guard CAS and immutable identity even for callers below the service. */
|
|
44
|
-
export function assertVaultReplacement({ record, existing, expectedRevision }, _options = {}) {
|
|
45
|
-
assertRevision({ record, existing, expectedRevision });
|
|
46
|
-
if (existing)
|
|
47
|
-
assertSameIdentity({ record, existing });
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=vault.types.js.map
|
|
File without changes
|