@truealter/sdk 0.4.1 → 0.5.0
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 +49 -36
- package/dist/bin/alter-identity.js +19 -13
- package/dist/bin/mcp-bridge.js +30 -9
- package/dist/index.cjs +42 -13
- package/dist/index.d.cts +391 -27
- package/dist/index.d.ts +391 -27
- package/dist/index.js +38 -14
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -188,6 +188,14 @@ interface VerifyProvenanceOptions {
|
|
|
188
188
|
verifyAtAllowlist?: readonly string[];
|
|
189
189
|
fetch?: typeof fetch;
|
|
190
190
|
now?: number;
|
|
191
|
+
/**
|
|
192
|
+
* Expected `iss` claim. Defaults to {@link ALTER_PLATFORM_ISS}
|
|
193
|
+
* (`"did:alter:platform"`). Pass an explicit value only when verifying
|
|
194
|
+
* tokens minted by a non-platform issuer (e.g. a test fixture or a
|
|
195
|
+
* whitelabelled deployment). An empty string disables the check — not
|
|
196
|
+
* recommended for production use.
|
|
197
|
+
*/
|
|
198
|
+
expectedIss?: string;
|
|
191
199
|
}
|
|
192
200
|
/**
|
|
193
201
|
* Verify a provenance JWS token against ALTER's published JWKS.
|
|
@@ -416,6 +424,16 @@ interface MCPClientOptions {
|
|
|
416
424
|
* 2026-04-20).
|
|
417
425
|
*/
|
|
418
426
|
signing?: MCPSigningOptions;
|
|
427
|
+
/**
|
|
428
|
+
* Extra HTTP headers added to every request. Useful when the endpoint
|
|
429
|
+
* sits behind an edge gate that requires its own credentials —
|
|
430
|
+
* e.g. Cloudflare Access service tokens (`CF-Access-Client-Id` +
|
|
431
|
+
* `CF-Access-Client-Secret`). Protocol-level headers (`Content-Type`,
|
|
432
|
+
* `Accept`) and ALTER-internal headers (`X-ALTER-API-Key`,
|
|
433
|
+
* `Mcp-Session-Id`, `Mcp-Invocation-Signature`) always win over
|
|
434
|
+
* collisions here.
|
|
435
|
+
*/
|
|
436
|
+
extraHeaders?: Record<string, string>;
|
|
419
437
|
}
|
|
420
438
|
interface MCPSigningOptions {
|
|
421
439
|
/** The signing-key id pre-registered with the server. */
|
|
@@ -473,6 +491,7 @@ declare class MCPClient {
|
|
|
473
491
|
private readonly clientInfo;
|
|
474
492
|
private readonly x402?;
|
|
475
493
|
private readonly signing?;
|
|
494
|
+
private readonly extraHeaders?;
|
|
476
495
|
private requestCounter;
|
|
477
496
|
private initialised;
|
|
478
497
|
constructor(opts?: MCPClientOptions);
|
|
@@ -605,7 +624,7 @@ interface ListArchetypesOutput {
|
|
|
605
624
|
}
|
|
606
625
|
/** (free) verify_identity — Verify a person is registered with ALTER and validate optional claims */
|
|
607
626
|
interface VerifyIdentityInput {
|
|
608
|
-
|
|
627
|
+
member_id: string;
|
|
609
628
|
email?: string;
|
|
610
629
|
claims?: {
|
|
611
630
|
archetype?: string;
|
|
@@ -620,7 +639,7 @@ interface VerifyIdentityInput {
|
|
|
620
639
|
interface VerifyIdentityOutput {
|
|
621
640
|
ok: boolean;
|
|
622
641
|
verified: boolean;
|
|
623
|
-
|
|
642
|
+
member_id?: string;
|
|
624
643
|
engagement_level?: EngagementLevel;
|
|
625
644
|
archetype?: Archetype;
|
|
626
645
|
claims_valid?: boolean;
|
|
@@ -640,7 +659,7 @@ interface InitiateAssessmentOutput {
|
|
|
640
659
|
}
|
|
641
660
|
/** (free) get_engagement_level — Get a person's identity depth and available query tiers */
|
|
642
661
|
interface GetEngagementLevelInput {
|
|
643
|
-
|
|
662
|
+
member_id: string;
|
|
644
663
|
}
|
|
645
664
|
/** (free) get_engagement_level — output */
|
|
646
665
|
interface GetEngagementLevelOutput {
|
|
@@ -657,12 +676,12 @@ interface GetEngagementLevelOutput {
|
|
|
657
676
|
}
|
|
658
677
|
/** (free) get_profile — Get a person's profile summary */
|
|
659
678
|
interface GetProfileInput {
|
|
660
|
-
|
|
679
|
+
member_id: string;
|
|
661
680
|
}
|
|
662
681
|
/** (free) get_profile — output */
|
|
663
682
|
interface GetProfileOutput {
|
|
664
683
|
ok: boolean;
|
|
665
|
-
|
|
684
|
+
member_id: string;
|
|
666
685
|
assessment_phase?: string;
|
|
667
686
|
archetype?: Archetype;
|
|
668
687
|
engagement_level?: EngagementLevel;
|
|
@@ -670,7 +689,7 @@ interface GetProfileOutput {
|
|
|
670
689
|
}
|
|
671
690
|
/** (free) query_matches — Query matches for a person (tier labels only) */
|
|
672
691
|
interface QueryMatchesInput {
|
|
673
|
-
|
|
692
|
+
member_id: string;
|
|
674
693
|
quality_filter?: MatchTier;
|
|
675
694
|
limit?: number;
|
|
676
695
|
}
|
|
@@ -687,7 +706,7 @@ interface QueryMatchesOutput {
|
|
|
687
706
|
}
|
|
688
707
|
/** (free) get_competencies — Get a person's competency portfolio */
|
|
689
708
|
interface GetCompetenciesInput {
|
|
690
|
-
|
|
709
|
+
member_id: string;
|
|
691
710
|
}
|
|
692
711
|
/** (free) get_competencies — output */
|
|
693
712
|
interface GetCompetenciesOutput {
|
|
@@ -714,7 +733,7 @@ interface SearchIdentitiesInput {
|
|
|
714
733
|
interface SearchIdentitiesOutput {
|
|
715
734
|
ok: boolean;
|
|
716
735
|
identities: Array<{
|
|
717
|
-
|
|
736
|
+
member_id: string;
|
|
718
737
|
trait_summary: Record<string, number>;
|
|
719
738
|
engagement_level?: EngagementLevel;
|
|
720
739
|
}>;
|
|
@@ -722,7 +741,7 @@ interface SearchIdentitiesOutput {
|
|
|
722
741
|
}
|
|
723
742
|
/** (free) get_identity_earnings — Get accrued Identity Income earnings for a person */
|
|
724
743
|
interface GetIdentityEarningsInput {
|
|
725
|
-
|
|
744
|
+
member_id: string;
|
|
726
745
|
}
|
|
727
746
|
/** (free) get_identity_earnings — output */
|
|
728
747
|
interface GetIdentityEarningsOutput {
|
|
@@ -730,7 +749,7 @@ interface GetIdentityEarningsOutput {
|
|
|
730
749
|
total_earned_usd: number;
|
|
731
750
|
pending_usd: number;
|
|
732
751
|
transaction_count: number;
|
|
733
|
-
|
|
752
|
+
unique_orgs: number;
|
|
734
753
|
}
|
|
735
754
|
/** (free) get_network_stats — Get aggregate ALTER network statistics */
|
|
736
755
|
interface GetNetworkStatsInput {
|
|
@@ -756,7 +775,7 @@ interface RecommendToolOutput {
|
|
|
756
775
|
}
|
|
757
776
|
/** (free) get_identity_trust_score — Get the trust score for an identity based on query diversity */
|
|
758
777
|
interface GetIdentityTrustScoreInput {
|
|
759
|
-
|
|
778
|
+
member_id: string;
|
|
760
779
|
}
|
|
761
780
|
/** (free) get_identity_trust_score — output */
|
|
762
781
|
interface GetIdentityTrustScoreOutput {
|
|
@@ -779,7 +798,7 @@ interface CheckAssessmentStatusOutput {
|
|
|
779
798
|
}
|
|
780
799
|
/** (free) get_earning_summary — Get an aggregated x402 earning summary for a person */
|
|
781
800
|
interface GetEarningSummaryInput {
|
|
782
|
-
|
|
801
|
+
member_id: string;
|
|
783
802
|
}
|
|
784
803
|
/** (free) get_earning_summary — output */
|
|
785
804
|
interface GetEarningSummaryOutput {
|
|
@@ -819,7 +838,7 @@ interface GetAgentPortfolioOutput {
|
|
|
819
838
|
}
|
|
820
839
|
/** (free) get_privacy_budget — Check privacy budget status for a person (24h rolling window) */
|
|
821
840
|
interface GetPrivacyBudgetInput {
|
|
822
|
-
|
|
841
|
+
member_id: string;
|
|
823
842
|
}
|
|
824
843
|
/** (free) get_privacy_budget — output */
|
|
825
844
|
interface GetPrivacyBudgetOutput {
|
|
@@ -922,13 +941,13 @@ interface AssessTraitsOutput {
|
|
|
922
941
|
}
|
|
923
942
|
/** (premium L1) get_trait_snapshot — Get the top 5 traits for a person ($0.005) */
|
|
924
943
|
interface GetTraitSnapshotInput {
|
|
925
|
-
|
|
944
|
+
member_id: string;
|
|
926
945
|
_payment?: ProvenanceToken;
|
|
927
946
|
}
|
|
928
947
|
/** (premium L1) get_trait_snapshot — output */
|
|
929
948
|
interface GetTraitSnapshotOutput {
|
|
930
949
|
ok: boolean;
|
|
931
|
-
|
|
950
|
+
member_id: string;
|
|
932
951
|
archetype: Archetype;
|
|
933
952
|
top_traits: Array<{
|
|
934
953
|
name: string;
|
|
@@ -938,13 +957,13 @@ interface GetTraitSnapshotOutput {
|
|
|
938
957
|
}
|
|
939
958
|
/** (premium L2) get_full_trait_vector — Get the complete trait vector (all 33 traits: 29 continuous + 4 categorical) ($0.01) */
|
|
940
959
|
interface GetFullTraitVectorInput {
|
|
941
|
-
|
|
960
|
+
member_id: string;
|
|
942
961
|
_payment?: ProvenanceToken;
|
|
943
962
|
}
|
|
944
963
|
/** (premium L2) get_full_trait_vector — output */
|
|
945
964
|
interface GetFullTraitVectorOutput {
|
|
946
965
|
ok: boolean;
|
|
947
|
-
|
|
966
|
+
member_id: string;
|
|
948
967
|
traits: Array<{
|
|
949
968
|
name: string;
|
|
950
969
|
category: string;
|
|
@@ -954,7 +973,7 @@ interface GetFullTraitVectorOutput {
|
|
|
954
973
|
}
|
|
955
974
|
/** (premium L4) compute_belonging — Compute belonging probability for a person-job pairing ($0.05) */
|
|
956
975
|
interface ComputeBelongingInput {
|
|
957
|
-
|
|
976
|
+
member_id: string;
|
|
958
977
|
job_id: string;
|
|
959
978
|
_payment?: ProvenanceToken;
|
|
960
979
|
}
|
|
@@ -971,7 +990,7 @@ interface ComputeBelongingOutput {
|
|
|
971
990
|
}
|
|
972
991
|
/** (premium L5) get_match_recommendations — Get top N match recommendations for a person ($0.50) */
|
|
973
992
|
interface GetMatchRecommendationsInput {
|
|
974
|
-
|
|
993
|
+
member_id: string;
|
|
975
994
|
limit?: number;
|
|
976
995
|
_payment?: ProvenanceToken;
|
|
977
996
|
}
|
|
@@ -1004,7 +1023,7 @@ interface GenerateMatchNarrativeOutput {
|
|
|
1004
1023
|
}
|
|
1005
1024
|
/** (premium L2) get_side_quest_graph — Get a person's Side Quest Graph (DP noise ε=1.0) ($0.01) */
|
|
1006
1025
|
interface GetSideQuestGraphInput {
|
|
1007
|
-
|
|
1026
|
+
member_id: string;
|
|
1008
1027
|
include_edges?: boolean;
|
|
1009
1028
|
min_confidence?: number;
|
|
1010
1029
|
_payment?: ProvenanceToken;
|
|
@@ -1012,7 +1031,7 @@ interface GetSideQuestGraphInput {
|
|
|
1012
1031
|
/** (premium L2) get_side_quest_graph — output */
|
|
1013
1032
|
interface GetSideQuestGraphOutput {
|
|
1014
1033
|
ok: boolean;
|
|
1015
|
-
|
|
1034
|
+
member_id: string;
|
|
1016
1035
|
domains: Array<{
|
|
1017
1036
|
label: string;
|
|
1018
1037
|
confidence: number;
|
|
@@ -1027,15 +1046,15 @@ interface GetSideQuestGraphOutput {
|
|
|
1027
1046
|
}
|
|
1028
1047
|
/** (premium L3) query_graph_similarity — Compare two Side Quest Graphs (DP noise ε=0.5) ($0.025) */
|
|
1029
1048
|
interface QueryGraphSimilarityInput {
|
|
1030
|
-
|
|
1031
|
-
|
|
1049
|
+
member_a_id: string;
|
|
1050
|
+
member_b_id: string;
|
|
1032
1051
|
_payment?: ProvenanceToken;
|
|
1033
1052
|
}
|
|
1034
1053
|
/** (premium L3) query_graph_similarity — output */
|
|
1035
1054
|
interface QueryGraphSimilarityOutput {
|
|
1036
1055
|
ok: boolean;
|
|
1037
|
-
|
|
1038
|
-
|
|
1056
|
+
member_a_id: string;
|
|
1057
|
+
member_b_id: string;
|
|
1039
1058
|
domain_overlap: number;
|
|
1040
1059
|
edge_similarity: number;
|
|
1041
1060
|
complementarity: number;
|
|
@@ -1359,7 +1378,7 @@ interface SignInvocationOptions {
|
|
|
1359
1378
|
* Usage:
|
|
1360
1379
|
*
|
|
1361
1380
|
* ```ts
|
|
1362
|
-
* const header = signInvocation("get_profile", {
|
|
1381
|
+
* const header = signInvocation("get_profile", { member_id: "abc" }, {
|
|
1363
1382
|
* kid, privateKey, handle: "~tester",
|
|
1364
1383
|
* });
|
|
1365
1384
|
* fetch(url, { headers: { "Mcp-Invocation-Signature": header } });
|
|
@@ -1601,6 +1620,351 @@ interface UnwireReport {
|
|
|
1601
1620
|
}
|
|
1602
1621
|
declare function unwire(): UnwireReport;
|
|
1603
1622
|
|
|
1623
|
+
/**
|
|
1624
|
+
* @truealter/sdk — alter_homepage MCP tool types
|
|
1625
|
+
*
|
|
1626
|
+
* Wire-format types for the user-authored, externally-queryable identity
|
|
1627
|
+
* homepage surface ratified (proposed) as D-CUST-PORTFOLIO-1 in
|
|
1628
|
+
* alter-internal Session 54.
|
|
1629
|
+
*
|
|
1630
|
+
* Tool name note: ratified-as `alter_portfolio` in the proposed DR;
|
|
1631
|
+
* shipping as `alter_homepage` because `alter_portfolio` is already
|
|
1632
|
+
* taken by the verified-attestations tool in mcp-alter (different
|
|
1633
|
+
* concept). Per the handover's explicit fallback. The DR text and
|
|
1634
|
+
* companion docs may still say "portfolio" — the wire-format and
|
|
1635
|
+
* tool-name-on-server are `homepage`.
|
|
1636
|
+
*
|
|
1637
|
+
* Wire-format rule: every field name matches the JSON Schema property
|
|
1638
|
+
* name exactly (snake_case). These are passed straight into JSON-RPC
|
|
1639
|
+
* `arguments` and rendered straight from JSON-RPC `result`.
|
|
1640
|
+
*/
|
|
1641
|
+
/**
|
|
1642
|
+
* Provenance class for a HomepageManifest field. Determines how a
|
|
1643
|
+
* conforming MCP consumer renders the value:
|
|
1644
|
+
*
|
|
1645
|
+
* - `declared`: user wrote the literal value. Render verbatim.
|
|
1646
|
+
* - `derived`: computed from active + consented signals. Render with
|
|
1647
|
+
* provenance class surfaced to the viewer (e.g. an italic gloss).
|
|
1648
|
+
* - `attested`: verified by a recognised entity (Org Alter, ceremony,
|
|
1649
|
+
* external attester). Render with provenance + attester surfaced.
|
|
1650
|
+
*/
|
|
1651
|
+
type HomepageFieldProvenance = "declared" | "derived" | "attested";
|
|
1652
|
+
/**
|
|
1653
|
+
* One field of a HomepageManifest. Every field carries its provenance
|
|
1654
|
+
* class so MCP consumers can render appropriately. The `value` shape is
|
|
1655
|
+
* field-specific — this is a discriminated parent; consumers should
|
|
1656
|
+
* narrow on the manifest's field name, not on `value`'s runtime shape.
|
|
1657
|
+
*/
|
|
1658
|
+
interface HomepageField<T = unknown> {
|
|
1659
|
+
/** The user-facing value. Type depends on which field this is. */
|
|
1660
|
+
value: T;
|
|
1661
|
+
/** Where this value comes from. */
|
|
1662
|
+
provenance: HomepageFieldProvenance;
|
|
1663
|
+
/**
|
|
1664
|
+
* For `attested` fields, the entity that attested. Optional on the
|
|
1665
|
+
* other provenance classes (where it would be redundant).
|
|
1666
|
+
*/
|
|
1667
|
+
attester?: string;
|
|
1668
|
+
}
|
|
1669
|
+
/**
|
|
1670
|
+
* The wire-format manifest returned by `alter_homepage(handle)`.
|
|
1671
|
+
*
|
|
1672
|
+
* Fields are individually optional — a HomepageManifest with only a
|
|
1673
|
+
* handle and an opener is valid. MCP consumers MUST NOT assume any
|
|
1674
|
+
* field other than `handle` is present.
|
|
1675
|
+
*/
|
|
1676
|
+
interface HomepageManifest {
|
|
1677
|
+
/** The ~handle being queried. Always present. */
|
|
1678
|
+
handle: string;
|
|
1679
|
+
/**
|
|
1680
|
+
* Single-line user-authored self-description. Maximum 240 chars
|
|
1681
|
+
* after NFC normalisation, after the install-time ANSI sanitiser
|
|
1682
|
+
* pass. Always declared-provenance.
|
|
1683
|
+
*/
|
|
1684
|
+
whoami?: HomepageField<string>;
|
|
1685
|
+
/**
|
|
1686
|
+
* Rotating or static user-authored line. Maximum 280 chars after
|
|
1687
|
+
* NFC normalisation, after the install-time ANSI sanitiser pass.
|
|
1688
|
+
* The literal `~` substitutes the active handle at render time.
|
|
1689
|
+
* Always declared-provenance.
|
|
1690
|
+
*/
|
|
1691
|
+
opener?: HomepageField<string>;
|
|
1692
|
+
/**
|
|
1693
|
+
* Composed-glyph string (from typed primitives, D-CUST-1 M3). The
|
|
1694
|
+
* sigil is a string of renderer-recognised primitive references —
|
|
1695
|
+
* not raw glyph codes — so different consumers can render the same
|
|
1696
|
+
* sigil distinctly. Provenance is `declared` for user-composed,
|
|
1697
|
+
* `derived` for sigil-from-thread-graph crystallisation.
|
|
1698
|
+
*/
|
|
1699
|
+
sigil?: HomepageField<string>;
|
|
1700
|
+
/** User's pronouns (already-shipped surface). Always declared. */
|
|
1701
|
+
pronouns?: HomepageField<string>;
|
|
1702
|
+
/**
|
|
1703
|
+
* List of recognised Seat glyphs the holder is bound to. Provenance
|
|
1704
|
+
* is always `attested` (ceremony-attested, server-side resolved);
|
|
1705
|
+
* `attester` will be `~alter` for protocol-observed Seats.
|
|
1706
|
+
*/
|
|
1707
|
+
seats?: HomepageField<readonly string[]>;
|
|
1708
|
+
/**
|
|
1709
|
+
* Glyph from the user's attunement-grade library. Provenance is
|
|
1710
|
+
* `derived` (from the user's identity vector); the underlying
|
|
1711
|
+
* computation is L3-local and the chosen glyph is declared-from-
|
|
1712
|
+
* derived-measure (user picks within a library gated by their
|
|
1713
|
+
* attunement grade).
|
|
1714
|
+
*/
|
|
1715
|
+
attunement_glyph?: HomepageField<string>;
|
|
1716
|
+
/**
|
|
1717
|
+
* Optional, opt-in per query context. Coarse Golden-Thread summary;
|
|
1718
|
+
* provenance is `derived`. MCP consumers MUST NOT request this field
|
|
1719
|
+
* by default — only on explicit per-call consent. Consumers in the
|
|
1720
|
+
* workplace/education vertical MUST NOT request this field at all
|
|
1721
|
+
* (clause-4 caller-context gate).
|
|
1722
|
+
*/
|
|
1723
|
+
thread_strand?: HomepageField<string>;
|
|
1724
|
+
/**
|
|
1725
|
+
* TOML block of MCP-consumer rendering hints (order, density, etc).
|
|
1726
|
+
* Consumers are free to ignore. Provenance is always `declared`.
|
|
1727
|
+
*/
|
|
1728
|
+
render_hints?: HomepageField<Record<string, unknown>>;
|
|
1729
|
+
}
|
|
1730
|
+
/**
|
|
1731
|
+
* Input arguments for the `alter_homepage` MCP tool.
|
|
1732
|
+
*
|
|
1733
|
+
* The `fields` argument lets a consumer request a subset; omitting it
|
|
1734
|
+
* returns all fields the caller is permitted to read under the consent
|
|
1735
|
+
* + caller-context gates.
|
|
1736
|
+
*/
|
|
1737
|
+
interface HomepageInput {
|
|
1738
|
+
/** The ~handle to query. */
|
|
1739
|
+
handle: string;
|
|
1740
|
+
/**
|
|
1741
|
+
* Optional whitelist of field names. If omitted, the server returns
|
|
1742
|
+
* all fields the caller is permitted to read. Unknown field names
|
|
1743
|
+
* are silently ignored (forward-compatible — adding a new field does
|
|
1744
|
+
* not break old consumers).
|
|
1745
|
+
*/
|
|
1746
|
+
fields?: readonly (keyof HomepageManifest)[];
|
|
1747
|
+
}
|
|
1748
|
+
/**
|
|
1749
|
+
* Output of the `alter_homepage` MCP tool. The `manifest` field is
|
|
1750
|
+
* always present on `ok: true`; on error, the `error` field carries a
|
|
1751
|
+
* structured reason the user can act on.
|
|
1752
|
+
*/
|
|
1753
|
+
interface HomepageOutput {
|
|
1754
|
+
ok: boolean;
|
|
1755
|
+
manifest?: HomepageManifest;
|
|
1756
|
+
error?: {
|
|
1757
|
+
code: string;
|
|
1758
|
+
message: string;
|
|
1759
|
+
data?: Record<string, unknown>;
|
|
1760
|
+
};
|
|
1761
|
+
}
|
|
1762
|
+
/**
|
|
1763
|
+
* Caller-context gate: which categories of caller may read which
|
|
1764
|
+
* provenance classes. Enforced server-side; documented here for SDK
|
|
1765
|
+
* consumers building higher-level wrappers.
|
|
1766
|
+
*
|
|
1767
|
+
* - `workplace` / `education` callers MUST NOT receive `derived` or
|
|
1768
|
+
* `attested` provenance fields without explicit per-field consent
|
|
1769
|
+
* (EU AI Act Art 5(1)(d) categorical).
|
|
1770
|
+
* - All other callers may read `declared` and `attested` fields by
|
|
1771
|
+
* default; `derived` fields require stream-specific consent per
|
|
1772
|
+
* IaI clause 5.
|
|
1773
|
+
*/
|
|
1774
|
+
type HomepageCallerVertical = "workplace" | "education" | "personal" | "civic" | "agent" | "unknown";
|
|
1775
|
+
/** Maximum sizes from the spec. SDK consumers can use these to validate
|
|
1776
|
+
* input before sending. Mirrored from
|
|
1777
|
+
* `docs/technical/alter-portfolio-manifest-v1.md` (forthcoming) and
|
|
1778
|
+
* the proposed-D-CUST-PORTFOLIO-1 DR. */
|
|
1779
|
+
declare const HOMEPAGE_LIMITS: {
|
|
1780
|
+
readonly whoami_max_chars: 240;
|
|
1781
|
+
readonly opener_max_chars: 280;
|
|
1782
|
+
readonly pronouns_max_chars: 32;
|
|
1783
|
+
readonly attunement_glyph_max_chars: 16;
|
|
1784
|
+
};
|
|
1785
|
+
|
|
1786
|
+
/**
|
|
1787
|
+
* @truealter/sdk — theme pack types (D-CUST-1 substrate, Wave 2)
|
|
1788
|
+
*
|
|
1789
|
+
* Wire-format types for ALTER theme packs and `themes.lock` composition
|
|
1790
|
+
* manifests. The full specification lives in
|
|
1791
|
+
* `docs/technical/alter-theme-pack-spec-v1.md`; the architecture spike
|
|
1792
|
+
* (with threat model F1–F10) lives in
|
|
1793
|
+
* `.repos/internal/02-Technical-Strategy/alter-theme-packs-architecture-spike.md`.
|
|
1794
|
+
*
|
|
1795
|
+
* These types describe the on-the-wire shape of theme manifests as they
|
|
1796
|
+
* are produced by `alter theme install`, persisted to `themes.lock`,
|
|
1797
|
+
* and shared via the `theme_share` MCP tool. They do NOT describe the
|
|
1798
|
+
* runtime renderer's internal state.
|
|
1799
|
+
*
|
|
1800
|
+
* No runtime side effects, no external imports, ESM-compatible.
|
|
1801
|
+
*/
|
|
1802
|
+
/** The single allowed `palette.floor` value in v1. New floors require schema bump. */
|
|
1803
|
+
type PaletteFloorV1 = "muted-gold";
|
|
1804
|
+
/** Enumerated text-style values. Free strings are rejected by the loader. */
|
|
1805
|
+
type PaletteText = "default" | "high-contrast" | "warm";
|
|
1806
|
+
/** Enumerated status-line slot names. Packs MAY use a permutation of any subset. */
|
|
1807
|
+
type StatusLineSlot = "handle" | "attunement" | "seat" | "thread_strand" | "pronouns" | "org";
|
|
1808
|
+
/** Enumerated status-line density. */
|
|
1809
|
+
type StatusLineDensity = "compact" | "roomy";
|
|
1810
|
+
/** Enumerated greeting-register values. Passes to the Mirror voice register selector. */
|
|
1811
|
+
type GreetingRegister = "intimate" | "formal" | "playful" | "spare";
|
|
1812
|
+
/** Enumerated panel-density values for `alter room`. */
|
|
1813
|
+
type PanelDensity = "compact" | "roomy";
|
|
1814
|
+
/** `[meta]` section. */
|
|
1815
|
+
interface ThemeMeta {
|
|
1816
|
+
name: string;
|
|
1817
|
+
/** SemVer-shaped recommended; informational only. Resolution uses pack_id. */
|
|
1818
|
+
version: string;
|
|
1819
|
+
/** MUST be a ~handle whose D-ID8 public key signs the pack. */
|
|
1820
|
+
author: string;
|
|
1821
|
+
/** ≤ 240 characters after NFC. */
|
|
1822
|
+
description: string;
|
|
1823
|
+
/** OPTIONAL — surfaced by curated resolvers; not rendered by ALTER. */
|
|
1824
|
+
repo?: string;
|
|
1825
|
+
/** OPTIONAL — surfaced by curated resolvers; not rendered by ALTER. */
|
|
1826
|
+
docs_url?: string;
|
|
1827
|
+
}
|
|
1828
|
+
/** `[palette]` section. Renderer enforces gamut; out-of-gamut packs are rejected. */
|
|
1829
|
+
interface ThemePalette {
|
|
1830
|
+
floor: PaletteFloorV1;
|
|
1831
|
+
/** Hex colour clamped to the published accent-slot gamut. */
|
|
1832
|
+
accent: string;
|
|
1833
|
+
text: PaletteText;
|
|
1834
|
+
}
|
|
1835
|
+
/** `[opener]` section. */
|
|
1836
|
+
interface ThemeOpener {
|
|
1837
|
+
/** ≤ 32 entries, each ≤ 240 chars after sanitisation. `~` substitutes the active handle. */
|
|
1838
|
+
library: readonly string[];
|
|
1839
|
+
}
|
|
1840
|
+
/** `[sigil]` section. All values MUST refer to renderer-shipped typed primitives. */
|
|
1841
|
+
interface ThemeSigil {
|
|
1842
|
+
glyph_set: string;
|
|
1843
|
+
trill: string;
|
|
1844
|
+
accent_glyph: string;
|
|
1845
|
+
}
|
|
1846
|
+
/** `[status_line]` section. */
|
|
1847
|
+
interface ThemeStatusLine {
|
|
1848
|
+
/** Permutation of any subset of StatusLineSlot. */
|
|
1849
|
+
order: readonly StatusLineSlot[];
|
|
1850
|
+
density: StatusLineDensity;
|
|
1851
|
+
}
|
|
1852
|
+
/** `[render_hints]` section. */
|
|
1853
|
+
interface ThemeRenderHints {
|
|
1854
|
+
greeting_register: GreetingRegister;
|
|
1855
|
+
panel_density: PanelDensity;
|
|
1856
|
+
}
|
|
1857
|
+
/** `[assets]` section. Paths MUST be repo-relative without `..` segments. */
|
|
1858
|
+
interface ThemeAssets {
|
|
1859
|
+
/** Optional — if omitted, no assets are loaded. */
|
|
1860
|
+
glyphs?: readonly string[];
|
|
1861
|
+
}
|
|
1862
|
+
/**
|
|
1863
|
+
* Complete pack manifest (the parsed-TOML shape of `theme.toml` v1).
|
|
1864
|
+
*
|
|
1865
|
+
* Closed-world: any unknown top-level key MUST cause the loader to
|
|
1866
|
+
* reject the pack. Parsers consuming an arbitrary TOML file should
|
|
1867
|
+
* narrow against this type rather than infer.
|
|
1868
|
+
*/
|
|
1869
|
+
interface ThemeManifestV1 {
|
|
1870
|
+
schema_version: 1;
|
|
1871
|
+
meta: ThemeMeta;
|
|
1872
|
+
palette: ThemePalette;
|
|
1873
|
+
opener?: ThemeOpener;
|
|
1874
|
+
sigil?: ThemeSigil;
|
|
1875
|
+
status_line?: ThemeStatusLine;
|
|
1876
|
+
render_hints?: ThemeRenderHints;
|
|
1877
|
+
assets?: ThemeAssets;
|
|
1878
|
+
}
|
|
1879
|
+
/**
|
|
1880
|
+
* The `.sig` file accompanying every pack. Verification logic lives in
|
|
1881
|
+
* `alter-cli/src/theme/sign.ts`; this is the wire-format type only.
|
|
1882
|
+
*/
|
|
1883
|
+
interface ThemeSignatureManifest {
|
|
1884
|
+
/** SHA-256 multihash of the canonical-form pack. */
|
|
1885
|
+
pack_id: string;
|
|
1886
|
+
/** ~handle of the signer; MUST equal manifest.meta.author. */
|
|
1887
|
+
signer: string;
|
|
1888
|
+
/** RFC 3339 UTC timestamp at signing time. */
|
|
1889
|
+
signed_at: string;
|
|
1890
|
+
/** `ed25519:<base64url-encoded-signature>`. */
|
|
1891
|
+
sig: string;
|
|
1892
|
+
}
|
|
1893
|
+
/** One pack entry in the user-side composition lockfile. */
|
|
1894
|
+
interface ThemeLockEntry {
|
|
1895
|
+
/**
|
|
1896
|
+
* Where the pack was resolved from. One of:
|
|
1897
|
+
* - `git+<url>#<ref>` git-URL pin
|
|
1898
|
+
* - `@<author>/<name>` curated-resolver tuple
|
|
1899
|
+
* - `path:<rel-path>` local-path pin (for development)
|
|
1900
|
+
*/
|
|
1901
|
+
source: string;
|
|
1902
|
+
pack_id: string;
|
|
1903
|
+
signer: string;
|
|
1904
|
+
/** Higher wins on slot conflict; equal priority breaks lex by pack_id. */
|
|
1905
|
+
priority: number;
|
|
1906
|
+
}
|
|
1907
|
+
/**
|
|
1908
|
+
* The user-side composition manifest. This is the publishable artefact
|
|
1909
|
+
* — what someone shares when they say "here is my ALTER".
|
|
1910
|
+
*
|
|
1911
|
+
* Re-applying the same lockfile against the same renderer version MUST
|
|
1912
|
+
* produce a bit-identical render, modulo the `attunement_glyph` field
|
|
1913
|
+
* which is derived per-render from the user's identity vector.
|
|
1914
|
+
*/
|
|
1915
|
+
interface ThemesLockV1 {
|
|
1916
|
+
schema_version: 1;
|
|
1917
|
+
/** e.g. "alter-cli/0.5.0" — informational, not load-bearing. */
|
|
1918
|
+
generated_by: string;
|
|
1919
|
+
/** RFC 3339 UTC timestamp at lockfile-write time. */
|
|
1920
|
+
generated_at: string;
|
|
1921
|
+
pack: readonly ThemeLockEntry[];
|
|
1922
|
+
/**
|
|
1923
|
+
* User-side per-slot overrides applied AFTER pack composition. Keys
|
|
1924
|
+
* are dotted slot names (e.g. `palette.accent`, `sigil.trill`).
|
|
1925
|
+
* Values must match the slot's enumerated set or gamut.
|
|
1926
|
+
*/
|
|
1927
|
+
overrides?: Readonly<Record<string, string | number | boolean>>;
|
|
1928
|
+
}
|
|
1929
|
+
/**
|
|
1930
|
+
* Input arguments for the `theme_share` MCP tool. Sharing emits a 5:1
|
|
1931
|
+
* return event to the sharer (recognition credit + pack citation) and
|
|
1932
|
+
* to the recipient (discovery signal). Implementation lives in
|
|
1933
|
+
* `mcp-alter` per D-RS15.
|
|
1934
|
+
*/
|
|
1935
|
+
interface ThemeShareInput {
|
|
1936
|
+
/** Recipient ~handle. */
|
|
1937
|
+
to: string;
|
|
1938
|
+
/** Pack source the recipient should resolve. Same shape as ThemeLockEntry.source. */
|
|
1939
|
+
source: string;
|
|
1940
|
+
/** Expected pack_id for verification. Sharer asserts they have verified this. */
|
|
1941
|
+
pack_id: string;
|
|
1942
|
+
/** Expected signer ~handle. Sharer asserts the signature checks against this signer. */
|
|
1943
|
+
signer: string;
|
|
1944
|
+
/** Optional one-line note shown to the recipient on receipt. ≤ 280 chars. */
|
|
1945
|
+
note?: string;
|
|
1946
|
+
}
|
|
1947
|
+
/** Output of the `theme_share` MCP tool. */
|
|
1948
|
+
interface ThemeShareOutput {
|
|
1949
|
+
ok: boolean;
|
|
1950
|
+
share_id?: string;
|
|
1951
|
+
error?: {
|
|
1952
|
+
code: string;
|
|
1953
|
+
message: string;
|
|
1954
|
+
};
|
|
1955
|
+
}
|
|
1956
|
+
/** v1 schema constants. Mirror the spec at docs/technical/alter-theme-pack-spec-v1.md. */
|
|
1957
|
+
declare const THEME_LIMITS: {
|
|
1958
|
+
readonly meta_name_pattern: RegExp;
|
|
1959
|
+
readonly meta_description_max_chars: 240;
|
|
1960
|
+
readonly opener_library_max_entries: 32;
|
|
1961
|
+
readonly opener_entry_max_chars: 240;
|
|
1962
|
+
readonly share_note_max_chars: 280;
|
|
1963
|
+
};
|
|
1964
|
+
/** Allowed OSC-8 hyperlink schemes. Mirrors §6.2 of the spec. */
|
|
1965
|
+
declare const OSC8_ALLOWED_SCHEMES: readonly ["https:", "mailto:"];
|
|
1966
|
+
type Osc8AllowedScheme = (typeof OSC8_ALLOWED_SCHEMES)[number];
|
|
1967
|
+
|
|
1604
1968
|
/**
|
|
1605
1969
|
* Package metadata — kept in a standalone module so deep imports from
|
|
1606
1970
|
* `src/wire/` can reference version constants without creating a
|
|
@@ -1609,4 +1973,4 @@ declare function unwire(): UnwireReport;
|
|
|
1609
1973
|
declare const SDK_NAME = "@truealter/sdk";
|
|
1610
1974
|
declare const SDK_VERSION = "0.3.0";
|
|
1611
1975
|
|
|
1612
|
-
export { ALL_CLIENTS, AlterAuthError, AlterClient, type AlterClientOptions, AlterDiscoveryError, AlterError, type AlterErrorCode, AlterInvalidResponse, AlterNetworkError, AlterPaymentRequired, AlterProvenanceError, AlterRateLimited, type AlterResolveHandleInput, type AlterResolveHandleOutput, AlterTimeoutError, AlterToolError, type ApiKeyConfig, type Archetype, type AssessTraitsInput, type AssessTraitsOutput, type BeginGoldenThreadInput, type BeginGoldenThreadOutput, CLAUDE_CODE, CLAUDE_DESKTOP, CURSOR, type CheckAssessmentStatusInput, type CheckAssessmentStatusOutput, type CheckGoldenThreadInput, type CheckGoldenThreadOutput, type ClaudeDesktopConfig, type ClaudeDesktopServerConfig, type ClientId, type ClientPaths, type CompleteKnotInput, type CompleteKnotOutput, type ComputeBelongingInput, type ComputeBelongingOutput, DEFAULT_DOMAIN, DEFAULT_ENDPOINT, DEFAULT_VERIFY_AT_ALLOWLIST, type DiscoveryOptions, type DiscoveryResult, type Ed25519Keypair, type EngagementLevel, FREE_TOOL_NAMES, type GenerateClaudeDesktopOptions, type GenerateMatchNarrativeInput, type GenerateMatchNarrativeOutput, type GetAgentPortfolioInput, type GetAgentPortfolioOutput, type GetAgentTrustTierInput, type GetAgentTrustTierOutput, type GetCompetenciesInput, type GetCompetenciesOutput, type GetEarningSummaryInput, type GetEarningSummaryOutput, type GetEngagementLevelInput, type GetEngagementLevelOutput, type GetFullTraitVectorInput, type GetFullTraitVectorOutput, type GetIdentityEarningsInput, type GetIdentityEarningsOutput, type GetIdentityTrustScoreInput, type GetIdentityTrustScoreOutput, type GetMatchRecommendationsInput, type GetMatchRecommendationsOutput, type GetNetworkStatsInput, type GetNetworkStatsOutput, type GetPrivacyBudgetInput, type GetPrivacyBudgetOutput, type GetProfileInput, type GetProfileOutput, type GetSideQuestGraphInput, type GetSideQuestGraphOutput, type GetTraitSnapshotInput, type GetTraitSnapshotOutput, type GoldenThreadStatusInput, type GoldenThreadStatusOutput, type HelloAgentInput, type HelloAgentOutput, type InitiateAssessmentInput, type InitiateAssessmentOutput, type InvocationClaims, type JsonWebKey, type JwksDocument, type ListArchetypesInput, type ListArchetypesOutput, type MCPCallOptions, type MCPCallToolResult, MCPClient, type MCPClientInfo, type MCPClientOptions, type MCPContentBlock, type MCPListToolsResult, type MCPMeta, type MCPResponse, type MCPSigningOptions, type MCPToolDefinition, MCP_PROTOCOL_VERSION, type MatchTier, type McpServerConfig, PREMIUM_TOOL_NAMES, type PaymentEnvelope, type ProbeResult, type ProvenanceEnvelope, type ProvenancePayload, type ProvenanceToken, type ProvenanceVerification, type QueryGraphSimilarityInput, type QueryGraphSimilarityOutput, type QueryMatchesInput, type QueryMatchesOutput, type RecommendToolInput, type RecommendToolOutput, SDK_NAME, SDK_VERSION, type SearchIdentitiesInput, type SearchIdentitiesOutput, type SignInvocationOptions, type SignedToolDefinition, TOOL_BLAST_RADIUS, TOOL_COSTS, TOOL_TIERS, type ThreadCensusInput, type ThreadCensusOutput, type ToolInputs, type ToolName, type ToolOutputs, type ToolSignatureMap, type UnwireReport, VSCODE, type VerifyIdentityInput, type VerifyIdentityOutput, type VerifyProvenanceOptions, type WireOptions, type WireReport, type WireState, type WireTarget, type WireTargetCli, type WireTargetFile, X402Client, type X402ClientOptions, type X402Settlement, type X402Signer, base64urlDecode, base64urlEncode, canonicalArgsSha256, canonicalStringify, clearDiscoveryCache, decodeDid, detectSyncedVolume, discover, encodeDid, fetchPublicKeys, generateClaudeConfig, generateClaudeDesktopConfig, generateCursorConfig, generateGenericMcpConfig, generateKeypair, keypairFromPrivateKey, loadPrivateKey, parsePaymentHeader, probeAll, probeByDir, probeClaudeCode, readWireState, resolveVerifyAt, sha256, sign, signInvocation, unwire, verify, verifyProvenance, verifyToolSignatures, wire, writeWireState };
|
|
1976
|
+
export { ALL_CLIENTS, AlterAuthError, AlterClient, type AlterClientOptions, AlterDiscoveryError, AlterError, type AlterErrorCode, AlterInvalidResponse, AlterNetworkError, AlterPaymentRequired, AlterProvenanceError, AlterRateLimited, type AlterResolveHandleInput, type AlterResolveHandleOutput, AlterTimeoutError, AlterToolError, type ApiKeyConfig, type Archetype, type AssessTraitsInput, type AssessTraitsOutput, type BeginGoldenThreadInput, type BeginGoldenThreadOutput, CLAUDE_CODE, CLAUDE_DESKTOP, CURSOR, type CheckAssessmentStatusInput, type CheckAssessmentStatusOutput, type CheckGoldenThreadInput, type CheckGoldenThreadOutput, type ClaudeDesktopConfig, type ClaudeDesktopServerConfig, type ClientId, type ClientPaths, type CompleteKnotInput, type CompleteKnotOutput, type ComputeBelongingInput, type ComputeBelongingOutput, DEFAULT_DOMAIN, DEFAULT_ENDPOINT, DEFAULT_VERIFY_AT_ALLOWLIST, type DiscoveryOptions, type DiscoveryResult, type Ed25519Keypair, type EngagementLevel, FREE_TOOL_NAMES, type GenerateClaudeDesktopOptions, type GenerateMatchNarrativeInput, type GenerateMatchNarrativeOutput, type GetAgentPortfolioInput, type GetAgentPortfolioOutput, type GetAgentTrustTierInput, type GetAgentTrustTierOutput, type GetCompetenciesInput, type GetCompetenciesOutput, type GetEarningSummaryInput, type GetEarningSummaryOutput, type GetEngagementLevelInput, type GetEngagementLevelOutput, type GetFullTraitVectorInput, type GetFullTraitVectorOutput, type GetIdentityEarningsInput, type GetIdentityEarningsOutput, type GetIdentityTrustScoreInput, type GetIdentityTrustScoreOutput, type GetMatchRecommendationsInput, type GetMatchRecommendationsOutput, type GetNetworkStatsInput, type GetNetworkStatsOutput, type GetPrivacyBudgetInput, type GetPrivacyBudgetOutput, type GetProfileInput, type GetProfileOutput, type GetSideQuestGraphInput, type GetSideQuestGraphOutput, type GetTraitSnapshotInput, type GetTraitSnapshotOutput, type GoldenThreadStatusInput, type GoldenThreadStatusOutput, type GreetingRegister, HOMEPAGE_LIMITS, type HelloAgentInput, type HelloAgentOutput, type HomepageCallerVertical, type HomepageField, type HomepageFieldProvenance, type HomepageInput, type HomepageManifest, type HomepageOutput, type InitiateAssessmentInput, type InitiateAssessmentOutput, type InvocationClaims, type JsonWebKey, type JwksDocument, type ListArchetypesInput, type ListArchetypesOutput, type MCPCallOptions, type MCPCallToolResult, MCPClient, type MCPClientInfo, type MCPClientOptions, type MCPContentBlock, type MCPListToolsResult, type MCPMeta, type MCPResponse, type MCPSigningOptions, type MCPToolDefinition, MCP_PROTOCOL_VERSION, type MatchTier, type McpServerConfig, OSC8_ALLOWED_SCHEMES, type Osc8AllowedScheme, PREMIUM_TOOL_NAMES, type PaletteFloorV1, type PaletteText, type PanelDensity, type PaymentEnvelope, type ProbeResult, type ProvenanceEnvelope, type ProvenancePayload, type ProvenanceToken, type ProvenanceVerification, type QueryGraphSimilarityInput, type QueryGraphSimilarityOutput, type QueryMatchesInput, type QueryMatchesOutput, type RecommendToolInput, type RecommendToolOutput, SDK_NAME, SDK_VERSION, type SearchIdentitiesInput, type SearchIdentitiesOutput, type SignInvocationOptions, type SignedToolDefinition, type StatusLineDensity, type StatusLineSlot, THEME_LIMITS, TOOL_BLAST_RADIUS, TOOL_COSTS, TOOL_TIERS, type ThemeAssets, type ThemeLockEntry, type ThemeManifestV1, type ThemeMeta, type ThemeOpener, type ThemePalette, type ThemeRenderHints, type ThemeShareInput, type ThemeShareOutput, type ThemeSigil, type ThemeSignatureManifest, type ThemeStatusLine, type ThemesLockV1, type ThreadCensusInput, type ThreadCensusOutput, type ToolInputs, type ToolName, type ToolOutputs, type ToolSignatureMap, type UnwireReport, VSCODE, type VerifyIdentityInput, type VerifyIdentityOutput, type VerifyProvenanceOptions, type WireOptions, type WireReport, type WireState, type WireTarget, type WireTargetCli, type WireTargetFile, X402Client, type X402ClientOptions, type X402Settlement, type X402Signer, base64urlDecode, base64urlEncode, canonicalArgsSha256, canonicalStringify, clearDiscoveryCache, decodeDid, detectSyncedVolume, discover, encodeDid, fetchPublicKeys, generateClaudeConfig, generateClaudeDesktopConfig, generateCursorConfig, generateGenericMcpConfig, generateKeypair, keypairFromPrivateKey, loadPrivateKey, parsePaymentHeader, probeAll, probeByDir, probeClaudeCode, readWireState, resolveVerifyAt, sha256, sign, signInvocation, unwire, verify, verifyProvenance, verifyToolSignatures, wire, writeWireState };
|