@tetsuo-ai/marketplace-react 0.4.1 → 0.6.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.
Files changed (84) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +97 -51
  3. package/dist/chunk-7NKRSPPN.js +227 -0
  4. package/dist/chunk-7NKRSPPN.js.map +1 -0
  5. package/dist/{chunk-JVXGNW3Q.js → chunk-CDDHUFMG.js} +6 -5
  6. package/dist/chunk-CDDHUFMG.js.map +1 -0
  7. package/dist/chunk-FIDFPM5A.cjs +40 -0
  8. package/dist/chunk-FIDFPM5A.cjs.map +1 -0
  9. package/dist/chunk-IJKWKY4H.cjs +1370 -0
  10. package/dist/chunk-IJKWKY4H.cjs.map +1 -0
  11. package/dist/chunk-JTSG5FGC.cjs +397 -0
  12. package/dist/chunk-JTSG5FGC.cjs.map +1 -0
  13. package/dist/chunk-ONC6L3IX.cjs +97 -0
  14. package/dist/chunk-ONC6L3IX.cjs.map +1 -0
  15. package/dist/chunk-R76EUYDI.cjs +233 -0
  16. package/dist/chunk-R76EUYDI.cjs.map +1 -0
  17. package/dist/{chunk-XLA7DARS.js → chunk-RG5JZ6JL.js} +159 -36
  18. package/dist/chunk-RG5JZ6JL.js.map +1 -0
  19. package/dist/components/index.cjs +158 -1594
  20. package/dist/components/index.cjs.map +1 -1
  21. package/dist/components/index.d.cts +2 -2
  22. package/dist/components/index.d.ts +2 -2
  23. package/dist/components/index.js +2 -2
  24. package/dist/hooks/index.cjs +656 -509
  25. package/dist/hooks/index.cjs.map +1 -1
  26. package/dist/hooks/index.d.cts +63 -29
  27. package/dist/hooks/index.d.ts +63 -29
  28. package/dist/hooks/index.js +619 -196
  29. package/dist/hooks/index.js.map +1 -1
  30. package/dist/{index-CmVz0OOm.d.ts → index-BAyr1ODZ.d.ts} +28 -3
  31. package/dist/{index-DAZzhuO4.d.cts → index-C20NVU7_.d.cts} +28 -3
  32. package/dist/index.cjs +284 -1833
  33. package/dist/index.cjs.map +1 -1
  34. package/dist/index.d.cts +7 -8
  35. package/dist/index.d.ts +7 -8
  36. package/dist/index.js +64 -4
  37. package/dist/index.js.map +1 -1
  38. package/dist/signers/index.cjs +22 -161
  39. package/dist/signers/index.cjs.map +1 -1
  40. package/dist/signers/index.d.cts +16 -11
  41. package/dist/signers/index.d.ts +16 -11
  42. package/dist/signers/index.js +1 -1
  43. package/dist/testing/index.d.cts +1 -1
  44. package/dist/testing/index.d.ts +1 -1
  45. package/dist/theme/agenc-tailwind-preset.cjs +134 -108
  46. package/dist/{types-jvISR6bc.d.cts → types-B10rndEI.d.cts} +16 -7
  47. package/dist/{types-jvISR6bc.d.ts → types-B10rndEI.d.ts} +16 -7
  48. package/dist/{useAgentTrackRecord-DPt3SfYz.d.cts → useAgentTrackRecord-Ch7gHTFj.d.cts} +1 -1
  49. package/dist/{useAgentTrackRecord-DPt3SfYz.d.ts → useAgentTrackRecord-Ch7gHTFj.d.ts} +1 -1
  50. package/package.json +7 -4
  51. package/src/components/HireCheckoutModal.tsx +5 -2
  52. package/src/hooks/index.ts +1 -0
  53. package/src/hooks/internal.ts +178 -24
  54. package/src/hooks/useAgentTrackRecord.ts +5 -2
  55. package/src/hooks/useCompletionBond.ts +56 -21
  56. package/src/hooks/useDispute.ts +46 -9
  57. package/src/hooks/useHire.ts +113 -23
  58. package/src/hooks/useHumanlessHireFlow.ts +335 -115
  59. package/src/hooks/useListing.ts +2 -2
  60. package/src/hooks/useListings.ts +2 -2
  61. package/src/hooks/useRateHire.ts +32 -5
  62. package/src/hooks/useReferrerEarnings.ts +4 -1
  63. package/src/hooks/useSubmissionReview.ts +95 -32
  64. package/src/hooks/useTaskActivation.ts +51 -9
  65. package/src/hooks/useTaskGuarantee.ts +4 -1
  66. package/src/hooks/useTaskLifecycle.ts +104 -24
  67. package/src/hooks/useTaskStatus.ts +121 -26
  68. package/src/hooks/useTaskWork.ts +76 -12
  69. package/src/hooks/useWalletSigner.ts +11 -16
  70. package/src/index.ts +3 -0
  71. package/src/provider/AgencProvider.tsx +95 -3
  72. package/src/provider/referrer.ts +1 -1
  73. package/src/signers/README.md +13 -7
  74. package/src/signers/index.ts +6 -1
  75. package/src/signers/strings.ts +13 -1
  76. package/src/signers/types.ts +16 -5
  77. package/src/signers/wallet-account.ts +115 -29
  78. package/src/signers/wallet-adapter.ts +38 -4
  79. package/src/theme/agenc-tailwind-preset.cjs +134 -108
  80. package/src/types.ts +27 -1
  81. package/dist/chunk-JVXGNW3Q.js.map +0 -1
  82. package/dist/chunk-ON6XR4XO.js +0 -128
  83. package/dist/chunk-ON6XR4XO.js.map +0 -1
  84. package/dist/chunk-XLA7DARS.js.map +0 -1
@@ -45,8 +45,8 @@ export type { Address, SignatureBytes, Transaction, TransactionSigner };
45
45
  *
46
46
  * Given one or more `{ transaction }` wire-format inputs, it returns one
47
47
  * `{ signedTransaction }` output per input (a fully serialized, signed
48
- * transaction — wallets may modify it, which is why we diff signatures rather
49
- * than assume identity).
48
+ * transaction. The bridge rejects a returned message that differs from the
49
+ * requested message because the SDK submits the original transaction bytes.
50
50
  */
51
51
  export type WalletStandardSignTransaction = (
52
52
  ...inputs: ReadonlyArray<{
@@ -78,7 +78,7 @@ export type WalletStandardSignTransaction = (
78
78
  export interface WalletStandardAccountLike {
79
79
  /** Base58 account address (becomes the signer's `address`). */
80
80
  readonly address: string;
81
- /** CAIP-2 chains this account supports (used to pick a default `chain`). */
81
+ /** CAIP-2 chains this account supports (used to validate chain selection). */
82
82
  readonly chains?: readonly string[];
83
83
  /** Raw Wallet Standard feature bag, when resolvable off the account. */
84
84
  readonly features?: Readonly<
@@ -89,14 +89,25 @@ export interface WalletStandardAccountLike {
89
89
  >;
90
90
  }
91
91
 
92
+ /** Provider networks that map to Wallet Standard Solana chain identifiers. */
93
+ export type SolanaWalletNetwork = "localnet" | "devnet" | "mainnet";
94
+
95
+ /** A kit signer whose Wallet Standard chain can be validated by a provider. */
96
+ export type ChainBoundTransactionSigner = TransactionSigner & {
97
+ readonly chain: string;
98
+ };
99
+
92
100
  /** Options for {@link signerFromWalletAccount}. */
93
101
  export interface SignerFromWalletAccountOptions {
94
102
  /**
95
103
  * CAIP-2 chain id forwarded to the wallet on each sign (e.g.
96
- * `"solana:devnet"`, `"solana:mainnet"`). Defaults to the account's first
97
- * `solana:*` chain, else `"solana:mainnet"`.
104
+ * `"solana:devnet"`, `"solana:mainnet"`). When omitted, `network` maps to a
105
+ * chain; otherwise the account must expose exactly one `solana:*` chain.
106
+ * Ambiguous or unsupported selections fail closed.
98
107
  */
99
108
  chain?: string;
109
+ /** Provider network to bind to a Wallet Standard chain. */
110
+ network?: SolanaWalletNetwork;
100
111
  /**
101
112
  * Explicit `solana:signTransaction` feature method. Overrides any feature
102
113
  * resolved off `account.features`. This is the seam tests and non-Wallet-
@@ -7,25 +7,28 @@
7
7
  * — so it needs a PARTIAL signer (one that returns signatures without sending),
8
8
  * NOT a `TransactionSendingSigner` (which `signTransactionMessageWithSigners`
9
9
  * deliberately ignores). This bridge therefore produces a
10
- * {@link TransactionPartialSigner}: it serializes each transaction, hands it to
11
- * the wallet's `solana:signTransaction` feature, and diffs the returned signed
12
- * transaction to recover THIS account's signature.
10
+ * {@link TransactionPartialSigner}: it batches transactions through the
11
+ * wallet's variadic `solana:signTransaction` feature, requires byte-identical
12
+ * returned messages, and recovers THIS account's verified signatures.
13
13
  *
14
14
  * @see {@link signerFromWalletAccount}
15
15
  * @module signers/wallet-account
16
16
  */
17
17
  import {
18
18
  address,
19
+ getPublicKeyFromAddress,
19
20
  getTransactionDecoder,
20
21
  getTransactionEncoder,
22
+ verifySignature,
21
23
  type Address,
22
24
  type SignatureBytes,
23
25
  type Transaction,
24
26
  } from "@solana/kit";
25
27
  import { ts } from "./strings.js";
26
28
  import type {
29
+ ChainBoundTransactionSigner,
27
30
  SignerFromWalletAccountOptions,
28
- TransactionSigner,
31
+ SolanaWalletNetwork,
29
32
  WalletStandardAccountLike,
30
33
  WalletStandardSignTransaction,
31
34
  } from "./types.js";
@@ -45,13 +48,67 @@ function resolveSignTransaction(
45
48
  throw new Error(ts("signer.walletNoSignFeature", { address: account.address }));
46
49
  }
47
50
 
48
- /** Pick the CAIP-2 chain to forward to the wallet. */
51
+ /** Map an AgenC provider network to the Wallet Standard chain identifier. */
52
+ export function walletStandardChainForNetwork(
53
+ network: SolanaWalletNetwork,
54
+ ): string {
55
+ return `solana:${network}`;
56
+ }
57
+
58
+ /** Resolve and validate the CAIP-2 chain forwarded to the wallet. */
49
59
  function resolveChain(
50
60
  account: WalletStandardAccountLike,
51
61
  options: SignerFromWalletAccountOptions,
52
- ): string | undefined {
53
- if (options.chain) return options.chain;
54
- return account.chains?.find((c) => c.startsWith("solana:"));
62
+ ): string {
63
+ const networkChain = options.network
64
+ ? walletStandardChainForNetwork(options.network)
65
+ : undefined;
66
+ if (options.chain && networkChain && options.chain !== networkChain) {
67
+ throw new Error(
68
+ ts("signer.walletChainNetworkMismatch", {
69
+ chain: options.chain,
70
+ network: options.network!,
71
+ expected: networkChain,
72
+ }),
73
+ );
74
+ }
75
+
76
+ const solanaChains =
77
+ account.chains?.filter((chain) => chain.startsWith("solana:")) ?? [];
78
+ const requested = options.chain ?? networkChain;
79
+ const chain =
80
+ requested ?? (solanaChains.length === 1 ? solanaChains[0] : undefined);
81
+ if (!chain) {
82
+ throw new Error(
83
+ ts("signer.walletChainRequired", {
84
+ address: account.address,
85
+ count: solanaChains.length,
86
+ }),
87
+ );
88
+ }
89
+ if (
90
+ !chain.startsWith("solana:") ||
91
+ (account.chains !== undefined && !account.chains.includes(chain))
92
+ ) {
93
+ throw new Error(
94
+ ts("signer.walletChainUnsupported", {
95
+ address: account.address,
96
+ chain,
97
+ }),
98
+ );
99
+ }
100
+ return chain;
101
+ }
102
+
103
+ function bytesEqual(
104
+ left: ArrayLike<number>,
105
+ right: ArrayLike<number>,
106
+ ): boolean {
107
+ if (left.length !== right.length) return false;
108
+ for (let index = 0; index < left.length; index += 1) {
109
+ if (left[index] !== right[index]) return false;
110
+ }
111
+ return true;
55
112
  }
56
113
 
57
114
  /**
@@ -63,12 +120,9 @@ function resolveChain(
63
120
  * the `solana:signTransaction` feature. The returned signer is a
64
121
  * {@link TransactionPartialSigner}, the exact shape the SDK client expects.
65
122
  *
66
- * Wallets may MODIFY a transaction before signing (priority fees, guard
67
- * instructions). We honor that by decoding the wallet's returned signed
68
- * transaction and extracting only THIS account's signature; the SDK client then
69
- * re-assembles and submits. (If a wallet rewrites the message such that the
70
- * fee-payer's own prior signing is invalidated, that is a wallet contract the
71
- * SDK's single-fee-payer flow already assumes won't happen for the payer.)
123
+ * The SDK client re-assembles and submits the ORIGINAL transaction. This bridge
124
+ * therefore accepts only byte-identical returned message bytes and verifies the
125
+ * extracted signature over them.
72
126
  *
73
127
  * SSR-safe: constructs no browser globals; the wallet round-trip only runs when
74
128
  * a transaction is actually signed.
@@ -89,40 +143,72 @@ function resolveChain(
89
143
  export function signerFromWalletAccount(
90
144
  account: WalletStandardAccountLike,
91
145
  options: SignerFromWalletAccountOptions = {},
92
- ): TransactionSigner {
146
+ ): ChainBoundTransactionSigner {
93
147
  const signerAddress: Address = address(account.address);
94
148
  const signTransaction = resolveSignTransaction(account, options);
95
149
  const chain = resolveChain(account, options);
96
150
  const encoder = getTransactionEncoder();
97
151
  const decoder = getTransactionDecoder();
152
+ let publicKeyPromise: ReturnType<typeof getPublicKeyFromAddress> | undefined;
98
153
 
99
- async function signOne(transaction: Transaction): Promise<SignatureBytes> {
100
- const wireBytes = new Uint8Array(encoder.encode(transaction));
101
- const [output] = await signTransaction({
102
- transaction: wireBytes,
103
- ...(chain ? { chain } : {}),
104
- });
105
- if (!output) {
106
- throw new Error(ts("signer.walletNoSignature", { address: account.address }));
154
+ async function extractSignature(
155
+ transaction: Transaction,
156
+ signedTransaction: Uint8Array,
157
+ ): Promise<SignatureBytes> {
158
+ const signed = decoder.decode(signedTransaction);
159
+ if (!bytesEqual(transaction.messageBytes, signed.messageBytes)) {
160
+ throw new Error(
161
+ ts("signer.walletModifiedTransaction", { address: account.address }),
162
+ );
107
163
  }
108
- const signed = decoder.decode(output.signedTransaction);
109
164
  const signature = signed.signatures[signerAddress];
110
165
  if (!signature) {
111
166
  throw new Error(ts("signer.walletNoSignature", { address: account.address }));
112
167
  }
168
+ publicKeyPromise ??= getPublicKeyFromAddress(signerAddress);
169
+ const valid = await verifySignature(
170
+ await publicKeyPromise,
171
+ signature,
172
+ transaction.messageBytes,
173
+ );
174
+ if (!valid) {
175
+ throw new Error(
176
+ ts("signer.walletInvalidSignature", { address: account.address }),
177
+ );
178
+ }
113
179
  return signature as SignatureBytes;
114
180
  }
115
181
 
116
182
  return {
117
183
  address: signerAddress,
184
+ chain,
118
185
  async signTransactions(transactions) {
119
- // Sign in parallel — partial signers are order-independent (each returns a
120
- // single-entry SignatureDictionary the caller merges).
186
+ if (transactions.length === 0) return [];
187
+ // Wallet Standard is variadic: one call preserves single-flight approval
188
+ // behavior and output ordering.
189
+ const outputs = await signTransaction(
190
+ ...transactions.map((transaction) => ({
191
+ account,
192
+ chain,
193
+ transaction: new Uint8Array(encoder.encode(transaction)),
194
+ })),
195
+ );
196
+ if (outputs.length !== transactions.length) {
197
+ throw new Error(
198
+ ts("signer.walletResponseCount", {
199
+ got: outputs.length,
200
+ expected: transactions.length,
201
+ }),
202
+ );
203
+ }
121
204
  return Promise.all(
122
- transactions.map(async (transaction) => ({
123
- [signerAddress]: await signOne(transaction),
205
+ outputs.map(async (output, index) => ({
206
+ [signerAddress]: await extractSignature(
207
+ transactions[index]!,
208
+ output.signedTransaction,
209
+ ),
124
210
  })),
125
211
  );
126
212
  },
127
- } satisfies TransactionSigner;
213
+ } satisfies ChainBoundTransactionSigner;
128
214
  }
@@ -21,8 +21,10 @@
21
21
  */
22
22
  import {
23
23
  address,
24
+ getPublicKeyFromAddress,
24
25
  getTransactionDecoder,
25
26
  getTransactionEncoder,
27
+ verifySignature,
26
28
  type SignatureBytes,
27
29
  type Transaction,
28
30
  } from "@solana/kit";
@@ -83,6 +85,17 @@ function resolveAdapterAddress(adapter: WalletAdapterLike): string {
83
85
  return String(publicKey);
84
86
  }
85
87
 
88
+ function bytesEqual(
89
+ left: ArrayLike<number>,
90
+ right: ArrayLike<number>,
91
+ ): boolean {
92
+ if (left.length !== right.length) return false;
93
+ for (let index = 0; index < left.length; index += 1) {
94
+ if (left[index] !== right[index]) return false;
95
+ }
96
+ return true;
97
+ }
98
+
86
99
  /**
87
100
  * Bridge a LEGACY `@solana/wallet-adapter` `WalletContextState` into a kit
88
101
  * {@link TransactionSigner}.
@@ -121,29 +134,50 @@ export function signerFromWalletAdapter(
121
134
  const { VersionedTransaction } = options;
122
135
  const encoder = getTransactionEncoder();
123
136
  const decoder = getTransactionDecoder();
137
+ let publicKeyPromise: ReturnType<typeof getPublicKeyFromAddress> | undefined;
124
138
 
125
139
  async function signOne(transaction: Transaction): Promise<SignatureBytes> {
126
140
  const wireBytes = new Uint8Array(encoder.encode(transaction));
127
141
  const legacyTx = VersionedTransaction.deserialize(wireBytes);
128
142
  const signed = await signTransaction!(legacyTx);
129
143
  const signedTx = decoder.decode(new Uint8Array(signed.serialize()));
144
+ if (!bytesEqual(transaction.messageBytes, signedTx.messageBytes)) {
145
+ throw new Error(
146
+ ts("signer.walletModifiedTransaction", { address: signerAddress }),
147
+ );
148
+ }
130
149
  const signature = signedTx.signatures[signerAddress];
131
150
  if (!signature) {
132
151
  throw new Error(
133
152
  ts("signer.walletNoSignature", { address: signerAddress }),
134
153
  );
135
154
  }
155
+ publicKeyPromise ??= getPublicKeyFromAddress(signerAddress);
156
+ const valid = await verifySignature(
157
+ await publicKeyPromise,
158
+ signature,
159
+ transaction.messageBytes,
160
+ );
161
+ if (!valid) {
162
+ throw new Error(
163
+ ts("signer.walletInvalidSignature", { address: signerAddress }),
164
+ );
165
+ }
136
166
  return signature as SignatureBytes;
137
167
  }
138
168
 
139
169
  return {
140
170
  address: signerAddress,
141
171
  async signTransactions(transactions) {
142
- return Promise.all(
143
- transactions.map(async (transaction) => ({
172
+ const signatures = [];
173
+ // Legacy wallet-adapter is unary and many implementations are
174
+ // single-flight. Serialize prompts in input order.
175
+ for (const transaction of transactions) {
176
+ signatures.push({
144
177
  [signerAddress]: await signOne(transaction),
145
- })),
146
- );
178
+ });
179
+ }
180
+ return signatures;
147
181
  },
148
182
  } satisfies TransactionSigner;
149
183
  }
@@ -8,15 +8,19 @@
8
8
  * Reason: cross-repo imports are impossible in CI; consumers read the
9
9
  * AgenC Tailwind preset FROM this package via
10
10
  * "@tetsuo-ai/marketplace-react/tailwind-preset".
11
+ * Local adaptation: export Tailwind's dependency-free plugin descriptor shape
12
+ * directly so importing this optional preset never requires
13
+ * Tailwind from the React package itself.
11
14
  * Resync: copy tokens/tailwind.config.cjs from agenc-ui-design-skill
12
- * HEAD and update the commit line above.
15
+ * HEAD, preserve the local plugin-descriptor adaptation, and
16
+ * update the commit line above.
13
17
  * ============================================================================
14
18
  */
15
19
 
16
20
  /**
17
21
  * Tetsuo.ai / AgenC Tailwind config fragment.
18
22
  *
19
- * Drop-in extension for an existing Tailwind v3+ project (works alongside
23
+ * Drop-in extension for an existing Tailwind v3 project (works alongside
20
24
  * shadcn/ui's default config). Colors are sRGB hex.
21
25
  *
22
26
  * Usage in your tailwind.config.{js,cjs,ts}:
@@ -33,142 +37,164 @@
33
37
  * };
34
38
  */
35
39
 
36
- const plugin = require('tailwindcss/plugin');
37
-
38
40
  const colors = {
39
41
  // AgenC neon (canonical product palette)
40
42
  agenc: {
41
- void: '#0A0612',
42
- surface: '#16102A',
43
- 'surface-2': '#221638',
44
- 'surface-3': '#2E1A4A',
45
- violet: '#7B3FFF',
46
- magenta: '#FF2E93',
47
- orange: '#FF6B1A',
48
- cyan: '#48C8EF',
49
- grid: '#3A1F66',
50
- text: '#F5F0FF',
51
- 'text-muted': '#B8A8D9',
52
- 'text-dim': '#6E5C8F',
53
- success: '#3FFFA0',
54
- warning: '#FFC53F',
55
- danger: '#FF3D3D',
56
- border: '#2E1A4A',
57
- 'border-strong': '#4A2E7A',
43
+ void: "#0A0612",
44
+ surface: "#16102A",
45
+ "surface-2": "#221638",
46
+ "surface-3": "#2E1A4A",
47
+ violet: "#7B3FFF",
48
+ magenta: "#FF2E93",
49
+ orange: "#FF6B1A",
50
+ cyan: "#48C8EF",
51
+ grid: "#3A1F66",
52
+ text: "#F5F0FF",
53
+ "text-muted": "#B8A8D9",
54
+ "text-dim": "#6E5C8F",
55
+ success: "#3FFFA0",
56
+ warning: "#FFC53F",
57
+ danger: "#FF3D3D",
58
+ border: "#2E1A4A",
59
+ "border-strong": "#4A2E7A",
58
60
  },
59
61
  // Tetsuo.ai noir (marketing / community)
60
62
  tetsuo: {
61
- noir: '#0A0A0A',
62
- 'noir-2': '#141414',
63
- paper: '#F8F5E9',
64
- 'akira-red': '#E30426',
65
- 'akira-red-bright': '#FA1232',
66
- blood: '#7A0000',
67
- cyan: '#48C8EF',
68
- magenta: '#D01D7D',
69
- 'synth-pink': '#EF5EC2',
70
- 'synth-pink-soft': '#F3A8CE',
71
- 'synth-purple': '#7B3FFF',
72
- 'synth-eggplant': '#441535',
63
+ noir: "#0A0A0A",
64
+ "noir-2": "#141414",
65
+ paper: "#F8F5E9",
66
+ "akira-red": "#E30426",
67
+ "akira-red-bright": "#FA1232",
68
+ blood: "#7A0000",
69
+ cyan: "#48C8EF",
70
+ magenta: "#D01D7D",
71
+ "synth-pink": "#EF5EC2",
72
+ "synth-pink-soft": "#F3A8CE",
73
+ "synth-purple": "#7B3FFF",
74
+ "synth-eggplant": "#441535",
73
75
  },
74
76
  };
75
77
 
76
78
  const backgroundImage = {
77
- 'agenc-gradient': 'linear-gradient(135deg, #7B3FFF 0%, #FF2E93 60%, #FF6B1A 100%)',
78
- 'agenc-gradient-cool': 'linear-gradient(135deg, #48C8EF 0%, #7B3FFF 100%)',
79
- 'agenc-gradient-text': 'linear-gradient(90deg, #7B3FFF 0%, #FF2E93 50%, #FF6B1A 100%)',
80
- 'tetsuo-gradient-glitch': 'linear-gradient(90deg, #48C8EF 0%, #D01D7D 100%)',
81
- 'tetsuo-gradient-synth':
82
- 'linear-gradient(135deg, #441535 0%, #D01D7D 50%, #EF5EC2 100%)',
79
+ "agenc-gradient":
80
+ "linear-gradient(135deg, #7B3FFF 0%, #FF2E93 60%, #FF6B1A 100%)",
81
+ "agenc-gradient-cool": "linear-gradient(135deg, #48C8EF 0%, #7B3FFF 100%)",
82
+ "agenc-gradient-text":
83
+ "linear-gradient(90deg, #7B3FFF 0%, #FF2E93 50%, #FF6B1A 100%)",
84
+ "tetsuo-gradient-glitch": "linear-gradient(90deg, #48C8EF 0%, #D01D7D 100%)",
85
+ "tetsuo-gradient-synth":
86
+ "linear-gradient(135deg, #441535 0%, #D01D7D 50%, #EF5EC2 100%)",
83
87
  // Synthwave grid floor — pair with a perspective transform on a child
84
- 'agenc-grid-floor':
85
- 'linear-gradient(transparent 95%, #3A1F66 95%), linear-gradient(90deg, transparent 95%, #3A1F66 95%)',
88
+ "agenc-grid-floor":
89
+ "linear-gradient(transparent 95%, #3A1F66 95%), linear-gradient(90deg, transparent 95%, #3A1F66 95%)",
86
90
  };
87
91
 
88
92
  const boxShadow = {
89
- 'glow-violet': '0 0 24px rgba(123, 63, 255, 0.4), 0 0 48px rgba(123, 63, 255, 0.2)',
90
- 'glow-magenta': '0 0 24px rgba(255, 46, 147, 0.4), 0 0 48px rgba(255, 46, 147, 0.2)',
91
- 'glow-cyan': '0 0 24px rgba(72, 200, 239, 0.4), 0 0 48px rgba(72, 200, 239, 0.2)',
92
- 'glow-orange': '0 0 24px rgba(255, 107, 26, 0.4), 0 0 48px rgba(255, 107, 26, 0.2)',
93
- 'glow-akira': '0 0 24px rgba(227, 4, 38, 0.5), 0 0 64px rgba(227, 4, 38, 0.25)',
93
+ "glow-violet":
94
+ "0 0 24px rgba(123, 63, 255, 0.4), 0 0 48px rgba(123, 63, 255, 0.2)",
95
+ "glow-magenta":
96
+ "0 0 24px rgba(255, 46, 147, 0.4), 0 0 48px rgba(255, 46, 147, 0.2)",
97
+ "glow-cyan":
98
+ "0 0 24px rgba(72, 200, 239, 0.4), 0 0 48px rgba(72, 200, 239, 0.2)",
99
+ "glow-orange":
100
+ "0 0 24px rgba(255, 107, 26, 0.4), 0 0 48px rgba(255, 107, 26, 0.2)",
101
+ "glow-akira":
102
+ "0 0 24px rgba(227, 4, 38, 0.5), 0 0 64px rgba(227, 4, 38, 0.25)",
94
103
  };
95
104
 
96
105
  const fontFamily = {
97
106
  // Display: jagged / glitch / cyberpunk. Pick one and load via @font-face.
98
- 'agenc-display': ['"Audiowide"', '"Major Mono Display"', 'system-ui', 'sans-serif'],
107
+ "agenc-display": [
108
+ '"Audiowide"',
109
+ '"Major Mono Display"',
110
+ "system-ui",
111
+ "sans-serif",
112
+ ],
99
113
  // Body: clean geometric sans
100
- 'agenc-body': ['"Geist"', '"Inter"', 'system-ui', 'sans-serif'],
114
+ "agenc-body": ['"Geist"', '"Inter"', "system-ui", "sans-serif"],
101
115
  // Mono: for HUD / status / readouts
102
- 'agenc-mono': ['"JetBrains Mono"', '"IBM Plex Mono"', 'ui-monospace', 'monospace'],
116
+ "agenc-mono": [
117
+ '"JetBrains Mono"',
118
+ '"IBM Plex Mono"',
119
+ "ui-monospace",
120
+ "monospace",
121
+ ],
103
122
  };
104
123
 
105
124
  const fontSize = {
106
125
  // Display scale skews dramatic — these are AgenC-specific overrides.
107
- 'display-xs': ['2rem', { lineHeight: '1.05', letterSpacing: '-0.02em' }],
108
- 'display-sm': ['2.5rem', { lineHeight: '1.05', letterSpacing: '-0.02em' }],
109
- 'display-md': ['3.5rem', { lineHeight: '1.0', letterSpacing: '-0.03em' }],
110
- 'display-lg': ['5rem', { lineHeight: '0.95', letterSpacing: '-0.04em' }],
111
- 'display-xl': ['7rem', { lineHeight: '0.9', letterSpacing: '-0.04em' }],
126
+ "display-xs": ["2rem", { lineHeight: "1.05", letterSpacing: "-0.02em" }],
127
+ "display-sm": ["2.5rem", { lineHeight: "1.05", letterSpacing: "-0.02em" }],
128
+ "display-md": ["3.5rem", { lineHeight: "1.0", letterSpacing: "-0.03em" }],
129
+ "display-lg": ["5rem", { lineHeight: "0.95", letterSpacing: "-0.04em" }],
130
+ "display-xl": ["7rem", { lineHeight: "0.9", letterSpacing: "-0.04em" }],
112
131
  };
113
132
 
114
133
  // Plugin: utilities that aren't trivially expressible as theme extensions.
115
- const tetsuoPlugin = plugin(function ({ addUtilities, addComponents }) {
116
- addUtilities({
117
- // Chromatic aberration glitch text — drop on any text element.
118
- '.text-glitch': {
119
- position: 'relative',
120
- color: '#F8F5E9',
121
- textShadow: '2px 0 0 #48C8EF, -2px 0 0 #D01D7D',
122
- },
123
- '.text-glitch-strong': {
124
- position: 'relative',
125
- color: '#F8F5E9',
126
- textShadow: '3px 0 0 #48C8EF, -3px 0 0 #D01D7D, 0 0 8px rgba(255,255,255,0.15)',
127
- },
128
- // Neon-stroked outline text
129
- '.text-neon-stroke': {
130
- color: 'transparent',
131
- WebkitTextStroke: '1.5px #FF2E93',
132
- textShadow: '0 0 12px rgba(255, 46, 147, 0.6)',
133
- },
134
- // Scanline overlay — apply to a positioned container.
135
- '.bg-scanlines': {
136
- backgroundImage:
137
- 'repeating-linear-gradient(0deg, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px, rgba(0,0,0,0.18) 2px, rgba(0,0,0,0.18) 3px)',
138
- },
139
- // CRT vignette
140
- '.bg-vignette': {
141
- backgroundImage:
142
- 'radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.55) 100%)',
143
- },
144
- });
145
-
146
- addComponents({
147
- // HUD frame: corner brackets only, transparent middle.
148
- '.hud-frame': {
149
- position: 'relative',
150
- padding: '24px',
151
- '&::before, &::after': {
152
- content: '""',
153
- position: 'absolute',
154
- width: '24px',
155
- height: '24px',
156
- borderColor: '#7B3FFF',
157
- borderStyle: 'solid',
134
+ const tetsuoPlugin = {
135
+ // Tailwind v3's `plugin(handler)` helper returns exactly this
136
+ // `{ handler, config }` descriptor. Keeping the descriptor local prevents an
137
+ // optional preset export from creating a runtime dependency on Tailwind.
138
+ handler({ addUtilities, addComponents }) {
139
+ addUtilities({
140
+ // Chromatic aberration glitch text — drop on any text element.
141
+ ".text-glitch": {
142
+ position: "relative",
143
+ color: "#F8F5E9",
144
+ textShadow: "2px 0 0 #48C8EF, -2px 0 0 #D01D7D",
158
145
  },
159
- '&::before': {
160
- top: '0',
161
- left: '0',
162
- borderWidth: '2px 0 0 2px',
146
+ ".text-glitch-strong": {
147
+ position: "relative",
148
+ color: "#F8F5E9",
149
+ textShadow:
150
+ "3px 0 0 #48C8EF, -3px 0 0 #D01D7D, 0 0 8px rgba(255,255,255,0.15)",
163
151
  },
164
- '&::after': {
165
- bottom: '0',
166
- right: '0',
167
- borderWidth: '0 2px 2px 0',
152
+ // Neon-stroked outline text
153
+ ".text-neon-stroke": {
154
+ color: "transparent",
155
+ WebkitTextStroke: "1.5px #FF2E93",
156
+ textShadow: "0 0 12px rgba(255, 46, 147, 0.6)",
168
157
  },
169
- },
170
- });
171
- });
158
+ // Scanline overlay — apply to a positioned container.
159
+ ".bg-scanlines": {
160
+ backgroundImage:
161
+ "repeating-linear-gradient(0deg, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px, rgba(0,0,0,0.18) 2px, rgba(0,0,0,0.18) 3px)",
162
+ },
163
+ // CRT vignette
164
+ ".bg-vignette": {
165
+ backgroundImage:
166
+ "radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.55) 100%)",
167
+ },
168
+ });
169
+
170
+ addComponents({
171
+ // HUD frame: corner brackets only, transparent middle.
172
+ ".hud-frame": {
173
+ position: "relative",
174
+ padding: "24px",
175
+ "&::before, &::after": {
176
+ content: '""',
177
+ position: "absolute",
178
+ width: "24px",
179
+ height: "24px",
180
+ borderColor: "#7B3FFF",
181
+ borderStyle: "solid",
182
+ },
183
+ "&::before": {
184
+ top: "0",
185
+ left: "0",
186
+ borderWidth: "2px 0 0 2px",
187
+ },
188
+ "&::after": {
189
+ bottom: "0",
190
+ right: "0",
191
+ borderWidth: "0 2px 2px 0",
192
+ },
193
+ },
194
+ });
195
+ },
196
+ config: undefined,
197
+ };
172
198
 
173
199
  module.exports = {
174
200
  theme: {