@ternent/core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.changeset/README.md +8 -0
- package/.changeset/config.json +17 -0
- package/.github/workflows/deploy-armour.yml +42 -0
- package/.github/workflows/deploy-identity.yml +42 -0
- package/.github/workflows/deploy-seal.yml +42 -0
- package/.github/workflows/deploy-ui.yml +42 -0
- package/.github/workflows/deploy-utils.yml +42 -0
- package/.github/workflows/release-create.yml +59 -0
- package/.github/workflows/release-publish.yml +54 -0
- package/.nvmrc +1 -0
- package/.ops/publish.mjs +31 -0
- package/package.json +16 -0
- package/packages/README.md +0 -0
- package/packages/armour/CHANGELOG.md +66 -0
- package/packages/armour/CLAUDE.md +8 -0
- package/packages/armour/README.md +103 -0
- package/packages/armour/SPEC.md +92 -0
- package/packages/armour/package.json +45 -0
- package/packages/armour/src/constants.ts +5 -0
- package/packages/armour/src/deps.d.ts +56 -0
- package/packages/armour/src/errors.ts +172 -0
- package/packages/armour/src/files.ts +73 -0
- package/packages/armour/src/identity.ts +72 -0
- package/packages/armour/src/index.ts +56 -0
- package/packages/armour/src/init.ts +10 -0
- package/packages/armour/src/passphrase.ts +33 -0
- package/packages/armour/src/recipients.ts +73 -0
- package/packages/armour/src/text.ts +68 -0
- package/packages/armour/src/types.ts +93 -0
- package/packages/armour/test/armour.test.ts +270 -0
- package/packages/armour/tsconfig.build.json +12 -0
- package/packages/armour/tsconfig.json +12 -0
- package/packages/armour/vite.config.ts +29 -0
- package/packages/concord/CHANGELOG.md +83 -0
- package/packages/concord/CLAUDE.md +9 -0
- package/packages/concord/README.md +146 -0
- package/packages/concord/SPEC.md +287 -0
- package/packages/concord/package.json +51 -0
- package/packages/concord/src/app.ts +717 -0
- package/packages/concord/src/errors.ts +9 -0
- package/packages/concord/src/index.ts +20 -0
- package/packages/concord/src/types.ts +127 -0
- package/packages/concord/test/concord.test.ts +978 -0
- package/packages/concord/tsconfig.json +12 -0
- package/packages/concord/vite.browser.config.ts +27 -0
- package/packages/concord/vite.config.ts +35 -0
- package/packages/concord/vite.config.ts.timestamp-1774262297922-ffd76e35ea668.mjs +83 -0
- package/packages/identity/CHANGELOG.md +47 -0
- package/packages/identity/README.md +236 -0
- package/packages/identity/package.json +41 -0
- package/packages/identity/src/index.ts +538 -0
- package/packages/identity/test/identity.test.ts +172 -0
- package/packages/identity/tsconfig.build.json +12 -0
- package/packages/identity/vite.config.ts +17 -0
- package/packages/ledger/CHANGELOG.md +69 -0
- package/packages/ledger/CLAUDE.md +9 -0
- package/packages/ledger/SPEC.md +304 -0
- package/packages/ledger/package.json +48 -0
- package/packages/ledger/src/index.ts +2 -0
- package/packages/ledger/src/ledger.ts +1286 -0
- package/packages/ledger/src/seal-cli.d.ts +25 -0
- package/packages/ledger/src/types.ts +294 -0
- package/packages/ledger/test/ledger.test.ts +838 -0
- package/packages/ledger/tsconfig.json +12 -0
- package/packages/ledger/vite.browser.config.ts +27 -0
- package/packages/ledger/vite.config.ts +39 -0
- package/packages/seal/CHANGELOG.md +137 -0
- package/packages/seal/CLAUDE.md +8 -0
- package/packages/seal/README.md +258 -0
- package/packages/seal/bin/seal +6 -0
- package/packages/seal/package.json +59 -0
- package/packages/seal/src/artifact.ts +380 -0
- package/packages/seal/src/cli.ts +372 -0
- package/packages/seal/src/commands/identity.ts +52 -0
- package/packages/seal/src/commands/manifest.ts +71 -0
- package/packages/seal/src/commands/publicKey.ts +7 -0
- package/packages/seal/src/commands/sign.ts +56 -0
- package/packages/seal/src/commands/verify.ts +54 -0
- package/packages/seal/src/crypto.ts +85 -0
- package/packages/seal/src/errors.ts +88 -0
- package/packages/seal/src/index.ts +5 -0
- package/packages/seal/src/manifest.ts +114 -0
- package/packages/seal/src/node.ts +18 -0
- package/packages/seal/src/proof.ts +344 -0
- package/packages/seal/test/artifact.test.ts +86 -0
- package/packages/seal/test/cli.test.ts +208 -0
- package/packages/seal/test/crypto.test.ts +21 -0
- package/packages/seal/test/manifest.test.ts +32 -0
- package/packages/seal/test/proof.test.ts +60 -0
- package/packages/seal/tsconfig.json +12 -0
- package/packages/seal/vite.config.ts +54 -0
- package/packages/ui/CHANGELOG.md +393 -0
- package/packages/ui/README.md +57 -0
- package/packages/ui/jsconfig.json +19 -0
- package/packages/ui/package.json +64 -0
- package/packages/ui/scripts/check-tokens.js +56 -0
- package/packages/ui/scripts/generate-theme-css.mjs +85 -0
- package/packages/ui/src/design-system/base.css +8 -0
- package/packages/ui/src/design-system/docs/ACCESSIBILITY_RULES.md +186 -0
- package/packages/ui/src/design-system/docs/AI_SYSTEM.md +281 -0
- package/packages/ui/src/design-system/docs/PATTERN_RULES.md +83 -0
- package/packages/ui/src/design-system/docs/PRIMITIVE_RULES.md +258 -0
- package/packages/ui/src/design-system/docs/TOKEN_RULES.md +235 -0
- package/packages/ui/src/design-system/docs/VISUAL_DIRECTION.md +68 -0
- package/packages/ui/src/design-system/foundation.js +420 -0
- package/packages/ui/src/design-system/tokens.css +140 -0
- package/packages/ui/src/design-system/tokens.js +327 -0
- package/packages/ui/src/design-system/utils.js +246 -0
- package/packages/ui/src/main.js +4 -0
- package/packages/ui/src/patterns/FeatureCard/FeatureCard.spec.md +24 -0
- package/packages/ui/src/patterns/FeatureCard/FeatureCard.types.ts +8 -0
- package/packages/ui/src/patterns/FeatureCard/FeatureCard.vue +175 -0
- package/packages/ui/src/patterns/FormField/FormField.spec.md +65 -0
- package/packages/ui/src/patterns/FormField/FormField.types.ts +11 -0
- package/packages/ui/src/patterns/FormField/FormField.vue +87 -0
- package/packages/ui/src/patterns/IdentityGlyph/IdentityGlyph.vue +61 -0
- package/packages/ui/src/patterns/IdentityGlyph/IdentityHandle.vue +58 -0
- package/packages/ui/src/patterns/IdentityGlyph/identityGlyph.types.ts +36 -0
- package/packages/ui/src/patterns/IdentityGlyph/identityGlyph.utils.ts +585 -0
- package/packages/ui/src/patterns/IdentityGlyph/index.ts +5 -0
- package/packages/ui/src/patterns/KeyValueList/KeyValueList.spec.md +28 -0
- package/packages/ui/src/patterns/KeyValueList/KeyValueList.types.ts +16 -0
- package/packages/ui/src/patterns/KeyValueList/KeyValueList.vue +50 -0
- package/packages/ui/src/patterns/LandingPage/LandingIcon.vue +90 -0
- package/packages/ui/src/patterns/LandingPage/LandingPage.spec.md +24 -0
- package/packages/ui/src/patterns/LandingPage/LandingPage.types.ts +212 -0
- package/packages/ui/src/patterns/LandingPage/LandingPage.vue +599 -0
- package/packages/ui/src/patterns/ListWorkspaceLayout/ListWorkspaceLayout.test.ts +33 -0
- package/packages/ui/src/patterns/ListWorkspaceLayout/ListWorkspaceLayout.vue +44 -0
- package/packages/ui/src/patterns/Logo/Logo.spec.md +22 -0
- package/packages/ui/src/patterns/Logo/Logo.vue +160 -0
- package/packages/ui/src/patterns/PageSurface/PageSurface.spec.md +15 -0
- package/packages/ui/src/patterns/PageSurface/PageSurface.vue +85 -0
- package/packages/ui/src/patterns/PanelChrome/PanelChrome.spec.md +39 -0
- package/packages/ui/src/patterns/PanelChrome/PanelChrome.types.ts +1 -0
- package/packages/ui/src/patterns/PanelChrome/PanelChrome.vue +187 -0
- package/packages/ui/src/patterns/PreviewPanel/PreviewPanel.spec.md +31 -0
- package/packages/ui/src/patterns/PreviewPanel/PreviewPanel.types.ts +23 -0
- package/packages/ui/src/patterns/PreviewPanel/PreviewPanel.vue +354 -0
- package/packages/ui/src/patterns/RecordList/RecordList.spec.md +35 -0
- package/packages/ui/src/patterns/RecordList/RecordList.test.ts +42 -0
- package/packages/ui/src/patterns/RecordList/RecordList.types.ts +9 -0
- package/packages/ui/src/patterns/RecordList/RecordList.utils.ts +5 -0
- package/packages/ui/src/patterns/RecordList/RecordList.vue +134 -0
- package/packages/ui/src/patterns/SectionClarifier/SectionClarifier.vue +85 -0
- package/packages/ui/src/patterns/SectionIntro/SectionIntro.spec.md +25 -0
- package/packages/ui/src/patterns/SectionIntro/SectionIntro.types.ts +7 -0
- package/packages/ui/src/patterns/SectionIntro/SectionIntro.vue +141 -0
- package/packages/ui/src/patterns/SidebarNav/SidebarNav.spec.md +34 -0
- package/packages/ui/src/patterns/SidebarNav/SidebarNav.types.ts +17 -0
- package/packages/ui/src/patterns/SidebarNav/SidebarNav.vue +110 -0
- package/packages/ui/src/patterns/SplitView/SplitView.spec.md +28 -0
- package/packages/ui/src/patterns/SplitView/SplitView.test.ts +22 -0
- package/packages/ui/src/patterns/SplitView/SplitView.types.ts +3 -0
- package/packages/ui/src/patterns/SplitView/SplitView.utils.ts +13 -0
- package/packages/ui/src/patterns/SplitView/SplitView.vue +39 -0
- package/packages/ui/src/patterns/StepList/StepList.spec.md +15 -0
- package/packages/ui/src/patterns/StepList/StepList.types.ts +4 -0
- package/packages/ui/src/patterns/StepList/StepList.vue +91 -0
- package/packages/ui/src/patterns/Verification/VerificationBadge.vue +97 -0
- package/packages/ui/src/patterns/Verification/VerificationComponents.test.ts +153 -0
- package/packages/ui/src/patterns/Verification/VerificationDetailsPanel.vue +270 -0
- package/packages/ui/src/patterns/Verification/VerificationSummary.vue +171 -0
- package/packages/ui/src/patterns/Verification/index.ts +6 -0
- package/packages/ui/src/patterns/Verification/verification.types.ts +8 -0
- package/packages/ui/src/patterns/Verification/verification.utils.test.ts +37 -0
- package/packages/ui/src/patterns/Verification/verification.utils.ts +75 -0
- package/packages/ui/src/patterns/index.ts +25 -0
- package/packages/ui/src/primitives/Accordian/Accordian.vue +11 -0
- package/packages/ui/src/primitives/Accordian/AccordianItem.vue +14 -0
- package/packages/ui/src/primitives/Accordion/Accordion.props.ts +21 -0
- package/packages/ui/src/primitives/Accordion/Accordion.spec.md +50 -0
- package/packages/ui/src/primitives/Accordion/Accordion.types.ts +4 -0
- package/packages/ui/src/primitives/Accordion/Accordion.variants.ts +12 -0
- package/packages/ui/src/primitives/Accordion/Accordion.vue +71 -0
- package/packages/ui/src/primitives/Accordion/AccordionItem.props.ts +14 -0
- package/packages/ui/src/primitives/Accordion/AccordionItem.vue +40 -0
- package/packages/ui/src/primitives/Badge/Badge.props.ts +17 -0
- package/packages/ui/src/primitives/Badge/Badge.spec.md +17 -0
- package/packages/ui/src/primitives/Badge/Badge.types.ts +15 -0
- package/packages/ui/src/primitives/Badge/Badge.variants.ts +48 -0
- package/packages/ui/src/primitives/Badge/Badge.vue +31 -0
- package/packages/ui/src/primitives/Button/Button.props.ts +29 -0
- package/packages/ui/src/primitives/Button/Button.spec.md +139 -0
- package/packages/ui/src/primitives/Button/Button.types.ts +19 -0
- package/packages/ui/src/primitives/Button/Button.variants.ts +72 -0
- package/packages/ui/src/primitives/Button/Button.vue +90 -0
- package/packages/ui/src/primitives/Card/Card.props.ts +17 -0
- package/packages/ui/src/primitives/Card/Card.spec.md +29 -0
- package/packages/ui/src/primitives/Card/Card.types.ts +12 -0
- package/packages/ui/src/primitives/Card/Card.variants.ts +27 -0
- package/packages/ui/src/primitives/Card/Card.vue +37 -0
- package/packages/ui/src/primitives/Checkbox/Checkbox.props.ts +21 -0
- package/packages/ui/src/primitives/Checkbox/Checkbox.spec.md +51 -0
- package/packages/ui/src/primitives/Checkbox/Checkbox.types.ts +4 -0
- package/packages/ui/src/primitives/Checkbox/Checkbox.variants.ts +34 -0
- package/packages/ui/src/primitives/Checkbox/Checkbox.vue +92 -0
- package/packages/ui/src/primitives/Dialog/Dialog.props.ts +29 -0
- package/packages/ui/src/primitives/Dialog/Dialog.spec.md +52 -0
- package/packages/ui/src/primitives/Dialog/Dialog.types.ts +3 -0
- package/packages/ui/src/primitives/Dialog/Dialog.variants.ts +27 -0
- package/packages/ui/src/primitives/Dialog/Dialog.vue +78 -0
- package/packages/ui/src/primitives/Drawer/Drawer.props.ts +33 -0
- package/packages/ui/src/primitives/Drawer/Drawer.spec.md +50 -0
- package/packages/ui/src/primitives/Drawer/Drawer.types.ts +5 -0
- package/packages/ui/src/primitives/Drawer/Drawer.variants.ts +35 -0
- package/packages/ui/src/primitives/Drawer/Drawer.vue +88 -0
- package/packages/ui/src/primitives/FieldMessage/FieldMessage.props.ts +17 -0
- package/packages/ui/src/primitives/FieldMessage/FieldMessage.spec.md +35 -0
- package/packages/ui/src/primitives/FieldMessage/FieldMessage.types.ts +5 -0
- package/packages/ui/src/primitives/FieldMessage/FieldMessage.variants.ts +14 -0
- package/packages/ui/src/primitives/FieldMessage/FieldMessage.vue +40 -0
- package/packages/ui/src/primitives/FileInput/FileInput.props.ts +41 -0
- package/packages/ui/src/primitives/FileInput/FileInput.types.ts +6 -0
- package/packages/ui/src/primitives/FileInput/FileInput.variants.ts +46 -0
- package/packages/ui/src/primitives/FileInput/FileInput.vue +163 -0
- package/packages/ui/src/primitives/Input/Input.props.ts +29 -0
- package/packages/ui/src/primitives/Input/Input.spec.md +79 -0
- package/packages/ui/src/primitives/Input/Input.types.ts +13 -0
- package/packages/ui/src/primitives/Input/Input.variants.ts +54 -0
- package/packages/ui/src/primitives/Input/Input.vue +99 -0
- package/packages/ui/src/primitives/Label/Label.props.ts +25 -0
- package/packages/ui/src/primitives/Label/Label.spec.md +31 -0
- package/packages/ui/src/primitives/Label/Label.types.ts +3 -0
- package/packages/ui/src/primitives/Label/Label.variants.ts +17 -0
- package/packages/ui/src/primitives/Label/Label.vue +38 -0
- package/packages/ui/src/primitives/Menu/Menu.props.ts +17 -0
- package/packages/ui/src/primitives/Menu/Menu.spec.md +38 -0
- package/packages/ui/src/primitives/Menu/Menu.types.ts +10 -0
- package/packages/ui/src/primitives/Menu/Menu.variants.ts +10 -0
- package/packages/ui/src/primitives/Menu/Menu.vue +57 -0
- package/packages/ui/src/primitives/Popover/Popover.props.ts +25 -0
- package/packages/ui/src/primitives/Popover/Popover.spec.md +49 -0
- package/packages/ui/src/primitives/Popover/Popover.types.ts +3 -0
- package/packages/ui/src/primitives/Popover/Popover.variants.ts +18 -0
- package/packages/ui/src/primitives/Popover/Popover.vue +74 -0
- package/packages/ui/src/primitives/RadioGroup/RadioGroup.props.ts +29 -0
- package/packages/ui/src/primitives/RadioGroup/RadioGroup.spec.md +50 -0
- package/packages/ui/src/primitives/RadioGroup/RadioGroup.types.ts +12 -0
- package/packages/ui/src/primitives/RadioGroup/RadioGroup.variants.ts +48 -0
- package/packages/ui/src/primitives/RadioGroup/RadioGroup.vue +87 -0
- package/packages/ui/src/primitives/Separator/Separator.props.ts +9 -0
- package/packages/ui/src/primitives/Separator/Separator.spec.md +15 -0
- package/packages/ui/src/primitives/Separator/Separator.types.ts +3 -0
- package/packages/ui/src/primitives/Separator/Separator.variants.ts +8 -0
- package/packages/ui/src/primitives/Separator/Separator.vue +23 -0
- package/packages/ui/src/primitives/Skeleton/Skeleton.props.ts +21 -0
- package/packages/ui/src/primitives/Skeleton/Skeleton.spec.md +18 -0
- package/packages/ui/src/primitives/Skeleton/Skeleton.types.ts +5 -0
- package/packages/ui/src/primitives/Skeleton/Skeleton.variants.ts +18 -0
- package/packages/ui/src/primitives/Skeleton/Skeleton.vue +37 -0
- package/packages/ui/src/primitives/Spinner/Spinner.props.ts +13 -0
- package/packages/ui/src/primitives/Spinner/Spinner.spec.md +16 -0
- package/packages/ui/src/primitives/Spinner/Spinner.types.ts +5 -0
- package/packages/ui/src/primitives/Spinner/Spinner.variants.ts +15 -0
- package/packages/ui/src/primitives/Spinner/Spinner.vue +33 -0
- package/packages/ui/src/primitives/SplitButton/SplitButton.vue +108 -0
- package/packages/ui/src/primitives/Switch/Switch.props.ts +21 -0
- package/packages/ui/src/primitives/Switch/Switch.spec.md +49 -0
- package/packages/ui/src/primitives/Switch/Switch.types.ts +3 -0
- package/packages/ui/src/primitives/Switch/Switch.variants.ts +34 -0
- package/packages/ui/src/primitives/Switch/Switch.vue +71 -0
- package/packages/ui/src/primitives/Tabs/Tabs.props.ts +25 -0
- package/packages/ui/src/primitives/Tabs/Tabs.spec.md +48 -0
- package/packages/ui/src/primitives/Tabs/Tabs.types.ts +11 -0
- package/packages/ui/src/primitives/Tabs/Tabs.variants.ts +28 -0
- package/packages/ui/src/primitives/Tabs/Tabs.vue +59 -0
- package/packages/ui/src/primitives/Textarea/Textarea.props.ts +33 -0
- package/packages/ui/src/primitives/Textarea/Textarea.spec.md +59 -0
- package/packages/ui/src/primitives/Textarea/Textarea.types.ts +5 -0
- package/packages/ui/src/primitives/Textarea/Textarea.variants.ts +27 -0
- package/packages/ui/src/primitives/Textarea/Textarea.vue +74 -0
- package/packages/ui/src/primitives/Tooltip/Tooltip.props.ts +21 -0
- package/packages/ui/src/primitives/Tooltip/Tooltip.spec.md +45 -0
- package/packages/ui/src/primitives/Tooltip/Tooltip.types.ts +3 -0
- package/packages/ui/src/primitives/Tooltip/Tooltip.variants.ts +4 -0
- package/packages/ui/src/primitives/Tooltip/Tooltip.vue +31 -0
- package/packages/ui/src/primitives/TreeView/TreeView.types.ts +10 -0
- package/packages/ui/src/primitives/TreeView/TreeView.vue +113 -0
- package/packages/ui/src/primitives/TreeView/TreeViewNode.vue +190 -0
- package/packages/ui/src/primitives/index.ts +29 -0
- package/packages/ui/src/style.css +7 -0
- package/packages/ui/src/style.js +1 -0
- package/packages/ui/src/themes/armour.css +147 -0
- package/packages/ui/src/themes/aurora.css +147 -0
- package/packages/ui/src/themes/citrine-ash.css +147 -0
- package/packages/ui/src/themes/concord.css +147 -0
- package/packages/ui/src/themes/garnet-honey.css +147 -0
- package/packages/ui/src/themes/harbor-rose.css +147 -0
- package/packages/ui/src/themes/ledger.css +147 -0
- package/packages/ui/src/themes/neon-noir.css +74 -0
- package/packages/ui/src/themes/obsidian-iris.css +147 -0
- package/packages/ui/src/themes/pixpax.css +147 -0
- package/packages/ui/src/themes/print.css +147 -0
- package/packages/ui/src/themes/prism.css +147 -0
- package/packages/ui/src/themes/proof.css +145 -0
- package/packages/ui/src/themes/semanticThemeContract.js +2256 -0
- package/packages/ui/src/themes/spruce-ink.css +147 -0
- package/packages/ui/src/themes/sunset.css +147 -0
- package/packages/ui/tailwind.config.js +64 -0
- package/packages/ui/vite.config.js +35 -0
- package/packages/ui/vite.config.js.timestamp-1780697224943-89fbc929987bc.mjs +38 -0
- package/packages/utils/CHANGELOG.md +111 -0
- package/packages/utils/README.md +3 -0
- package/packages/utils/package.json +46 -0
- package/packages/utils/src/index.test.js +39 -0
- package/packages/utils/src/index.ts +289 -0
- package/packages/utils/tsconfig.build.json +12 -0
- package/packages/utils/vite.config.js +28 -0
- package/pnpm-workspace.yaml +8 -0
- package/scripts/vite/package-lib-config.ts +59 -0
- package/tsconfig.json +24 -0
- package/tsconfig.node.json +9 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Changesets
|
|
2
|
+
|
|
3
|
+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
|
|
4
|
+
with multi-package repos, or single-package repos to help you version and publish your code. You can
|
|
5
|
+
find the full documentation for it [in our repository](https://github.com/changesets/changesets).
|
|
6
|
+
|
|
7
|
+
We have a quick list of common questions to get you started engaging with this project in
|
|
8
|
+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
|
|
3
|
+
"changelog": [
|
|
4
|
+
"@changesets/changelog-github",
|
|
5
|
+
{
|
|
6
|
+
"repo": "ternent/core"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"commit": true,
|
|
10
|
+
"commitMessage": "${type}(${scope}): ${description}",
|
|
11
|
+
"fixed": [],
|
|
12
|
+
"linked": [],
|
|
13
|
+
"access": "restricted",
|
|
14
|
+
"baseBranch": "main",
|
|
15
|
+
"updateInternalDependencies": "patch",
|
|
16
|
+
"ignore": []
|
|
17
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Deploy Armour Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "@ternent/armour-*.*.*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish:
|
|
14
|
+
name: Publish @ternent/armour
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout repo
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Setup pnpm
|
|
22
|
+
uses: pnpm/action-setup@v4
|
|
23
|
+
with:
|
|
24
|
+
version: 10
|
|
25
|
+
|
|
26
|
+
- name: Setup Node
|
|
27
|
+
uses: actions/setup-node@v4
|
|
28
|
+
with:
|
|
29
|
+
node-version-file: ".nvmrc"
|
|
30
|
+
cache: "pnpm"
|
|
31
|
+
|
|
32
|
+
- name: Upgrade npm
|
|
33
|
+
run: npm install -g npm@latest
|
|
34
|
+
|
|
35
|
+
- name: Install dependencies
|
|
36
|
+
run: pnpm install --frozen-lockfile
|
|
37
|
+
|
|
38
|
+
- name: Build @ternent/armour
|
|
39
|
+
run: pnpm --filter @ternent/armour build
|
|
40
|
+
|
|
41
|
+
- name: Publish @ternent/armour
|
|
42
|
+
run: pnpm --filter @ternent/armour publish --no-git-checks --access public --provenance
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Deploy Identity Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "@ternent/identity-*.*.*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish:
|
|
14
|
+
name: Publish @ternent/identity
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout repo
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Setup pnpm
|
|
22
|
+
uses: pnpm/action-setup@v4
|
|
23
|
+
with:
|
|
24
|
+
version: 10
|
|
25
|
+
|
|
26
|
+
- name: Setup Node
|
|
27
|
+
uses: actions/setup-node@v4
|
|
28
|
+
with:
|
|
29
|
+
node-version-file: ".nvmrc"
|
|
30
|
+
cache: "pnpm"
|
|
31
|
+
|
|
32
|
+
- name: Upgrade npm
|
|
33
|
+
run: npm install -g npm@latest
|
|
34
|
+
|
|
35
|
+
- name: Install dependencies
|
|
36
|
+
run: pnpm install --frozen-lockfile
|
|
37
|
+
|
|
38
|
+
- name: Build @ternent/identity
|
|
39
|
+
run: pnpm --filter @ternent/identity build
|
|
40
|
+
|
|
41
|
+
- name: Publish @ternent/identity
|
|
42
|
+
run: pnpm --filter @ternent/identity publish --no-git-checks --access public --provenance
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Deploy Seal Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "@ternent/seal-*.*.*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish:
|
|
14
|
+
name: Publish @ternent/seal
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout repo
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Setup pnpm
|
|
22
|
+
uses: pnpm/action-setup@v4
|
|
23
|
+
with:
|
|
24
|
+
version: 10
|
|
25
|
+
|
|
26
|
+
- name: Setup Node
|
|
27
|
+
uses: actions/setup-node@v4
|
|
28
|
+
with:
|
|
29
|
+
node-version-file: ".nvmrc"
|
|
30
|
+
cache: "pnpm"
|
|
31
|
+
|
|
32
|
+
- name: Upgrade npm
|
|
33
|
+
run: npm install -g npm@latest
|
|
34
|
+
|
|
35
|
+
- name: Install dependencies
|
|
36
|
+
run: pnpm install --frozen-lockfile
|
|
37
|
+
|
|
38
|
+
- name: Build @ternent/seal
|
|
39
|
+
run: pnpm --filter @ternent/utils --filter @ternent/identity --filter @ternent/armour --filter @ternent/seal build
|
|
40
|
+
|
|
41
|
+
- name: Publish @ternent/seal
|
|
42
|
+
run: pnpm --filter @ternent/seal publish --no-git-checks --access public --provenance
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Deploy UI Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "@ternent/ui-*.*.*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish:
|
|
14
|
+
name: Publish @ternent/ui
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout repo
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Setup pnpm
|
|
22
|
+
uses: pnpm/action-setup@v4
|
|
23
|
+
with:
|
|
24
|
+
version: 10
|
|
25
|
+
|
|
26
|
+
- name: Setup Node
|
|
27
|
+
uses: actions/setup-node@v4
|
|
28
|
+
with:
|
|
29
|
+
node-version-file: ".nvmrc"
|
|
30
|
+
cache: "pnpm"
|
|
31
|
+
|
|
32
|
+
- name: Upgrade npm
|
|
33
|
+
run: npm install -g npm@latest
|
|
34
|
+
|
|
35
|
+
- name: Install dependencies
|
|
36
|
+
run: pnpm install --frozen-lockfile
|
|
37
|
+
|
|
38
|
+
- name: Build @ternent/ui
|
|
39
|
+
run: pnpm --filter @ternent/ui build
|
|
40
|
+
|
|
41
|
+
- name: Publish @ternent/ui
|
|
42
|
+
run: pnpm --filter @ternent/ui publish --no-git-checks --access public --provenance
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Deploy Utils Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "@ternent/utils-*.*.*"
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
id-token: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
publish:
|
|
14
|
+
name: Publish @ternent/utils
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout repo
|
|
19
|
+
uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Setup pnpm
|
|
22
|
+
uses: pnpm/action-setup@v4
|
|
23
|
+
with:
|
|
24
|
+
version: 10
|
|
25
|
+
|
|
26
|
+
- name: Setup Node
|
|
27
|
+
uses: actions/setup-node@v4
|
|
28
|
+
with:
|
|
29
|
+
node-version-file: ".nvmrc"
|
|
30
|
+
cache: "pnpm"
|
|
31
|
+
|
|
32
|
+
- name: Upgrade npm
|
|
33
|
+
run: npm install -g npm@latest
|
|
34
|
+
|
|
35
|
+
- name: Install dependencies
|
|
36
|
+
run: pnpm install --frozen-lockfile
|
|
37
|
+
|
|
38
|
+
- name: Build @ternent/utils
|
|
39
|
+
run: pnpm --filter @ternent/utils build
|
|
40
|
+
|
|
41
|
+
- name: Publish @ternent/utils
|
|
42
|
+
run: pnpm --filter @ternent/utils publish --no-git-checks --access public --provenance
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: Create Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
PNPM_CACHE_PATH: ~/.pnpm-store
|
|
10
|
+
PNPM_CACHE_NAME: pnpm-store-cache
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: write
|
|
14
|
+
pull-requests: write
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
release:
|
|
18
|
+
name: Deploy
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout repo
|
|
23
|
+
uses: actions/checkout@master
|
|
24
|
+
with:
|
|
25
|
+
fetch-depth: 0
|
|
26
|
+
persist-credentials: false
|
|
27
|
+
|
|
28
|
+
- name: Get branch name
|
|
29
|
+
id: branch
|
|
30
|
+
run: |
|
|
31
|
+
echo "branch_name=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
|
|
32
|
+
|
|
33
|
+
- name: Get node version
|
|
34
|
+
id: nvmrc
|
|
35
|
+
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
|
|
36
|
+
|
|
37
|
+
- name: Setup PNPM
|
|
38
|
+
uses: pnpm/action-setup@v2
|
|
39
|
+
with:
|
|
40
|
+
version: 10
|
|
41
|
+
|
|
42
|
+
- name: Setup Node
|
|
43
|
+
uses: actions/setup-node@v3
|
|
44
|
+
with:
|
|
45
|
+
always-auth: true
|
|
46
|
+
node-version-file: ".nvmrc"
|
|
47
|
+
registry-url: https://registry.npmjs.org
|
|
48
|
+
cache: "pnpm"
|
|
49
|
+
|
|
50
|
+
- name: Install dependencies
|
|
51
|
+
run: pnpm install --frozen-lockfile
|
|
52
|
+
|
|
53
|
+
- name: Create release pull request
|
|
54
|
+
id: changesets
|
|
55
|
+
uses: changesets/action@v1.4.1
|
|
56
|
+
with:
|
|
57
|
+
title: Release
|
|
58
|
+
env:
|
|
59
|
+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
name: Publish Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
PNPM_CACHE_PATH: ~/.pnpm-store
|
|
10
|
+
PNPM_CACHE_NAME: pnpm-store-cache
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
release:
|
|
14
|
+
if: ${{ contains(github.event.head_commit.message, 'changeset-release/') }}
|
|
15
|
+
name: Deploy
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout repo
|
|
20
|
+
uses: actions/checkout@master
|
|
21
|
+
with:
|
|
22
|
+
fetch-depth: 0
|
|
23
|
+
persist-credentials: false
|
|
24
|
+
|
|
25
|
+
- name: Get branch name
|
|
26
|
+
id: branch
|
|
27
|
+
run: |
|
|
28
|
+
echo "branch_name=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
|
|
29
|
+
|
|
30
|
+
- name: Get node version
|
|
31
|
+
id: nvmrc
|
|
32
|
+
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
|
|
33
|
+
|
|
34
|
+
- name: Setup PNPM
|
|
35
|
+
uses: pnpm/action-setup@v2
|
|
36
|
+
with:
|
|
37
|
+
version: 10
|
|
38
|
+
|
|
39
|
+
- name: Setup Node
|
|
40
|
+
uses: actions/setup-node@v3
|
|
41
|
+
with:
|
|
42
|
+
always-auth: true
|
|
43
|
+
node-version-file: ".nvmrc"
|
|
44
|
+
registry-url: https://registry.npmjs.org
|
|
45
|
+
cache: "pnpm"
|
|
46
|
+
|
|
47
|
+
- name: Install dependencies
|
|
48
|
+
run: pnpm install --frozen-lockfile
|
|
49
|
+
|
|
50
|
+
- name: Publish Release
|
|
51
|
+
run: node .ops/publish.mjs
|
|
52
|
+
shell: bash
|
|
53
|
+
env:
|
|
54
|
+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
23.7.0
|
package/.ops/publish.mjs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import shell from "shelljs";
|
|
2
|
+
|
|
3
|
+
const packagesToPublish = [
|
|
4
|
+
"../packages/armour",
|
|
5
|
+
"../packages/identity",
|
|
6
|
+
"../packages/ui",
|
|
7
|
+
"../packages/utils",
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
let i = 0;
|
|
11
|
+
for (; i < packagesToPublish.length; i++) {
|
|
12
|
+
const { version, name } = (
|
|
13
|
+
await import(`${packagesToPublish[i]}/package.json`, { with: { type: "json" } })
|
|
14
|
+
).default;
|
|
15
|
+
|
|
16
|
+
const fullChangelog = shell
|
|
17
|
+
.exec(
|
|
18
|
+
`gh pr list -B "main" -s merged -H changeset-release/"main" --json body --jq '.[].body' -L 1`,
|
|
19
|
+
{ silent: true },
|
|
20
|
+
)
|
|
21
|
+
.toString();
|
|
22
|
+
|
|
23
|
+
const changelog = fullChangelog?.split(`## ${name}@${version}`)[1]?.split("## ")[1];
|
|
24
|
+
|
|
25
|
+
if (changelog) {
|
|
26
|
+
shell.exec(
|
|
27
|
+
`gh release create "${name}-${version}" -t "${name}-${version}" -n "${name}-${version}" -n "${changelog}"`,
|
|
28
|
+
{ silent: true },
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ternent/core",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"author": "sam@ternent.dev",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build:ui": "pnpm --filter @ternent/ui build",
|
|
7
|
+
"fmt": "oxfmt",
|
|
8
|
+
"fmt:check": "oxfmt --check"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@changesets/changelog-github": "^0.7.0",
|
|
12
|
+
"@changesets/cli": "^2.31.0",
|
|
13
|
+
"oxfmt": "^0.50.0",
|
|
14
|
+
"shelljs": "^0.10.0"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# @ternent/armour
|
|
2
|
+
|
|
3
|
+
## 0.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4c4a1c8`](https://github.com/ternent/core/commit/4c4a1c83f1f8d0ebe354f0589159ba84d60ab8f3) Thanks [@samternent](https://github.com/samternent)! - Adds armour workflow
|
|
8
|
+
|
|
9
|
+
## 0.2.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`e6f7d70`](https://github.com/ternent/core/commit/e6f7d70e7d94bf7d6e6730c228f3f06c250da621) Thanks [@samternent](https://github.com/samternent)! - Publuish armour
|
|
14
|
+
|
|
15
|
+
## 0.2.1
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [`c674665`](https://github.com/ternent/core/commit/c674665919ba0d610b77938c728c75265b343c41) Thanks [@samternent](https://github.com/samternent)! - publish armour
|
|
20
|
+
|
|
21
|
+
## 0.2.0
|
|
22
|
+
|
|
23
|
+
### Minor Changes
|
|
24
|
+
|
|
25
|
+
- [`a73a962`](https://github.com/ternent/core/commit/a73a962540b89985ed5227e3b39742432fbc965e) Thanks [@samternent](https://github.com/samternent)! - Move armour to org
|
|
26
|
+
|
|
27
|
+
- [`89ed4d7`](https://github.com/ternent/core/commit/89ed4d73d016d1d3b7b2905298cf22977b7f26be) Thanks [@samternent](https://github.com/samternent)! - fix package formats
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Updated dependencies [[`89ed4d7`](https://github.com/ternent/core/commit/89ed4d73d016d1d3b7b2905298cf22977b7f26be)]:
|
|
32
|
+
- @ternent/identity@0.5.0
|
|
33
|
+
|
|
34
|
+
## 0.1.5
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- [`cb63d9c1dc91e0cd3924bafd5abcde89cc02992f`](https://github.com/samternent/home/commit/cb63d9c1dc91e0cd3924bafd5abcde89cc02992f) Thanks [@samternent](https://github.com/samternent)! - Fix workflows
|
|
39
|
+
|
|
40
|
+
- Updated dependencies [[`cb63d9c1dc91e0cd3924bafd5abcde89cc02992f`](https://github.com/samternent/home/commit/cb63d9c1dc91e0cd3924bafd5abcde89cc02992f)]:
|
|
41
|
+
- @ternent/identity@0.3.1
|
|
42
|
+
- @ternent/rage@0.1.3
|
|
43
|
+
|
|
44
|
+
## 0.1.4
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- [`acf974919a1176da235e7ec7468c46df8bc13402`](https://github.com/samternent/home/commit/acf974919a1176da235e7ec7468c46df8bc13402) Thanks [@samternent](https://github.com/samternent)! - Update build configs
|
|
49
|
+
|
|
50
|
+
## 0.1.3
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- [`109f8c3989b16a161a34b933dcad68390d9219c5`](https://github.com/samternent/home/commit/109f8c3989b16a161a34b933dcad68390d9219c5) Thanks [@samternent](https://github.com/samternent)! - Fix deps
|
|
55
|
+
|
|
56
|
+
## 0.1.2
|
|
57
|
+
|
|
58
|
+
### Patch Changes
|
|
59
|
+
|
|
60
|
+
- [`db52303d4c626a97abb4e1fd04ee04019404b6fa`](https://github.com/samternent/home/commit/db52303d4c626a97abb4e1fd04ee04019404b6fa) Thanks [@samternent](https://github.com/samternent)! - fix armour tests
|
|
61
|
+
|
|
62
|
+
## 0.1.1
|
|
63
|
+
|
|
64
|
+
### Patch Changes
|
|
65
|
+
|
|
66
|
+
- [`4d5f4e0deddc1a5cc1aed49745f27b0979adfe7e`](https://github.com/samternent/home/commit/4d5f4e0deddc1a5cc1aed49745f27b0979adfe7e) Thanks [@samternent](https://github.com/samternent)! - adds armour package
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
`@ternent/armour` bridges identity-derived keys and rage encryption APIs.
|
|
4
|
+
|
|
5
|
+
- Keep scope narrow: encryption/decryption helpers only.
|
|
6
|
+
- Do not add app/domain policy logic here.
|
|
7
|
+
- Do not mix signing concerns into armour APIs.
|
|
8
|
+
- For Concord apps, prefer ledger-native protected entries first; use armour directly only when runtime-layer artifacts require it.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# `@ternent/armour`
|
|
2
|
+
|
|
3
|
+
`@ternent/armour` is the opinionated bridge between `@ternent/identity` and `@ternent/rage`.
|
|
4
|
+
|
|
5
|
+
It exists to:
|
|
6
|
+
|
|
7
|
+
- derive age-compatible recipients and secret keys from `@ternent/identity`
|
|
8
|
+
- expose explicit recipient-mode and passphrase-mode encryption APIs
|
|
9
|
+
- keep browser-facing helpers async and environment-safe
|
|
10
|
+
|
|
11
|
+
It is not:
|
|
12
|
+
|
|
13
|
+
- a crypto engine
|
|
14
|
+
- a signing library
|
|
15
|
+
- a storage layer
|
|
16
|
+
- a mode-detecting convenience wrapper
|
|
17
|
+
- a transport artifact format
|
|
18
|
+
|
|
19
|
+
`@ternent/rage` owns encryption and decryption.
|
|
20
|
+
`@ternent/identity` owns seed-backed identity parsing and age derivation.
|
|
21
|
+
`@ternent/armour` composes those two layers without inventing new cryptography.
|
|
22
|
+
Portable artifacts and sealed containers belong to `@ternent/seal`.
|
|
23
|
+
|
|
24
|
+
## Initialization
|
|
25
|
+
|
|
26
|
+
All operational APIs are async. Initialize Armour before encrypting or decrypting:
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { initArmour } from "@ternent/armour";
|
|
30
|
+
|
|
31
|
+
await initArmour();
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Identity-based encryption
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import { createIdentity } from "@ternent/identity";
|
|
38
|
+
import { decryptTextWithIdentity, encryptTextForIdentities, initArmour } from "@ternent/armour";
|
|
39
|
+
|
|
40
|
+
await initArmour();
|
|
41
|
+
|
|
42
|
+
const identity = await createIdentity();
|
|
43
|
+
const ciphertext = await encryptTextForIdentities({
|
|
44
|
+
identities: [identity],
|
|
45
|
+
text: "hello world",
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const plaintext = await decryptTextWithIdentity({
|
|
49
|
+
identity,
|
|
50
|
+
data: ciphertext,
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Multi-recipient encryption
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { createIdentity } from "@ternent/identity";
|
|
58
|
+
import { decryptWithIdentity, encryptForIdentities, initArmour } from "@ternent/armour";
|
|
59
|
+
|
|
60
|
+
await initArmour();
|
|
61
|
+
|
|
62
|
+
const alice = await createIdentity();
|
|
63
|
+
const bob = await createIdentity();
|
|
64
|
+
|
|
65
|
+
const ciphertext = await encryptForIdentities({
|
|
66
|
+
identities: [alice, bob],
|
|
67
|
+
data: new TextEncoder().encode("shared secret"),
|
|
68
|
+
output: "binary",
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const plaintext = await decryptWithIdentity({
|
|
72
|
+
identity: bob,
|
|
73
|
+
data: ciphertext,
|
|
74
|
+
});
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Passphrase encryption
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
import { decryptTextWithPassphrase, encryptTextWithPassphrase, initArmour } from "@ternent/armour";
|
|
81
|
+
|
|
82
|
+
await initArmour();
|
|
83
|
+
|
|
84
|
+
const ciphertext = await encryptTextWithPassphrase({
|
|
85
|
+
passphrase: "correct horse battery staple",
|
|
86
|
+
text: "secret",
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const plaintext = await decryptTextWithPassphrase({
|
|
90
|
+
passphrase: "correct horse battery staple",
|
|
91
|
+
data: ciphertext,
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Relationship to the lower layers
|
|
96
|
+
|
|
97
|
+
- `@ternent/identity` defines the identity model and deterministic age derivation
|
|
98
|
+
- `@ternent/rage` performs age-compatible encryption and decryption
|
|
99
|
+
- `@ternent/armour` keeps recipient mode and passphrase mode explicit
|
|
100
|
+
- `@ternent/seal` owns portable artifact formats and signing
|
|
101
|
+
|
|
102
|
+
Encryption is not signing.
|
|
103
|
+
This package does not imply authenticity, signer identity, or origin integrity.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# `@ternent/armour` Specification
|
|
2
|
+
|
|
3
|
+
`@ternent/armour` does not define or export any portable artifact format.
|
|
4
|
+
Transport containers and sealed artifacts belong to `@ternent/seal`.
|
|
5
|
+
|
|
6
|
+
## Overview
|
|
7
|
+
|
|
8
|
+
`@ternent/armour` is the identity-aware encryption bridge above `@ternent/rage`.
|
|
9
|
+
|
|
10
|
+
It is responsible for:
|
|
11
|
+
|
|
12
|
+
- parsing `@ternent/identity` serialized identities
|
|
13
|
+
- deriving age recipient and secret key strings from those identities
|
|
14
|
+
- exposing explicit async encryption APIs for recipient mode and passphrase mode
|
|
15
|
+
- normalizing upstream errors into Armour-specific error classes and codes
|
|
16
|
+
|
|
17
|
+
It is not responsible for:
|
|
18
|
+
|
|
19
|
+
- raw crypto implementation
|
|
20
|
+
- WASM bootstrap internals beyond delegating `initArmour()` to `initRage()`
|
|
21
|
+
- signing
|
|
22
|
+
- identity seed generation
|
|
23
|
+
- mode autodetection
|
|
24
|
+
- transport containers or portable artifact semantics
|
|
25
|
+
|
|
26
|
+
## Public API
|
|
27
|
+
|
|
28
|
+
### Initialization
|
|
29
|
+
|
|
30
|
+
- `initArmour(): Promise<void>`
|
|
31
|
+
|
|
32
|
+
### Identity bridge
|
|
33
|
+
|
|
34
|
+
- `resolveIdentity(input): Promise<SerializedIdentity>`
|
|
35
|
+
- `recipientFromIdentity(input): Promise<string>`
|
|
36
|
+
- `secretKeyFromIdentity(input): Promise<string>`
|
|
37
|
+
|
|
38
|
+
### Recipient mode
|
|
39
|
+
|
|
40
|
+
- `encryptForRecipients({ recipients, data, output? }): Promise<Uint8Array>`
|
|
41
|
+
- `decryptWithSecretKey({ secretKey, data }): Promise<Uint8Array>`
|
|
42
|
+
- `encryptForIdentities({ identities, data, output? }): Promise<Uint8Array>`
|
|
43
|
+
- `decryptWithIdentity({ identity, data }): Promise<Uint8Array>`
|
|
44
|
+
|
|
45
|
+
### Passphrase mode
|
|
46
|
+
|
|
47
|
+
- `encryptWithPassphrase({ passphrase, data, output? }): Promise<Uint8Array>`
|
|
48
|
+
- `decryptWithPassphrase({ passphrase, data }): Promise<Uint8Array>`
|
|
49
|
+
|
|
50
|
+
### Text helpers
|
|
51
|
+
|
|
52
|
+
- `encryptTextForIdentities({ identities, text }): Promise<string>`
|
|
53
|
+
- `decryptTextWithIdentity({ identity, data }): Promise<string>`
|
|
54
|
+
- `encryptTextWithPassphrase({ passphrase, text }): Promise<string>`
|
|
55
|
+
- `decryptTextWithPassphrase({ passphrase, data }): Promise<string>`
|
|
56
|
+
|
|
57
|
+
### Binary helpers
|
|
58
|
+
|
|
59
|
+
- `encryptBinaryForIdentities({ identities, data, output? }): Promise<Uint8Array>`
|
|
60
|
+
- `decryptBinaryWithIdentity({ identity, data }): Promise<Uint8Array>`
|
|
61
|
+
- `encryptBinaryWithPassphrase({ passphrase, data, output? }): Promise<Uint8Array>`
|
|
62
|
+
- `decryptBinaryWithPassphrase({ passphrase, data }): Promise<Uint8Array>`
|
|
63
|
+
|
|
64
|
+
`data` may be a `Uint8Array`, `ArrayBuffer`, `Blob`, or `File` via the `Blob` type path.
|
|
65
|
+
|
|
66
|
+
## Error model
|
|
67
|
+
|
|
68
|
+
Armour normalizes upstream failures to:
|
|
69
|
+
|
|
70
|
+
- `ArmourInitError`
|
|
71
|
+
- `ArmourValidationError`
|
|
72
|
+
- `ArmourIdentityError`
|
|
73
|
+
- `ArmourEncryptionError`
|
|
74
|
+
- `ArmourDecryptionError`
|
|
75
|
+
|
|
76
|
+
Primary public codes:
|
|
77
|
+
|
|
78
|
+
- `ARMOUR_INIT_FAILED`
|
|
79
|
+
- `ARMOUR_INVALID_IDENTITY`
|
|
80
|
+
- `ARMOUR_IDENTITY_DERIVATION_FAILED`
|
|
81
|
+
- `ARMOUR_ENCRYPT_FAILED`
|
|
82
|
+
- `ARMOUR_DECRYPT_FAILED`
|
|
83
|
+
|
|
84
|
+
Additional validation codes may be raised for empty data, invalid recipients, invalid secret keys, empty passphrases, and oversized payloads.
|
|
85
|
+
|
|
86
|
+
## Boundary rules
|
|
87
|
+
|
|
88
|
+
- Encryption and decryption must delegate to `@ternent/rage`
|
|
89
|
+
- Identity derivation must delegate to `@ternent/identity`
|
|
90
|
+
- Signing logic must not exist in this package
|
|
91
|
+
- Recipient mode and passphrase mode must remain separate
|
|
92
|
+
- Portable artifacts and sealed containers belong to `@ternent/seal`
|