@sentropic/artifacts 0.2.20 → 0.2.22
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 +36 -0
- package/dist/adapters/postgres-live.js +41 -0
- package/dist/git-tool-definitions.d.ts +168 -1
- package/dist/git-tool-definitions.js +11 -1
- package/dist/http.js +3 -2
- package/dist/mcp-core.d.ts +3 -3
- package/dist/mcp-core.js +5 -1
- package/dist/profile/contracts.d.ts +1 -1
- package/dist/profile/contracts.js +3 -0
- package/dist/profile/index.js +4 -2
- package/dist/profile/schemas.js +3 -0
- package/dist/profile/validation.js +2 -1
- package/dist/server/build-contract.d.ts +15 -1
- package/dist/server/build-contract.js +14 -5
- package/dist/server/build-dependencies.d.ts +12 -1
- package/dist/server/build-dependencies.js +41 -13
- package/dist/server/build-integrity.d.ts +48 -0
- package/dist/server/build-integrity.js +70 -0
- package/dist/server/build-output.d.ts +22 -0
- package/dist/server/build-output.js +40 -0
- package/dist/server/build-receipt.d.ts +51 -0
- package/dist/server/build-receipt.js +76 -0
- package/dist/server/failures.d.ts +2 -2
- package/dist/server/failures.js +1 -1
- package/dist/server/live-contracts.d.ts +37 -0
- package/dist/server/live-invitation-state.d.ts +9 -0
- package/dist/server/live-invitation-state.js +44 -0
- package/dist/server/live-invitations.d.ts +5 -0
- package/dist/server/live-invitations.js +178 -0
- package/dist/server/live-mutations.d.ts +1 -1
- package/dist/server/live-mutations.js +3 -2
- package/dist/server/live-read.d.ts +1 -1
- package/dist/server/live-read.js +2 -1
- package/dist/server/live-service.d.ts +5 -2
- package/dist/server/live-service.js +11 -1
- package/dist/server/live-store.d.ts +29 -1
- package/dist/server/live-store.js +36 -0
- package/migrations/0013_live_invitations.sql +101 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.22
|
|
4
|
+
|
|
5
|
+
- Generic live invitations through MCP (A-LIVE v2 §8.2, §9): four tools appended last and frozen at
|
|
6
|
+
birth, routed to `LiveService.execute`. `artifacts_live_invite` (owner only, invitee resolved from
|
|
7
|
+
a `userRef` and holding current code rights, 300..86400 s), `artifacts_live_accept_invitation` and
|
|
8
|
+
`artifacts_live_revoke_invitation` (the owner or the invitee; the session epoch rises and every open
|
|
9
|
+
invitation adopts it; `onRevoked` runs once after the commit) and `artifacts_live_invitations`
|
|
10
|
+
(owner sees all, an invitee only their own, as `userRef`/`displayName`). At most 16 open
|
|
11
|
+
invitations per session; an invitation ceases on a new live session or generation and expires at
|
|
12
|
+
its deadline. `LIVE_INVITATION_TOOL_CLASSES` maps each tool to a host read/write class.
|
|
13
|
+
- `createLiveService` returns `liveInvitationState(identity)` (`{ epoch, expiresAt }`, the latest
|
|
14
|
+
active expiry in ms) and `liveViewer(identity, principalId)`. Optional `LiveServiceDeps.invitations`
|
|
15
|
+
host port (`qualified`, `resolvePrincipal`, `describePrincipal`, `onRevoked`); without a qualified
|
|
16
|
+
port every invitation tool refuses with `builder_unavailable` and live stays owner-only.
|
|
17
|
+
- The postgres-live adapter persists invitations; host migration `0013_live_invitations.sql` adds
|
|
18
|
+
`artifacts.live_invitations` and `artifacts.live_invitation_epochs` and ends with a guard that
|
|
19
|
+
raises on any foreign column or index (a same-named table from another schema is refused).
|
|
20
|
+
- The 35 previous tool definitions are byte-identical. `ARTIFACTS_PROVIDER_VERSION` follows the
|
|
21
|
+
package (0.2.22): the APP-P1 manifest digest changes through its version field only (the four-tool
|
|
22
|
+
APP-P1 selection is unchanged; the same manifest at version 0.2.21 still hashes to the 0.2.21 pin).
|
|
23
|
+
`@sentropic/artifacts/live-host` is unchanged.
|
|
24
|
+
|
|
25
|
+
## 0.2.21
|
|
26
|
+
|
|
27
|
+
- Add the GB1 build validators on `@sentropic/artifacts/server/build-contract`: full dependency
|
|
28
|
+
integrity coverage with a sealed host integrity map (`dependency_integrity_missing`,
|
|
29
|
+
`dependency_integrity_mismatch`), script-package qualification rows, the mandatory
|
|
30
|
+
builder-attested receipt schema and verifier (§8.4 join, served-byte anti-repack), and the
|
|
31
|
+
candidate output ceiling gate (`dist_over_limits`). Tarball-bundled dependencies are exempt
|
|
32
|
+
from the lock closure check. Additive; no new export path.
|
|
33
|
+
- The live runtime record follows A-LIVE Amendment 1: `idleDeadline` is 900 s after the last
|
|
34
|
+
access and the absolute `maximumLifetimeAt` is removed.
|
|
35
|
+
- `@sentropic/artifacts/live-host` is unchanged (HostLedger and AcceptOptions frozen).
|
|
36
|
+
- `ARTIFACTS_PROVIDER_VERSION` is `0.2.21` (it equals the package version). Tool definitions are
|
|
37
|
+
unchanged; the provider manifest digest changes only through `version`.
|
|
38
|
+
|
|
3
39
|
## 0.2.20
|
|
4
40
|
|
|
5
41
|
- Add the `@sentropic/artifacts/live-host` subpath: single live-host candidate digest with pinned vectors,
|
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
import { ArtifactOperationError } from '../server/failures.js';
|
|
2
2
|
import { liveIdentityKey } from '../server/live-store.js';
|
|
3
|
+
const INVITATION_COLUMNS = `storage_scope_id,artifact_id,binding_generation,live_session_id,invitation_id,principal_id,
|
|
4
|
+
created_by,status,epoch,expires_at,accepted_at,revoked_at,created_at,row_version`;
|
|
5
|
+
const iso = (value) => value === null ? null : new Date(value).toISOString();
|
|
6
|
+
/** Live invitations (migration 0013) under the transaction's advisory lock on the artifact. */
|
|
7
|
+
function postgresInvitations(client, identity) {
|
|
8
|
+
const own = [identity.storageScopeId, identity.artifactId];
|
|
9
|
+
return {
|
|
10
|
+
async list() {
|
|
11
|
+
const result = await client.query(`SELECT ${INVITATION_COLUMNS} FROM artifacts.live_invitations
|
|
12
|
+
WHERE storage_scope_id=$1 AND artifact_id=$2`, own);
|
|
13
|
+
return result.rows.map(row => ({ storageScopeId: row.storage_scope_id, artifactId: row.artifact_id,
|
|
14
|
+
bindingGeneration: Number(row.binding_generation), liveSessionId: row.live_session_id, invitationId: row.invitation_id,
|
|
15
|
+
principalId: row.principal_id, createdBy: row.created_by, status: row.status, epoch: Number(row.epoch),
|
|
16
|
+
expiresAt: iso(row.expires_at), acceptedAt: iso(row.accepted_at), revokedAt: iso(row.revoked_at),
|
|
17
|
+
createdAt: iso(row.created_at), rowVersion: Number(row.row_version) }));
|
|
18
|
+
},
|
|
19
|
+
async save(row) {
|
|
20
|
+
if (row.storageScopeId !== identity.storageScopeId || row.artifactId !== identity.artifactId)
|
|
21
|
+
throw new ArtifactOperationError('access_denied');
|
|
22
|
+
const result = row.rowVersion === 1 ? await client.query(`INSERT INTO artifacts.live_invitations (${INVITATION_COLUMNS})
|
|
23
|
+
VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14) ON CONFLICT DO NOTHING`, [...own, row.bindingGeneration,
|
|
24
|
+
row.liveSessionId, row.invitationId, row.principalId, row.createdBy, row.status, row.epoch, row.expiresAt,
|
|
25
|
+
row.acceptedAt, row.revokedAt, row.createdAt, row.rowVersion])
|
|
26
|
+
: await client.query(`UPDATE artifacts.live_invitations SET status=$4, epoch=$5, accepted_at=$6, revoked_at=$7,
|
|
27
|
+
row_version=$8 WHERE storage_scope_id=$1 AND artifact_id=$2 AND invitation_id=$3 AND row_version=$9`, [...own, row.invitationId, row.status, row.epoch, row.acceptedAt, row.revokedAt, row.rowVersion, row.rowVersion - 1]);
|
|
28
|
+
if (!result.rowCount)
|
|
29
|
+
throw new ArtifactOperationError('git_live_conflict', { publicDetails: { reason: row.rowVersion === 1 ? 'active_session' : 'stale_fence' } });
|
|
30
|
+
},
|
|
31
|
+
async epoch(generation, session) {
|
|
32
|
+
const result = await client.query(`SELECT epoch FROM artifacts.live_invitation_epochs WHERE storage_scope_id=$1
|
|
33
|
+
AND artifact_id=$2 AND binding_generation=$3 AND live_session_id=$4`, [...own, generation, session]);
|
|
34
|
+
return result.rows[0] ? Number(result.rows[0].epoch) : 0;
|
|
35
|
+
},
|
|
36
|
+
async setEpoch(generation, session, epoch) {
|
|
37
|
+
await client.query(`INSERT INTO artifacts.live_invitation_epochs
|
|
38
|
+
(storage_scope_id,artifact_id,binding_generation,live_session_id,epoch) VALUES ($1,$2,$3,$4,$5)
|
|
39
|
+
ON CONFLICT (storage_scope_id,artifact_id,binding_generation,live_session_id) DO UPDATE SET epoch=EXCLUDED.epoch`, [...own, generation, session, epoch]);
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
3
43
|
/** No import-time I/O. PostgreSQL owns lease serialization, private objects and replay durability. */
|
|
4
44
|
export function createPostgresLiveStore(pool) {
|
|
5
45
|
return {
|
|
@@ -18,6 +58,7 @@ export function createPostgresLiveStore(pool) {
|
|
|
18
58
|
WHERE storage_scope_id=$1 AND artifact_id=$2 AND binding_generation=$3 FOR UPDATE`, values);
|
|
19
59
|
const tx = {
|
|
20
60
|
record: before.rows[0]?.record,
|
|
61
|
+
invitations: postgresInvitations(client, identity),
|
|
21
62
|
async getObject(ref) {
|
|
22
63
|
const result = await client.query(`SELECT envelope FROM artifacts.live_draft_objects
|
|
23
64
|
WHERE storage_scope_id=$1 AND artifact_id=$2 AND binding_generation=$3 AND object_ref=$4`, [...values, ref]);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
/** Frozen G0 v3 and A-LIVE v2 definition values; generated from the signed JSON blocks.
|
|
1
|
+
/** Frozen G0 v3 and A-LIVE v2 definition values; generated from the signed JSON blocks. The four live invitation
|
|
2
|
+
* tools (A-LIVE v2 §9, contract 2026-11-07) are appended last and frozen at birth. */
|
|
2
3
|
export declare const GIT_TOOL_DEFINITIONS: {
|
|
3
4
|
artifacts_list_app_sources: {
|
|
4
5
|
description: string;
|
|
@@ -603,4 +604,170 @@ export declare const GIT_TOOL_DEFINITIONS: {
|
|
|
603
604
|
type: string;
|
|
604
605
|
};
|
|
605
606
|
};
|
|
607
|
+
artifacts_live_invite: {
|
|
608
|
+
description: string;
|
|
609
|
+
gates: {
|
|
610
|
+
requiresElicitation: false;
|
|
611
|
+
requiresHumanConfirmation: false;
|
|
612
|
+
requiresPrincipalGate: false;
|
|
613
|
+
};
|
|
614
|
+
idempotency: {
|
|
615
|
+
required: true;
|
|
616
|
+
scope: "principal";
|
|
617
|
+
};
|
|
618
|
+
inputSchema: {
|
|
619
|
+
additionalProperties: boolean;
|
|
620
|
+
properties: {
|
|
621
|
+
artifactId: {
|
|
622
|
+
pattern: string;
|
|
623
|
+
type: string;
|
|
624
|
+
};
|
|
625
|
+
expiresInSeconds: {
|
|
626
|
+
maximum: number;
|
|
627
|
+
minimum: number;
|
|
628
|
+
type: string;
|
|
629
|
+
};
|
|
630
|
+
idempotencyKey: {
|
|
631
|
+
description: string;
|
|
632
|
+
minLength: number;
|
|
633
|
+
type: string;
|
|
634
|
+
};
|
|
635
|
+
liveSessionId: {
|
|
636
|
+
description: string;
|
|
637
|
+
pattern: string;
|
|
638
|
+
type: string;
|
|
639
|
+
};
|
|
640
|
+
userRef: {
|
|
641
|
+
description: string;
|
|
642
|
+
maxLength: number;
|
|
643
|
+
minLength: number;
|
|
644
|
+
type: string;
|
|
645
|
+
};
|
|
646
|
+
};
|
|
647
|
+
required: string[];
|
|
648
|
+
type: string;
|
|
649
|
+
};
|
|
650
|
+
mutability: "state-transition";
|
|
651
|
+
outputSchema: {
|
|
652
|
+
additionalProperties: boolean;
|
|
653
|
+
type: string;
|
|
654
|
+
};
|
|
655
|
+
};
|
|
656
|
+
artifacts_live_accept_invitation: {
|
|
657
|
+
description: string;
|
|
658
|
+
gates: {
|
|
659
|
+
requiresElicitation: false;
|
|
660
|
+
requiresHumanConfirmation: false;
|
|
661
|
+
requiresPrincipalGate: false;
|
|
662
|
+
};
|
|
663
|
+
idempotency: {
|
|
664
|
+
required: true;
|
|
665
|
+
scope: "principal";
|
|
666
|
+
};
|
|
667
|
+
inputSchema: {
|
|
668
|
+
additionalProperties: boolean;
|
|
669
|
+
properties: {
|
|
670
|
+
artifactId: {
|
|
671
|
+
pattern: string;
|
|
672
|
+
type: string;
|
|
673
|
+
};
|
|
674
|
+
idempotencyKey: {
|
|
675
|
+
description: string;
|
|
676
|
+
minLength: number;
|
|
677
|
+
type: string;
|
|
678
|
+
};
|
|
679
|
+
invitationId: {
|
|
680
|
+
pattern: string;
|
|
681
|
+
type: string;
|
|
682
|
+
};
|
|
683
|
+
};
|
|
684
|
+
required: string[];
|
|
685
|
+
type: string;
|
|
686
|
+
};
|
|
687
|
+
mutability: "state-transition";
|
|
688
|
+
outputSchema: {
|
|
689
|
+
additionalProperties: boolean;
|
|
690
|
+
type: string;
|
|
691
|
+
};
|
|
692
|
+
};
|
|
693
|
+
artifacts_live_revoke_invitation: {
|
|
694
|
+
description: string;
|
|
695
|
+
gates: {
|
|
696
|
+
requiresElicitation: false;
|
|
697
|
+
requiresHumanConfirmation: false;
|
|
698
|
+
requiresPrincipalGate: false;
|
|
699
|
+
};
|
|
700
|
+
idempotency: {
|
|
701
|
+
required: true;
|
|
702
|
+
scope: "principal";
|
|
703
|
+
};
|
|
704
|
+
inputSchema: {
|
|
705
|
+
additionalProperties: boolean;
|
|
706
|
+
properties: {
|
|
707
|
+
artifactId: {
|
|
708
|
+
pattern: string;
|
|
709
|
+
type: string;
|
|
710
|
+
};
|
|
711
|
+
idempotencyKey: {
|
|
712
|
+
description: string;
|
|
713
|
+
minLength: number;
|
|
714
|
+
type: string;
|
|
715
|
+
};
|
|
716
|
+
invitationId: {
|
|
717
|
+
pattern: string;
|
|
718
|
+
type: string;
|
|
719
|
+
};
|
|
720
|
+
};
|
|
721
|
+
required: string[];
|
|
722
|
+
type: string;
|
|
723
|
+
};
|
|
724
|
+
mutability: "state-transition";
|
|
725
|
+
outputSchema: {
|
|
726
|
+
additionalProperties: boolean;
|
|
727
|
+
type: string;
|
|
728
|
+
};
|
|
729
|
+
};
|
|
730
|
+
artifacts_live_invitations: {
|
|
731
|
+
description: string;
|
|
732
|
+
gates: {
|
|
733
|
+
requiresElicitation: false;
|
|
734
|
+
requiresHumanConfirmation: false;
|
|
735
|
+
requiresPrincipalGate: false;
|
|
736
|
+
};
|
|
737
|
+
idempotency: {
|
|
738
|
+
required: false;
|
|
739
|
+
};
|
|
740
|
+
inputSchema: {
|
|
741
|
+
additionalProperties: boolean;
|
|
742
|
+
properties: {
|
|
743
|
+
artifactId: {
|
|
744
|
+
pattern: string;
|
|
745
|
+
type: string;
|
|
746
|
+
};
|
|
747
|
+
cursor: {
|
|
748
|
+
maxLength: number;
|
|
749
|
+
minLength: number;
|
|
750
|
+
type: string;
|
|
751
|
+
};
|
|
752
|
+
liveSessionId: {
|
|
753
|
+
pattern: string;
|
|
754
|
+
type: string;
|
|
755
|
+
};
|
|
756
|
+
};
|
|
757
|
+
required: string[];
|
|
758
|
+
type: string;
|
|
759
|
+
};
|
|
760
|
+
mutability: "read-only";
|
|
761
|
+
outputSchema: {
|
|
762
|
+
additionalProperties: boolean;
|
|
763
|
+
type: string;
|
|
764
|
+
};
|
|
765
|
+
};
|
|
766
|
+
};
|
|
767
|
+
/** Access class per invitation tool; each host maps a class to its own scope (no new scope). */
|
|
768
|
+
export declare const LIVE_INVITATION_TOOL_CLASSES: {
|
|
769
|
+
readonly artifacts_live_invite: "write";
|
|
770
|
+
readonly artifacts_live_accept_invitation: "read";
|
|
771
|
+
readonly artifacts_live_revoke_invitation: "read";
|
|
772
|
+
readonly artifacts_live_invitations: "read";
|
|
606
773
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
/** Frozen G0 v3 and A-LIVE v2 definition values; generated from the signed JSON blocks.
|
|
1
|
+
/** Frozen G0 v3 and A-LIVE v2 definition values; generated from the signed JSON blocks. The four live invitation
|
|
2
|
+
* tools (A-LIVE v2 §9, contract 2026-11-07) are appended last and frozen at birth. */
|
|
2
3
|
export const GIT_TOOL_DEFINITIONS = {
|
|
3
4
|
artifacts_list_app_sources: { "description": "Artifacts list app sources: list the registered application sources and repositories visible to the caller. Opaque repoIds only; a source registered for reading is not necessarily writable (canWrite).", "gates": { "requiresElicitation": false, "requiresHumanConfirmation": false, "requiresPrincipalGate": false }, "idempotency": { "required": false }, "inputSchema": { "additionalProperties": false, "properties": { "cursor": { "maxLength": 4096, "minLength": 1, "type": "string" } }, "required": [], "type": "object" }, "mutability": "read-only", "outputSchema": { "additionalProperties": true, "type": "object" } },
|
|
4
5
|
artifacts_fetch_app_source: { "description": "Artifacts fetch app source: read application source files at a server-resolved commit. artifactId resolves the bound branch; otherwise repoId and ref select the source. Oversized files are reported as omitted entries, never as failures.", "gates": { "requiresElicitation": false, "requiresHumanConfirmation": false, "requiresPrincipalGate": false }, "idempotency": { "required": false }, "inputSchema": { "additionalProperties": false, "anyOf": [{ "required": ["artifactId"] }, { "required": ["repoId"] }], "properties": { "artifactId": { "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", "type": "string" }, "cursor": { "maxLength": 4096, "minLength": 1, "type": "string" }, "paths": { "items": { "description": "Repository path relative to the binding sub-path; the active profile bounds its byte length and forbids reserved or dot segments, enforced server-side with typed errors.", "minLength": 1, "type": "string" }, "maxItems": 255, "minItems": 1, "type": "array" }, "ref": { "minLength": 1, "type": "string" }, "repoId": { "minLength": 1, "type": "string" } }, "required": [], "type": "object" }, "mutability": "read-only", "outputSchema": { "additionalProperties": true, "type": "object" } },
|
|
@@ -11,4 +12,13 @@ export const GIT_TOOL_DEFINITIONS = {
|
|
|
11
12
|
artifacts_live_reset: { "description": "Artifacts live reset: discard the complete uncommitted draft and reset the live source tree to the verified bound branch head under a revision comparison. Do not move a git ref or publish.", "gates": { "requiresElicitation": false, "requiresHumanConfirmation": false, "requiresPrincipalGate": false }, "idempotency": { "required": true, "scope": "principal" }, "inputSchema": { "additionalProperties": false, "properties": { "artifactId": { "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", "type": "string" }, "expectedHeadSha": { "description": "Full commit SHA of the bound branch head; the server verifies the repository object format and compares the current head.", "minLength": 1, "type": "string" }, "expectedLiveRevision": { "description": "Opaque revision returned by live read or status; the server compares the complete binding generation, draft revision and base head.", "minLength": 1, "type": "string" }, "idempotencyKey": { "description": "Nonblank by JavaScript trim(); the active profile bounds its length in UTF-16 units; original bytes retained.", "minLength": 1, "type": "string" } }, "required": ["artifactId", "expectedHeadSha", "expectedLiveRevision", "idempotencyKey"], "type": "object" }, "mutability": "state-transition", "outputSchema": { "additionalProperties": true, "type": "object" } },
|
|
12
13
|
artifacts_live_status: { "description": "Artifacts live status: inspect the binding's live state and optionally page the complete source diff against its base head. Report external head changes separately. Do not start a worker, commit or publish.", "gates": { "requiresElicitation": false, "requiresHumanConfirmation": false, "requiresPrincipalGate": false }, "idempotency": { "required": false }, "inputSchema": { "additionalProperties": false, "properties": { "artifactId": { "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", "type": "string" }, "cursor": { "minLength": 1, "type": "string" }, "includeDiff": { "type": "boolean" } }, "required": ["artifactId"], "type": "object" }, "mutability": "read-only", "outputSchema": { "additionalProperties": true, "type": "object" } },
|
|
13
14
|
artifacts_live_write: { "description": "Artifacts live write: atomically apply text edits, full text files and deletes to the bound owner's live source tree. Revive the live worker when needed. Persist the draft before acknowledging; do not commit or publish.", "gates": { "requiresElicitation": false, "requiresHumanConfirmation": false, "requiresPrincipalGate": false }, "idempotency": { "required": true, "scope": "principal" }, "inputSchema": { "additionalProperties": false, "anyOf": [{ "required": ["edits"] }, { "required": ["files"] }, { "required": ["deletes"] }], "properties": { "artifactId": { "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", "type": "string" }, "deletes": { "items": { "description": "Repository path relative to the binding sub-path; the active profile bounds its byte length and forbids reserved or dot segments, enforced server-side with typed errors.", "minLength": 1, "type": "string" }, "minItems": 1, "type": "array" }, "edits": { "items": { "additionalProperties": false, "properties": { "newStr": { "type": "string" }, "oldStr": { "minLength": 1, "type": "string" }, "path": { "description": "Repository path relative to the binding sub-path; the active profile bounds its byte length and forbids reserved or dot segments, enforced server-side with typed errors.", "minLength": 1, "type": "string" } }, "required": ["path", "oldStr", "newStr"], "type": "object" }, "minItems": 1, "type": "array" }, "expectedHeadSha": { "description": "Full commit SHA of the bound branch head; the server verifies the repository object format and compares the current head.", "minLength": 1, "type": "string" }, "expectedLiveRevision": { "description": "Opaque revision returned by live read or status; the server compares the complete binding generation, draft revision and base head.", "minLength": 1, "type": "string" }, "files": { "items": { "additionalProperties": false, "properties": { "path": { "description": "Repository path relative to the binding sub-path; the active profile bounds its byte length and forbids reserved or dot segments, enforced server-side with typed errors.", "minLength": 1, "type": "string" }, "text": { "type": "string" } }, "required": ["path", "text"], "type": "object" }, "minItems": 1, "type": "array" }, "idempotencyKey": { "description": "Nonblank by JavaScript trim(); the active profile bounds its length in UTF-16 units; original bytes retained.", "minLength": 1, "type": "string" } }, "required": ["artifactId", "expectedHeadSha", "expectedLiveRevision", "idempotencyKey"], "type": "object" }, "mutability": "state-transition", "outputSchema": { "additionalProperties": true, "type": "object" } },
|
|
15
|
+
artifacts_live_invite: { "description": "Artifacts live invite: invite one person, named by an opaque userRef from artifacts_lookup_people, to view the bound owner's current live session until an expiry. The invitee must hold current code rights and accept; an invitation never grants editing, publication or release access.", "gates": { "requiresElicitation": false, "requiresHumanConfirmation": false, "requiresPrincipalGate": false }, "idempotency": { "required": true, "scope": "principal" }, "inputSchema": { "additionalProperties": false, "properties": { "artifactId": { "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", "type": "string" }, "expiresInSeconds": { "maximum": 86400, "minimum": 300, "type": "integer" }, "idempotencyKey": { "description": "Nonblank by JavaScript trim(); the active profile bounds its length in UTF-16 units; original bytes retained.", "minLength": 1, "type": "string" }, "liveSessionId": { "description": "Server-issued identifier of the current live session.", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", "type": "string" }, "userRef": { "description": "Opaque userRef returned by artifacts_lookup_people.", "maxLength": 256, "minLength": 1, "type": "string" } }, "required": ["artifactId", "liveSessionId", "userRef", "expiresInSeconds", "idempotencyKey"], "type": "object" }, "mutability": "state-transition", "outputSchema": { "additionalProperties": true, "type": "object" } },
|
|
16
|
+
artifacts_live_accept_invitation: { "description": "Artifacts live accept invitation: accept, as the invited person, a pending invitation to the current live session before its expiry. Current code rights are checked again; acceptance grants viewing of that live session only.", "gates": { "requiresElicitation": false, "requiresHumanConfirmation": false, "requiresPrincipalGate": false }, "idempotency": { "required": true, "scope": "principal" }, "inputSchema": { "additionalProperties": false, "properties": { "artifactId": { "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", "type": "string" }, "idempotencyKey": { "description": "Nonblank by JavaScript trim(); the active profile bounds its length in UTF-16 units; original bytes retained.", "minLength": 1, "type": "string" }, "invitationId": { "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", "type": "string" } }, "required": ["artifactId", "invitationId", "idempotencyKey"], "type": "object" }, "mutability": "state-transition", "outputSchema": { "additionalProperties": true, "type": "object" } },
|
|
17
|
+
artifacts_live_revoke_invitation: { "description": "Artifacts live revoke invitation: revoke a live invitation. The binding owner may revoke any invitation of the session and an invitee their own; revocation raises the session invitation epoch and closes the invitee's live connections.", "gates": { "requiresElicitation": false, "requiresHumanConfirmation": false, "requiresPrincipalGate": false }, "idempotency": { "required": true, "scope": "principal" }, "inputSchema": { "additionalProperties": false, "properties": { "artifactId": { "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", "type": "string" }, "idempotencyKey": { "description": "Nonblank by JavaScript trim(); the active profile bounds its length in UTF-16 units; original bytes retained.", "minLength": 1, "type": "string" }, "invitationId": { "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", "type": "string" } }, "required": ["artifactId", "invitationId", "idempotencyKey"], "type": "object" }, "mutability": "state-transition", "outputSchema": { "additionalProperties": true, "type": "object" } },
|
|
18
|
+
artifacts_live_invitations: { "description": "Artifacts live invitations: list the invitations of the current or a named live session. The binding owner sees every invitation and an invitee only their own; people appear as opaque userRefs, never as internal principals.", "gates": { "requiresElicitation": false, "requiresHumanConfirmation": false, "requiresPrincipalGate": false }, "idempotency": { "required": false }, "inputSchema": { "additionalProperties": false, "properties": { "artifactId": { "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", "type": "string" }, "cursor": { "maxLength": 4096, "minLength": 1, "type": "string" }, "liveSessionId": { "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", "type": "string" } }, "required": ["artifactId"], "type": "object" }, "mutability": "read-only", "outputSchema": { "additionalProperties": true, "type": "object" } },
|
|
19
|
+
};
|
|
20
|
+
/** Access class per invitation tool; each host maps a class to its own scope (no new scope). */
|
|
21
|
+
export const LIVE_INVITATION_TOOL_CLASSES = {
|
|
22
|
+
artifacts_live_invite: 'write', artifacts_live_accept_invitation: 'read',
|
|
23
|
+
artifacts_live_revoke_invitation: 'read', artifacts_live_invitations: 'read',
|
|
14
24
|
};
|
package/dist/http.js
CHANGED
|
@@ -51,7 +51,8 @@ export function assertArtifactsTransportProfile(value) {
|
|
|
51
51
|
'artifacts_create_upload_page', 'artifacts_list_assets', 'artifacts_publish_bundle_v2',
|
|
52
52
|
'artifacts_revoke_reader_consent', 'artifacts_git_commit', 'artifacts_live_write',
|
|
53
53
|
'artifacts_live_read', 'artifacts_live_reset', 'artifacts_live_status', 'artifacts_live_control',
|
|
54
|
-
'artifacts_fetch_app_source', 'artifacts_git_attach', 'artifacts_git_publish'
|
|
54
|
+
'artifacts_fetch_app_source', 'artifacts_git_attach', 'artifacts_git_publish', 'artifacts_live_invite',
|
|
55
|
+
'artifacts_live_accept_invitation', 'artifacts_live_revoke_invitation', 'artifacts_live_invitations'];
|
|
55
56
|
if (value.selectedCapabilities.some((name) => !supported.includes(name))) {
|
|
56
57
|
throw new Error('unsupported artifacts transport capability');
|
|
57
58
|
}
|
|
@@ -557,7 +558,7 @@ export function createHttpArtifactApp(deps) {
|
|
|
557
558
|
phase = 'dispatch';
|
|
558
559
|
const result = await deps.live.execute(operation, normalized, invocation);
|
|
559
560
|
return { ok: true, invocationId: invocation.invocationId,
|
|
560
|
-
commitState: ['live_read', 'live_status'].includes(operation) ? 'not_committed' : 'committed',
|
|
561
|
+
commitState: ['live_read', 'live_status', 'live_invitations'].includes(operation) ? 'not_committed' : 'committed',
|
|
561
562
|
replayed: result.replayed === true, result: { status: 200, body: result } };
|
|
562
563
|
}
|
|
563
564
|
const command = ['artifacts_ensure', 'artifacts_publish', 'artifacts_set_access', 'artifacts_delete', 'artifacts_revert',
|
package/dist/mcp-core.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export { createRadarKeyDerivation } from './server/command-identity.js';
|
|
|
10
10
|
export type { ArtifactKeyDerivationBinding } from './server/command-identity.js';
|
|
11
11
|
export declare const ARTIFACTS_PROVIDER_ID = "sentropic.artifacts";
|
|
12
12
|
export declare const ARTIFACTS_APP_ID = "sentropic-artifacts";
|
|
13
|
-
export declare const ARTIFACTS_PROVIDER_VERSION = "0.2.
|
|
14
|
-
export declare const ARTIFACTS_TOOL_NAMES: readonly ["artifacts_get_template", "artifacts_get_api_guide", "artifacts_ensure", "artifacts_publish", "artifacts_create_upload", "artifacts_commit_upload", "artifacts_list", "artifacts_get", "artifacts_get_source", "artifacts_fork", "artifacts_set_access", "artifacts_promote", "artifacts_renew", "artifacts_delete", "artifacts_restore", "artifacts_list_versions", "artifacts_revert", "artifacts_lookup_people", "artifacts_list_access", "artifacts_publish_bundle", "artifacts_revoke_reader_consent", "artifacts_create_upload_page", "artifacts_list_assets", "artifacts_publish_bundle_v2", "artifacts_list_app_sources", "artifacts_fetch_app_source", "artifacts_git_attach", "artifacts_git_commit", "artifacts_git_publish", "artifacts_git_live", "artifacts_live_write", "artifacts_live_read", "artifacts_live_reset", "artifacts_live_status", "artifacts_live_control"];
|
|
13
|
+
export declare const ARTIFACTS_PROVIDER_VERSION = "0.2.22";
|
|
14
|
+
export declare const ARTIFACTS_TOOL_NAMES: readonly ["artifacts_get_template", "artifacts_get_api_guide", "artifacts_ensure", "artifacts_publish", "artifacts_create_upload", "artifacts_commit_upload", "artifacts_list", "artifacts_get", "artifacts_get_source", "artifacts_fork", "artifacts_set_access", "artifacts_promote", "artifacts_renew", "artifacts_delete", "artifacts_restore", "artifacts_list_versions", "artifacts_revert", "artifacts_lookup_people", "artifacts_list_access", "artifacts_publish_bundle", "artifacts_revoke_reader_consent", "artifacts_create_upload_page", "artifacts_list_assets", "artifacts_publish_bundle_v2", "artifacts_list_app_sources", "artifacts_fetch_app_source", "artifacts_git_attach", "artifacts_git_commit", "artifacts_git_publish", "artifacts_git_live", "artifacts_live_write", "artifacts_live_read", "artifacts_live_reset", "artifacts_live_status", "artifacts_live_control", "artifacts_live_invite", "artifacts_live_accept_invitation", "artifacts_live_revoke_invitation", "artifacts_live_invitations"];
|
|
15
15
|
export type ArtifactsToolName = (typeof ARTIFACTS_TOOL_NAMES)[number];
|
|
16
16
|
export interface ArtifactsToolDefinition {
|
|
17
17
|
readonly description: string;
|
|
@@ -24,7 +24,7 @@ export interface ArtifactsToolDefinition {
|
|
|
24
24
|
/** Static wire definitions for every artifacts tool; identical across deployments and profiles. */
|
|
25
25
|
export declare const ARTIFACTS_TOOL_DEFINITIONS: Readonly<Record<ArtifactsToolName, ArtifactsToolDefinition>>;
|
|
26
26
|
export declare const ARTIFACTS_TOOL_SPECS: {
|
|
27
|
-
name: "artifacts_get_template" | "artifacts_get_api_guide" | "artifacts_ensure" | "artifacts_publish" | "artifacts_create_upload" | "artifacts_commit_upload" | "artifacts_list" | "artifacts_get" | "artifacts_get_source" | "artifacts_fork" | "artifacts_set_access" | "artifacts_promote" | "artifacts_renew" | "artifacts_delete" | "artifacts_restore" | "artifacts_list_versions" | "artifacts_revert" | "artifacts_lookup_people" | "artifacts_list_access" | "artifacts_publish_bundle" | "artifacts_revoke_reader_consent" | "artifacts_create_upload_page" | "artifacts_list_assets" | "artifacts_publish_bundle_v2" | "artifacts_list_app_sources" | "artifacts_fetch_app_source" | "artifacts_git_attach" | "artifacts_git_commit" | "artifacts_git_publish" | "artifacts_git_live" | "artifacts_live_write" | "artifacts_live_read" | "artifacts_live_reset" | "artifacts_live_status" | "artifacts_live_control";
|
|
27
|
+
name: "artifacts_get_template" | "artifacts_get_api_guide" | "artifacts_ensure" | "artifacts_publish" | "artifacts_create_upload" | "artifacts_commit_upload" | "artifacts_list" | "artifacts_get" | "artifacts_get_source" | "artifacts_fork" | "artifacts_set_access" | "artifacts_promote" | "artifacts_renew" | "artifacts_delete" | "artifacts_restore" | "artifacts_list_versions" | "artifacts_revert" | "artifacts_lookup_people" | "artifacts_list_access" | "artifacts_publish_bundle" | "artifacts_revoke_reader_consent" | "artifacts_create_upload_page" | "artifacts_list_assets" | "artifacts_publish_bundle_v2" | "artifacts_list_app_sources" | "artifacts_fetch_app_source" | "artifacts_git_attach" | "artifacts_git_commit" | "artifacts_git_publish" | "artifacts_git_live" | "artifacts_live_write" | "artifacts_live_read" | "artifacts_live_reset" | "artifacts_live_status" | "artifacts_live_control" | "artifacts_live_invite" | "artifacts_live_accept_invitation" | "artifacts_live_revoke_invitation" | "artifacts_live_invitations";
|
|
28
28
|
description: string;
|
|
29
29
|
mutability: import("@sentropic/mcp-platform").Mutability;
|
|
30
30
|
}[];
|
package/dist/mcp-core.js
CHANGED
|
@@ -7,7 +7,7 @@ export * from './profile/index.js';
|
|
|
7
7
|
export { createRadarKeyDerivation } from './server/command-identity.js';
|
|
8
8
|
export const ARTIFACTS_PROVIDER_ID = 'sentropic.artifacts';
|
|
9
9
|
export const ARTIFACTS_APP_ID = 'sentropic-artifacts';
|
|
10
|
-
export const ARTIFACTS_PROVIDER_VERSION = '0.2.
|
|
10
|
+
export const ARTIFACTS_PROVIDER_VERSION = '0.2.22';
|
|
11
11
|
export const ARTIFACTS_TOOL_NAMES = ARTIFACT_CAPABILITY_NAMES;
|
|
12
12
|
// ---------------------------------------------------------------------------
|
|
13
13
|
// Byte-stable tool definitions (MCP tool-definition stability rule).
|
|
@@ -222,6 +222,10 @@ export function createArtifactsToolExecutor(deps) {
|
|
|
222
222
|
case 'artifacts_fetch_app_source':
|
|
223
223
|
case 'artifacts_git_attach':
|
|
224
224
|
case 'artifacts_git_publish':
|
|
225
|
+
case 'artifacts_live_invite':
|
|
226
|
+
case 'artifacts_live_accept_invitation':
|
|
227
|
+
case 'artifacts_live_revoke_invitation':
|
|
228
|
+
case 'artifacts_live_invitations':
|
|
225
229
|
request = { method: 'POST', path: '/' + input.tool.slice(10), body: args };
|
|
226
230
|
break;
|
|
227
231
|
case 'artifacts_ensure':
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { JsonValue } from '../contracts.js';
|
|
2
2
|
import type { EffectiveArtifactCommand } from '../server/command-identity.js';
|
|
3
3
|
export declare const PROFILE_CONTRACT_VERSION: "artifacts-profile/v1";
|
|
4
|
-
export declare const ARTIFACT_CAPABILITY_NAMES: readonly ["artifacts_get_template", "artifacts_get_api_guide", "artifacts_ensure", "artifacts_publish", "artifacts_create_upload", "artifacts_commit_upload", "artifacts_list", "artifacts_get", "artifacts_get_source", "artifacts_fork", "artifacts_set_access", "artifacts_promote", "artifacts_renew", "artifacts_delete", "artifacts_restore", "artifacts_list_versions", "artifacts_revert", "artifacts_lookup_people", "artifacts_list_access", "artifacts_publish_bundle", "artifacts_revoke_reader_consent", "artifacts_create_upload_page", "artifacts_list_assets", "artifacts_publish_bundle_v2", "artifacts_list_app_sources", "artifacts_fetch_app_source", "artifacts_git_attach", "artifacts_git_commit", "artifacts_git_publish", "artifacts_git_live", "artifacts_live_write", "artifacts_live_read", "artifacts_live_reset", "artifacts_live_status", "artifacts_live_control"];
|
|
4
|
+
export declare const ARTIFACT_CAPABILITY_NAMES: readonly ["artifacts_get_template", "artifacts_get_api_guide", "artifacts_ensure", "artifacts_publish", "artifacts_create_upload", "artifacts_commit_upload", "artifacts_list", "artifacts_get", "artifacts_get_source", "artifacts_fork", "artifacts_set_access", "artifacts_promote", "artifacts_renew", "artifacts_delete", "artifacts_restore", "artifacts_list_versions", "artifacts_revert", "artifacts_lookup_people", "artifacts_list_access", "artifacts_publish_bundle", "artifacts_revoke_reader_consent", "artifacts_create_upload_page", "artifacts_list_assets", "artifacts_publish_bundle_v2", "artifacts_list_app_sources", "artifacts_fetch_app_source", "artifacts_git_attach", "artifacts_git_commit", "artifacts_git_publish", "artifacts_git_live", "artifacts_live_write", "artifacts_live_read", "artifacts_live_reset", "artifacts_live_status", "artifacts_live_control", "artifacts_live_invite", "artifacts_live_accept_invitation", "artifacts_live_revoke_invitation", "artifacts_live_invitations"];
|
|
5
5
|
export type ArtifactCapabilityName = (typeof ARTIFACT_CAPABILITY_NAMES)[number];
|
|
6
6
|
export type ArtifactSchema = Readonly<Record<string, unknown>>;
|
|
7
7
|
export interface OperationProfile {
|
|
@@ -16,6 +16,9 @@ export const ARTIFACT_CAPABILITY_NAMES = [
|
|
|
16
16
|
'artifacts_git_attach', 'artifacts_git_commit', 'artifacts_git_publish', 'artifacts_git_live',
|
|
17
17
|
'artifacts_live_write', 'artifacts_live_read', 'artifacts_live_reset',
|
|
18
18
|
'artifacts_live_status', 'artifacts_live_control',
|
|
19
|
+
// Live invitations (A-LIVE v2 §9) — appended last; frozen at birth.
|
|
20
|
+
'artifacts_live_invite', 'artifacts_live_accept_invitation', 'artifacts_live_revoke_invitation',
|
|
21
|
+
'artifacts_live_invitations',
|
|
19
22
|
];
|
|
20
23
|
/** Projection fields are data-only; invocation correlation is added by L6. */
|
|
21
24
|
export const PRECONDITION_REQUIRED_MESSAGE = 'expectedCurrentReleaseId is required by the active artifact profile. Re-read this artifact with artifacts_get or artifacts_list, then send expectedCurrentReleaseId using the currentReleaseId returned by that read. Send null only if the read confirms that there is no current release. Before editing an existing release, read it with artifacts_get_source and use that releaseId. The server will not infer this value.';
|
package/dist/profile/index.js
CHANGED
|
@@ -127,7 +127,8 @@ export function compileArtifactsProfile(input) {
|
|
|
127
127
|
if (['artifacts_ensure', 'artifacts_publish', 'artifacts_commit_upload', 'artifacts_publish_bundle',
|
|
128
128
|
'artifacts_publish_bundle_v2', 'artifacts_set_access', 'artifacts_delete', 'artifacts_revert',
|
|
129
129
|
'artifacts_git_attach', 'artifacts_git_commit', 'artifacts_git_publish', 'artifacts_git_live',
|
|
130
|
-
'artifacts_live_write', 'artifacts_live_reset', 'artifacts_live_control'
|
|
130
|
+
'artifacts_live_write', 'artifacts_live_reset', 'artifacts_live_control', 'artifacts_live_invite',
|
|
131
|
+
'artifacts_live_accept_invitation', 'artifacts_live_revoke_invitation'].includes(name)) {
|
|
131
132
|
idempotency[name] = { required: true, scope: 'principal' };
|
|
132
133
|
}
|
|
133
134
|
}
|
|
@@ -149,7 +150,8 @@ export function compileArtifactsProfile(input) {
|
|
|
149
150
|
capabilityForRoute(method, path) {
|
|
150
151
|
let name;
|
|
151
152
|
const gitRoutes = ['list_app_sources', 'fetch_app_source', 'git_attach', 'git_commit', 'git_publish',
|
|
152
|
-
'live_write', 'live_read', 'live_reset', 'live_status', 'live_control'
|
|
153
|
+
'live_write', 'live_read', 'live_reset', 'live_status', 'live_control',
|
|
154
|
+
'live_invite', 'live_accept_invitation', 'live_revoke_invitation', 'live_invitations'];
|
|
153
155
|
if (method === 'POST' && gitRoutes.some(route => path === '/' + route)) {
|
|
154
156
|
name = `artifacts_${path.slice(1)}`;
|
|
155
157
|
}
|
package/dist/profile/schemas.js
CHANGED
|
@@ -24,6 +24,9 @@ export function assertCompleteOperation(config) {
|
|
|
24
24
|
live_write: { limits: ['idempotencyKeyMaxUnits'], defaults: [] },
|
|
25
25
|
live_reset: { limits: ['idempotencyKeyMaxUnits'], defaults: [] },
|
|
26
26
|
live_control: { limits: ['idempotencyKeyMaxUnits'], defaults: [] },
|
|
27
|
+
live_invite: { limits: ['idempotencyKeyMaxUnits'], defaults: [] },
|
|
28
|
+
live_accept_invitation: { limits: ['idempotencyKeyMaxUnits'], defaults: [] },
|
|
29
|
+
live_revoke_invitation: { limits: ['idempotencyKeyMaxUnits'], defaults: [] },
|
|
27
30
|
ensure: { limits: ['bindingNameMinUnits', 'bindingNameMaxUnits', 'idempotencyKeyMaxUnits'],
|
|
28
31
|
defaults: ['parameters'] },
|
|
29
32
|
// publish additionally accepts the optional release-budget keys
|
|
@@ -104,7 +104,8 @@ export function normalizeArguments(profile, name, input, schema, envelopeKey, op
|
|
|
104
104
|
const normalized = { ...copyJson(defaults), ...args };
|
|
105
105
|
if (['ensure', 'publish', 'commit_upload', 'publish_bundle', 'publish_bundle_v2',
|
|
106
106
|
'set_access', 'delete', 'revert', 'git_attach', 'git_commit', 'git_publish', 'git_live',
|
|
107
|
-
'live_write', 'live_reset', 'live_control'
|
|
107
|
+
'live_write', 'live_reset', 'live_control', 'live_invite', 'live_accept_invitation',
|
|
108
|
+
'live_revoke_invitation'].includes(operation)) {
|
|
108
109
|
const key = args.idempotencyKey;
|
|
109
110
|
requireInput(typeof key === 'string' && key.trim().length > 0 && key.length <= limits.idempotencyKeyMaxUnits);
|
|
110
111
|
requireInput(envelopeKey === undefined || envelopeKey === key);
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import { type HostIntegrityMap } from './build-integrity.js';
|
|
2
|
+
/** Named GB1 port for the supervisor (W3) and the builder service (W7); one public subpath. */
|
|
3
|
+
export { approvedIntegrity, hostIntegrityMapDigest, lockfileSha256, type DependencyIntegrityInventory, type DependencyIntegrityRecord, type HostIntegrityMap, type HostIntegrityMapEntry, } from './build-integrity.js';
|
|
4
|
+
export type { BuildDependencyEvidence, ScriptQualificationRecord } from './build-dependencies.js';
|
|
5
|
+
export { validateBuildOutput, type AdmittedOutputFile, type BuildOutputEntry } from './build-output.js';
|
|
6
|
+
export { candidateInventoryDigest, verifyBuilderReceipt, verifyServedCandidate, type BuilderAttestedEvidence, type BuilderReceiptExpectation, type BuilderReceiptMismatch, type CandidateFileDigest, } from './build-receipt.js';
|
|
1
7
|
/** Frozen G0 v3 §4.1 fields. Install permissions belong to the host. */
|
|
2
8
|
export interface ArtifactBuildDescriptor {
|
|
3
9
|
readonly version: 1;
|
|
@@ -17,6 +23,10 @@ export interface ArtifactBuildSnapshot {
|
|
|
17
23
|
readonly subPath: string;
|
|
18
24
|
readonly files: Readonly<Record<string, string>>;
|
|
19
25
|
readonly postinstallAllowlist?: readonly PostinstallAllowlistEntry[];
|
|
26
|
+
/** Host qualification rows for disabled hooks (A-LIVE §7.3); never an execution grant. */
|
|
27
|
+
readonly scriptQualification?: readonly PostinstallAllowlistEntry[];
|
|
28
|
+
/** Host-sealed integrity map for entries lacking literal SRI (A-LIVE §7.2). */
|
|
29
|
+
readonly integrityMap?: HostIntegrityMap;
|
|
20
30
|
readonly allowedRegistries?: readonly string[];
|
|
21
31
|
}
|
|
22
32
|
export interface ArtifactBuildTuple {
|
|
@@ -49,7 +59,12 @@ export declare function buildJson(text: string | undefined): Record<string, unkn
|
|
|
49
59
|
export declare function buildPath(value: unknown): value is string;
|
|
50
60
|
/** Validation only: no filesystem, network, install, shell or script execution. */
|
|
51
61
|
export declare function validateArtifactBuild(snapshot: ArtifactBuildSnapshot): {
|
|
62
|
+
readonly postinstall: readonly PostinstallAllowlistEntry[];
|
|
63
|
+
readonly scriptQualification: readonly import("./build-dependencies.js").ScriptQualificationRecord[];
|
|
64
|
+
readonly integrity: import("./build-integrity.js").DependencyIntegrityInventory;
|
|
52
65
|
readonly descriptor: ArtifactBuildDescriptor;
|
|
66
|
+
readonly descriptorDigest: string;
|
|
67
|
+
readonly lockfileDigest: string;
|
|
53
68
|
readonly installDirectory: string;
|
|
54
69
|
readonly scriptDirectory: string;
|
|
55
70
|
readonly install: {
|
|
@@ -60,5 +75,4 @@ export declare function validateArtifactBuild(snapshot: ArtifactBuildSnapshot):
|
|
|
60
75
|
readonly command: "npm";
|
|
61
76
|
readonly args: readonly ["run", string];
|
|
62
77
|
};
|
|
63
|
-
readonly postinstall: readonly PostinstallAllowlistEntry[];
|
|
64
78
|
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ArtifactOperationError } from './failures.js';
|
|
2
2
|
import { validateBuildDependencies } from './build-dependencies.js';
|
|
3
|
+
import { lockfileSha256, sha256Hex } from './build-integrity.js';
|
|
4
|
+
/** Named GB1 port for the supervisor (W3) and the builder service (W7); one public subpath. */
|
|
5
|
+
export { approvedIntegrity, hostIntegrityMapDigest, lockfileSha256, } from './build-integrity.js';
|
|
6
|
+
export { validateBuildOutput } from './build-output.js';
|
|
7
|
+
export { candidateInventoryDigest, verifyBuilderReceipt, verifyServedCandidate, } from './build-receipt.js';
|
|
3
8
|
export function buildRecord(value) {
|
|
4
9
|
return typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
5
10
|
}
|
|
@@ -23,7 +28,8 @@ export function validateArtifactBuild(snapshot) {
|
|
|
23
28
|
const invalid = () => { throw new ArtifactOperationError('build_descriptor_invalid'); };
|
|
24
29
|
if (snapshot.subPath !== '' && !buildPath(snapshot.subPath))
|
|
25
30
|
invalid();
|
|
26
|
-
const
|
|
31
|
+
const descriptorText = snapshot.files[join(snapshot.subPath, 'sentropic.artifact.json')];
|
|
32
|
+
const value = buildJson(descriptorText);
|
|
27
33
|
const fields = ['version', 'buildScript', 'outputDir', 'lockfilePath', 'entry', 'publicEnvNames'];
|
|
28
34
|
if (Object.keys(value).some(key => !fields.includes(key)) || value.version !== 1
|
|
29
35
|
|| typeof value.buildScript !== 'string' || !/^[A-Za-z0-9:_-]+$/.test(value.buildScript)
|
|
@@ -42,17 +48,20 @@ export function validateArtifactBuild(snapshot) {
|
|
|
42
48
|
throw new ArtifactOperationError('build_script_missing');
|
|
43
49
|
if (!Object.hasOwn(snapshot.files, descriptor.lockfilePath))
|
|
44
50
|
throw new ArtifactOperationError('lock_missing');
|
|
45
|
-
const
|
|
51
|
+
const lockText = snapshot.files[descriptor.lockfilePath];
|
|
52
|
+
const lock = buildJson(lockText);
|
|
46
53
|
const installDirectory = descriptor.lockfilePath.includes('/')
|
|
47
54
|
? descriptor.lockfilePath.slice(0, descriptor.lockfilePath.lastIndexOf('/')) : '';
|
|
48
55
|
if (installDirectory && snapshot.subPath !== installDirectory
|
|
49
56
|
&& !snapshot.subPath.startsWith(`${installDirectory}/`))
|
|
50
57
|
invalid();
|
|
51
|
-
const
|
|
58
|
+
const lockfileDigest = lockfileSha256(lockText);
|
|
59
|
+
const evidence = validateBuildDependencies(snapshot, lock, installDirectory, lockfileDigest);
|
|
52
60
|
return {
|
|
53
|
-
descriptor,
|
|
61
|
+
descriptor, descriptorDigest: sha256Hex(descriptorText), lockfileDigest,
|
|
62
|
+
installDirectory, scriptDirectory: snapshot.subPath,
|
|
54
63
|
install: { command: 'npm', args: ['ci', '--ignore-scripts'] },
|
|
55
64
|
build: { command: 'npm', args: ['run', descriptor.buildScript] },
|
|
56
|
-
|
|
65
|
+
...evidence,
|
|
57
66
|
};
|
|
58
67
|
}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
import type { ArtifactBuildSnapshot, PostinstallAllowlistEntry } from './build-contract.js';
|
|
2
|
+
import { type DependencyIntegrityInventory } from './build-integrity.js';
|
|
3
|
+
/** A-LIVE §7.3 host qualification row: literal lockfile SRI only; disabled rows never authorize execution. */
|
|
4
|
+
export interface ScriptQualificationRecord extends PostinstallAllowlistEntry {
|
|
5
|
+
readonly source: 'lockfile';
|
|
6
|
+
readonly execution: 'disabled' | 'allowlisted';
|
|
7
|
+
}
|
|
8
|
+
export interface BuildDependencyEvidence {
|
|
9
|
+
readonly postinstall: readonly PostinstallAllowlistEntry[];
|
|
10
|
+
readonly scriptQualification: readonly ScriptQualificationRecord[];
|
|
11
|
+
readonly integrity: DependencyIntegrityInventory;
|
|
12
|
+
}
|
|
2
13
|
/** Validate the lock-indexed install closure, including host-owned lifecycle permissions. */
|
|
3
|
-
export declare function validateBuildDependencies(snapshot: ArtifactBuildSnapshot, lock: Record<string, unknown>, installDirectory: string):
|
|
14
|
+
export declare function validateBuildDependencies(snapshot: ArtifactBuildSnapshot, lock: Record<string, unknown>, installDirectory: string, lockfileDigest: string): BuildDependencyEvidence;
|