@tangle-network/agent-app 1.0.26 → 2.0.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/dist/assistant/index.js +4 -4
- package/dist/chat-react/index.js +3 -3
- package/dist/chat-routes/index.js +3 -3
- package/dist/{chunk-NZMP7PFG.js → chunk-7IVRHG3L.js} +3 -3
- package/dist/{chunk-XCUT52I3.js → chunk-GLZMHETS.js} +2 -2
- package/dist/chunk-GLZMHETS.js.map +1 -0
- package/dist/{chunk-Z5Y6OYAP.js → chunk-HFCPHY5D.js} +2 -2
- package/dist/{chunk-OZWHBH4T.js → chunk-HFWKZHTZ.js} +21 -5
- package/dist/chunk-HFWKZHTZ.js.map +1 -0
- package/dist/{chunk-OVVVGEF6.js → chunk-MS5S4IVF.js} +2 -2
- package/dist/{chunk-B2X2GGV5.js → chunk-PKBNDVGR.js} +2 -2
- package/dist/{chunk-RCSAAWOH.js → chunk-SUWAECFT.js} +2 -1
- package/dist/chunk-SUWAECFT.js.map +1 -0
- package/dist/harness/index.js +1 -1
- package/dist/hosted-agent/react/index.js +1 -1
- package/dist/hosted-agent/react/index.js.map +1 -1
- package/dist/public-consultation/index.js +3 -3
- package/dist/sandbox/index.js +2 -2
- package/dist/sandbox/prompt-profile.d.ts +1 -1
- package/dist/settings-react/index.js +146 -93
- package/dist/settings-react/index.js.map +1 -1
- package/dist/skills-placement/box.js +2 -2
- package/dist/skills-placement/index.js +2 -2
- package/dist/teams/index.d.ts +2 -2
- package/dist/teams-react/components/index.d.ts +0 -2
- package/dist/teams-react/components/invitation-detail.d.ts +1 -1
- package/dist/teams-react/components/member-access.d.ts +2 -2
- package/dist/teams-react/contracts.d.ts +3 -68
- package/dist/teams-react/index.d.ts +5 -6
- package/dist/teams-react/index.js +46 -335
- package/dist/teams-react/index.js.map +1 -1
- package/dist/web-react/agent-profile-editor.js +3 -3
- package/dist/web-react/index.js +4 -4
- package/package.json +3 -3
- package/dist/chunk-OZWHBH4T.js.map +0 -1
- package/dist/chunk-RCSAAWOH.js.map +0 -1
- package/dist/chunk-XCUT52I3.js.map +0 -1
- package/dist/chunk-YL5JDX7K.js +0 -70
- package/dist/chunk-YL5JDX7K.js.map +0 -1
- package/dist/stories/settings/team-panels-demo.d.ts +0 -21
- package/dist/teams-react/components/InvitationsPanel.d.ts +0 -13
- package/dist/teams-react/components/InviteForm.d.ts +0 -20
- package/dist/teams-react/components/MembersPanel.d.ts +0 -18
- /package/dist/{chunk-NZMP7PFG.js.map → chunk-7IVRHG3L.js.map} +0 -0
- /package/dist/{chunk-Z5Y6OYAP.js.map → chunk-HFCPHY5D.js.map} +0 -0
- /package/dist/{chunk-OVVVGEF6.js.map → chunk-MS5S4IVF.js.map} +0 -0
- /package/dist/{chunk-B2X2GGV5.js.map → chunk-PKBNDVGR.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/harness/index.ts","../src/harness/session-selection.ts","../src/harness/presets.ts"],"sourcesContent":["/**\n * Coding-agent harness selection, model compatibility, and the session lock.\n *\n * Known identities are not a deployment's available runners. Products supply\n * server-owned availability to resolveSessionHarness. Historical session IDs\n * remain intact when their runner is unavailable; a harness change requires an\n * explicit transfer, not a fallback or a rewritten session lock.\n *\n * Model compatibility is owned by @tangle-network/agent-interface. The shell\n * owns session selection; the consumer owns storage and deployment policy.\n */\n\nimport type { HarnessType } from '@tangle-network/agent-interface'\nimport { harnessTypeSchema } from '@tangle-network/agent-interface/harness'\nimport {\n harnessProviders,\n harnessSupportsModel,\n modelProvider,\n preferredHarnessForModel,\n snapHarnessToModel as aiSnapHarnessToModel,\n snapModelToHarness as aiSnapModelToHarness,\n} from '@tangle-network/agent-interface/harness-capabilities'\nimport {\n selectSessionHarness,\n type SelectionAvailability,\n type SessionHarnessSelection,\n type SessionHarnessSelectionInput,\n} from './session-selection'\n\nexport { HarnessSelectionError } from './session-selection'\n\n/** Canonical identities that have no direct Sandbox backend. */\nconst NON_BACKEND_HARNESSES = ['gemini'] as const satisfies readonly HarnessType[]\nconst nonBackendHarnesses = new Set<string>(NON_BACKEND_HARNESSES)\n\n/** A recognized coding-agent backend, not a promise that it is installed. */\nexport type Harness = Exclude<HarnessType, (typeof NON_BACKEND_HARNESSES)[number]>\n\n/**\n * Recognized backend identities, including IDs needed by historical sessions.\n * Use deployment availability, not membership here, to offer or admit new runs.\n */\nexport const KNOWN_HARNESSES: readonly Harness[] = [\n ...harnessTypeSchema.options.filter(\n (harness): harness is Exclude<HarnessType, (typeof NON_BACKEND_HARNESSES)[number]> =>\n !nonBackendHarnesses.has(harness),\n ),\n]\n\n/** Default for an absent choice; never a replacement for an invalid explicit ID. */\nexport const DEFAULT_HARNESS: Harness = 'opencode'\nconst HARNESS_SET: ReadonlySet<string> = new Set(KNOWN_HARNESSES)\n\n/** Determine whether a value is a recognized identity, independently of availability. */\nexport function isHarness(value: unknown): value is Harness {\n return typeof value === 'string' && HARNESS_SET.has(value)\n}\n\n/** Display/config convenience only. Never use coercion to admit an execution or restore a lock. */\nexport function coerceHarness(value: unknown, fallback: Harness = DEFAULT_HARNESS): Harness {\n return isHarness(value) ? value : fallback\n}\n\n/** Server-owned start and resume sets. Existing-only entries are draining. */\nexport type HarnessAvailability = SelectionAvailability<Harness>\n\n/** A saved lock, explicit choice, workspace default, and optional deployment availability. */\nexport type ResolveSessionHarnessInput = SessionHarnessSelectionInput<Harness>\n\n/** The selected identity and the existing session-lock/swap-attempt result. */\nexport type ResolvedSessionHarness = SessionHarnessSelection<Harness>\n\n/**\n * Resolve requested → workspaceDefault → fallback only for a genuinely new session.\n * A non-null saved identity always takes the lock path. Unknown/retired identities\n * and invalid explicit requests throw HarnessSelectionError instead of falling back.\n * A known different request still reports swapAttempted while preserving the lock.\n * The caller must reject that attempt before execution, as in the existing contract.\n */\nexport function resolveSessionHarness(input: ResolveSessionHarnessInput = {}): ResolvedSessionHarness {\n return selectSessionHarness(input, KNOWN_HARNESSES, DEFAULT_HARNESS)\n}\n\n/**\n * An app's harness configuration, read from its deploy configuration (for example the env vars\n * `AGENT_HARNESS` and `AGENT_HARNESS_WORKSPACES`), so no product hard-codes `backend.type`.\n */\nexport interface HarnessConfig {\n /** The app default for new sessions. Unset or blank means {@link DEFAULT_HARNESS}. */\n default?: string\n /** Per-workspace choices: a JSON object mapping a workspace id to a harness. */\n workspaces?: string\n}\n\nfunction configHarness(value: unknown, where: string): Harness {\n if (!isHarness(value)) throw new Error(`${where} names an unknown harness: ${String(value)}`)\n return value\n}\n\n/**\n * The harness a workspace's new sessions start on: its own choice, else the app default, else\n * {@link DEFAULT_HARNESS}. Pass the result to {@link resolveSessionHarness} as `workspaceDefault`\n * so a session that already ran keeps its harness. A value naming an unknown harness throws:\n * a configuration typo must fail loudly, never run a different harness than the one configured.\n */\nexport function configuredHarness(config: HarnessConfig, workspaceId?: string): Harness {\n const appDefault = config.default?.trim()\n ? configHarness(config.default.trim(), 'The harness default') : DEFAULT_HARNESS\n const raw = config.workspaces?.trim()\n if (!raw) return appDefault\n let choices: unknown\n try {\n choices = JSON.parse(raw)\n } catch {\n throw new Error('The per-workspace harness configuration is not JSON')\n }\n if (!choices || typeof choices !== 'object' || Array.isArray(choices)) {\n throw new Error('The per-workspace harness configuration must map workspace ids to harnesses')\n }\n // Every entry is checked, not only the caller's, so one bad entry fails every workspace's\n // first turn after the deploy instead of hiding until that workspace sends a message.\n const parsed = new Map(Object.entries(choices).map(([id, value]) =>\n [id, configHarness(value, `The harness for workspace ${id}`)]))\n return (workspaceId === undefined ? undefined : parsed.get(workspaceId)) ?? appDefault\n}\n\n/** Harness-model compatibility is delegated to the Interface owner. */\nexport { modelProvider }\n\n/** A resolved model and the transport provider that will execute it. */\nexport interface HarnessModelSelection {\n model: string\n provider?: string\n}\n\n/** Provider-less ids (sentinels like \"default\", or a session's own config) are\n * compatible everywhere — every harness honors its own configuration. */\nexport function isModelCompatibleWithHarness(harness: Harness, modelId: string): boolean {\n return harnessSupportsModel(harness, modelId)\n}\n\n/** Keep `modelId` when the harness can run it; else the harness's best compatible\n * catalog id (preferred patterns in order, highest version). When nothing in the\n * catalog fits, return the original so the caller sees the incompatibility. */\nexport function snapModelToHarness(harness: Harness, modelId: string, canonicalIds: readonly string[]): string {\n return aiSnapModelToHarness(harness, modelId, canonicalIds)\n}\n\n/** Keep the harness when it can run `modelId`; else the model's native harness\n * (anthropic → claude-code, openai → codex, moonshot → kimi-code), falling back to opencode. */\nexport function snapHarnessToModel(harness: Harness, modelId: string): Harness {\n const snapped = aiSnapHarnessToModel(harness, modelId)\n if (!isHarness(snapped)) {\n throw new Error(\n `Harness \"${harness}\" snapped to \"${snapped}\" for model \"${modelId}\", which this platform has no backend for.`,\n )\n }\n return snapped\n}\n\n/** Fail-loud server guard: throw when a harness is asked to run a model it can't.\n * A resolved model tuple supplies provider evidence when its id is unqualified.\n * Call before dispatching a sandbox turn so a bypassed UI cannot reach the\n * sidecar with an incompatible or unproven pair. */\nexport function assertHarnessModelCompatible(\n harness: Harness,\n selection: string | HarnessModelSelection,\n): void {\n const modelId = typeof selection === 'string' ? selection : selection.model\n const transportProvider = typeof selection === 'string' ? undefined : selection.provider\n const providers = harnessProviders(harness)\n const provider = modelProvider(modelId) ?? transportProvider ?? null\n // An omitted/default model is deliberately left to the harness. Once a\n // caller names a model, however, a vendor-locked harness must have provider\n // evidence. Interface owns which harnesses are locked: since 5.7 Claude Code\n // and Codex run any Router-served model, and kimi-code stays Moonshot-only.\n const isDefaultSentinel = modelId.trim() === '' || modelId.trim() === 'default'\n const compatible = isDefaultSentinel\n || providers === null\n || (provider !== null && providers.includes(provider))\n if (!compatible) {\n const native = preferredHarnessForModel(modelId)\n const providerDescription = provider ?? 'unqualified'\n throw new Error(\n `Harness \"${harness}\" cannot run model \"${modelId}\" (provider \"${providerDescription}\"). ` +\n `Use ${native ?? 'a router-backed harness (opencode)'} or an allowed model.`,\n )\n }\n}\n\n// Profile-support facts remain here until the materializer supplies its owned descriptor.\n// Do not confuse these facts with deployment availability.\n\n/** What a harness can express, for profile assembly. */\nexport interface HarnessCapabilities {\n /** Lower profile.subagents into native cwd files; false means materialization refuses them. */\n subagents: boolean\n /** How profile.mcp reaches the harness. */\n mcp: 'native' | 'config-file' | 'extension' | 'none'\n /** Whether tool controls are checked before MCP tools register. */\n toolControls: 'startup' | 'runtime'\n /** cwd-relative skill directory, or null when skills must be inlined. */\n skillsDir: string | null\n}\n\nconst HARNESS_CAPABILITIES: Record<Harness, HarnessCapabilities> = {\n 'claude-code': { subagents: true, mcp: 'native', toolControls: 'runtime', skillsDir: '.claude/skills' },\n nanoclaw: { subagents: true, mcp: 'native', toolControls: 'runtime', skillsDir: '.claude/skills' },\n opencode: { subagents: true, mcp: 'config-file', toolControls: 'runtime', skillsDir: '.opencode/skills' },\n codex: { subagents: true, mcp: 'config-file', toolControls: 'runtime', skillsDir: '.codex/skills' },\n 'kimi-code': { subagents: false, mcp: 'config-file', toolControls: 'runtime', skillsDir: '.kimi/skills' },\n pi: { subagents: false, mcp: 'extension', toolControls: 'startup', skillsDir: '.pi/skills' },\n prime: { subagents: true, mcp: 'native', toolControls: 'runtime', skillsDir: '.prime/agent/skills' },\n hermes: { subagents: false, mcp: 'native', toolControls: 'runtime', skillsDir: null },\n openclaw: { subagents: false, mcp: 'config-file', toolControls: 'runtime', skillsDir: 'skills' },\n acp: { subagents: false, mcp: 'native', toolControls: 'runtime', skillsDir: null },\n amp: { subagents: false, mcp: 'native', toolControls: 'runtime', skillsDir: null },\n 'factory-droids': { subagents: false, mcp: 'native', toolControls: 'runtime', skillsDir: null },\n forge: { subagents: false, mcp: 'native', toolControls: 'runtime', skillsDir: null },\n cursor: { subagents: false, mcp: 'native', toolControls: 'runtime', skillsDir: null },\n 'cli-base': { subagents: false, mcp: 'native', toolControls: 'runtime', skillsDir: null },\n}\n\n/** Profile-support facts, independent of whether this deployment enables the harness. */\nexport function harnessCapabilities(harness: Harness): HarnessCapabilities {\n const caps = HARNESS_CAPABILITIES[harness]\n if (!caps) throw new Error(`harnessCapabilities: no capability facts for \"${harness}\"`)\n return caps\n}\n\n// ── Session presets ────────────────────────────────────────────────────────\n//\n// Named (model, harness, effort) pins applied with catalog coherence through\n// the snap helpers above. The contract is semantics; the visual surface stays\n// with the picker canon.\nexport {\n applySessionPreset,\n createInMemorySessionPresetStore,\n validateSessionPreset,\n type AppliedSessionPreset,\n type SessionPreset,\n type SessionPresetCatalogContext,\n type SessionPresetStore,\n} from './presets'\n","/** Pure session admission. Harness identity is not deployment availability. */\nexport interface SelectionAvailability<H extends string> {\n /** Server-owned selection for new sessions. An empty list disables all starts. */\n readonly newSessions: readonly H[]\n /** Includes draining harnesses. Omission uses newSessions, never all known IDs. */\n readonly existingSessions?: readonly H[]\n}\n\nexport interface SessionHarnessSelectionInput<H extends string> {\n sessionHarness?: unknown\n requested?: unknown\n workspaceDefault?: unknown\n fallback?: H\n /** Omit only when the caller deliberately admits every known harness. */\n availability?: SelectionAvailability<H>\n}\n\nexport interface SessionHarnessSelection<H extends string> {\n harness: H\n locked: boolean\n swapAttempted: boolean\n}\n\ntype SelectionSource = 'session' | 'requested' | 'workspace' | 'fallback'\n\n/** An admission failure, never permission to retry on another harness. */\nexport class HarnessSelectionError extends Error {\n readonly code: 'harness_unknown' | 'harness_unavailable'\n readonly harness: string | null\n readonly source: SelectionSource\n\n constructor(\n code: 'harness_unknown' | 'harness_unavailable',\n value: unknown,\n source: SelectionSource,\n ) {\n const harness = typeof value === 'string' ? value : null\n super(`${code}: ${source} harness ${harness === null ? '<invalid>' : JSON.stringify(harness)}`)\n this.name = 'HarnessSelectionError'\n this.code = code\n this.harness = harness\n this.source = source\n }\n}\n\n/**\n * Null/undefined mean no choice. Every other value is an explicit choice and must\n * validate. A retired or unrecognized saved identity must never become a new session.\n * Availability is supplied by the authenticated server, not by a request body.\n */\nexport function selectSessionHarness<H extends string>(\n input: SessionHarnessSelectionInput<H>,\n knownHarnesses: readonly H[],\n defaultHarness: H,\n): SessionHarnessSelection<H> {\n const known = new Set<string>(knownHarnesses)\n const resolve = (value: unknown, source: SelectionSource): H => {\n if (typeof value !== 'string' || !known.has(value)) {\n throw new HarnessSelectionError('harness_unknown', value, source)\n }\n return value as H\n }\n const admit = (harness: H, source: SelectionSource, existing: boolean): void => {\n if (input.availability === undefined) return\n const allowed = existing\n ? input.availability.existingSessions ?? input.availability.newSessions\n : input.availability.newSessions\n if (!allowed.includes(harness)) {\n throw new HarnessSelectionError('harness_unavailable', harness, source)\n }\n }\n\n if (input.sessionHarness !== undefined && input.sessionHarness !== null) {\n const harness = resolve(input.sessionHarness, 'session')\n admit(harness, 'session', true)\n // A known different request remains a swap attempt; it is not executed. An\n // invalid request is refused rather than being misreported as no swap.\n const requested = input.requested === undefined || input.requested === null\n ? undefined : resolve(input.requested, 'requested')\n return { harness, locked: true, swapAttempted: requested !== undefined && requested !== harness }\n }\n\n const source: SelectionSource = input.requested !== undefined && input.requested !== null\n ? 'requested'\n : input.workspaceDefault !== undefined && input.workspaceDefault !== null\n ? 'workspace' : 'fallback'\n const value = source === 'requested' ? input.requested\n : source === 'workspace' ? input.workspaceDefault : input.fallback ?? defaultHarness\n const harness = resolve(value, source)\n admit(harness, source, false)\n return { harness, locked: false, swapAttempted: false }\n}\n","/**\n * Session presets — named (model, harness, effort) combinations a user pins\n * and applies in one action, beside the canonical session controls\n * (`/web-react`'s `AgentSessionControls`).\n *\n * The CONTRACT is coherence, not storage: a preset stores exact catalog ids,\n * and APPLYING it resolves through the harness module's snap helpers so the\n * result is never an invalid combination — if the catalog moved under a\n * pinned preset (model renamed, harness retired), apply snaps to the\n * harness's best compatible catalog option (or the model's native harness)\n * exactly like a manual picker change would, and reports what changed.\n * A preset naming a model the catalog no longer carries is REFUSED at\n * apply time, never silently substituted: a different model is a different\n * decision-maker.\n *\n * Storage is a port: products persist presets wherever they keep workspace\n * state (D1, KV, localStorage). The default store is in-memory for tests\n * and single-instance products — the same shape the self-mount verb uses.\n */\nimport { snapHarnessToModel, snapModelToHarness, type Harness } from './index'\n\n/** A pinned session configuration. `id` is the product's stable key. */\nexport interface SessionPreset {\n readonly id: string\n /** User-facing label; trimmed, non-empty, ≤ 60 chars. */\n readonly name: string\n /** Canonical catalog model id (\"provider/model\"). */\n readonly model: string\n /** Optional pinned harness; omitted = follow the model's native harness. */\n readonly harness?: Harness\n /** Optional pinned reasoning effort (the picker canon's effort levels). */\n readonly effort?: string\n}\n\n/** What applying a preset actually set, with every snap named. */\nexport interface AppliedSessionPreset {\n readonly model: string\n readonly harness: Harness\n readonly effort?: string\n /** Non-empty when the catalog moved under the pinned preset. */\n readonly snapped: ReadonlyArray<'model' | 'harness'>\n}\n\nexport interface SessionPresetCatalogContext {\n /** The catalog's canonical model ids. */\n readonly canonicalIds: readonly string[]\n}\n\n/** Validate one preset at save time: label budget, canonical model id, no\n * unknown fields smuggled in. Throws with the preset's name in the message. */\nexport function validateSessionPreset(preset: SessionPreset): SessionPreset {\n const name = preset.name.trim()\n if (!name) throw new Error('a session preset needs a name')\n if (name.length > 60) {\n throw new Error(`session preset \"${name.slice(0, 30)}…\" exceeds the 60-character name budget`)\n }\n if (!preset.model.trim()) throw new Error(`session preset \"${name}\" pins no model`)\n const allowed = new Set(['id', 'name', 'model', 'harness', 'effort'])\n for (const key of Object.keys(preset)) {\n if (!allowed.has(key)) throw new Error(`session preset \"${name}\" carries an unknown field \"${key}\"`)\n }\n return { ...preset, name }\n}\n\n/** Apply a preset with catalog coherence. Refused (thrown) when the pinned\n * model is gone from the catalog — never silently another model. */\nexport function applySessionPreset(\n preset: SessionPreset,\n context: SessionPresetCatalogContext,\n): AppliedSessionPreset {\n if (!context.canonicalIds.includes(preset.model)) {\n throw new Error(\n `session preset \"${preset.name}\" pins model \"${preset.model}\", which the catalog no longer carries — `\n + `delete or re-pin the preset (a different model is a different decision-maker)`,\n )\n }\n const snapped: Array<'model' | 'harness'> = []\n const pinnedHarness = preset.harness ?? snapHarnessToModel('opencode', preset.model)\n let model = preset.model\n let harness = pinnedHarness\n // The same two-way coherence the manual pickers enforce, in the preset's\n // own order: the pinned harness snaps the model if incompatible, then the\n // (possibly snapped) model snaps the harness back if it moved families.\n const harnessCompatibleModel = snapModelToHarness(harness, model, context.canonicalIds)\n if (harnessCompatibleModel !== model) {\n model = harnessCompatibleModel\n snapped.push('model')\n }\n const modelNativeHarness = snapHarnessToModel(harness, model)\n if (modelNativeHarness !== harness) {\n harness = modelNativeHarness\n snapped.push('harness')\n }\n return {\n model,\n harness,\n ...(preset.effort !== undefined ? { effort: preset.effort } : {}),\n snapped,\n }\n}\n\n/** Durable preset storage port. Products own persistence; the default is\n * non-durable for tests and single-instance products. */\nexport interface SessionPresetStore {\n list(): Promise<readonly SessionPreset[]>\n save(preset: SessionPreset): Promise<void>\n remove(id: string): Promise<void>\n}\n\nexport function createInMemorySessionPresetStore(): SessionPresetStore {\n const state = new Map<string, SessionPreset>()\n return {\n async list() { return [...state.values()].sort((a, b) => a.name.localeCompare(b.name)) },\n async save(preset) { state.set(preset.id, validateSessionPreset(preset)) },\n async remove(id) { state.delete(id) },\n }\n}\n\n/**\n * The composer/controls integration seam: presets render beside the canonical\n * pickers (picker-canon geometry) and apply through {@link applySessionPreset};\n * saving captures the CURRENT picker selection verbatim. The visual surface is\n * deliberately not owned here — the picker canon and the product's design\n * tokens define it; this module guarantees the semantics underneath.\n */\n"],"mappings":";AAaA,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,sBAAsB;AAAA,EACtB,sBAAsB;AAAA,OACjB;;;ACKA,IAAM,wBAAN,cAAoC,MAAM;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EAET,YACE,MACA,OACA,QACA;AACA,UAAM,UAAU,OAAO,UAAU,WAAW,QAAQ;AACpD,UAAM,GAAG,IAAI,KAAK,MAAM,YAAY,YAAY,OAAO,cAAc,KAAK,UAAU,OAAO,CAAC,EAAE;AAC9F,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,U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AW,OAAO,KAAK,UAAU,cAAc,WAAW,WAAW,KAAK;AAC1F;AAGO,SAAS,oBAAoB,SAAuC;AACzE,QAAM,OAAO,qBAAqB,OAAO;AACzC,MAAI,CAAC,KAAM,OAAM,IAAI,MAAM,iDAAiD,OAAO,GAAG;AACtF,SAAO;AACT;","names":["value","source","harness"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/skills-placement/index.ts"],"sourcesContent":["/**\n * Harness-native skill directory resolution — the one place agent-app binds\n * to the platform's authoritative per-harness skill-dir map.\n *\n * `../skills` renders skill CONTENT (parse, tier-filter, `inline`/`mounted`\n * delivery) but deliberately stops short of naming WHICH cwd path a `mounted`\n * skill lands at on a given harness — that mapping is owned by the platform\n * materializer (`@tangle-network/agent-profile-materialize`'s\n * `skillDirForHarness`), not by app-shell. This subpath exists so no product\n * — and no other agent-app module — ever writes a skill path literal\n * (`~/.claude/skills/...`, `.opencode/skills`, ...) of its own; it bridges\n * agent-app's `Harness` taxonomy onto the platform's `HarnessId` and asks the\n * platform for the answer.\n *\n * Requires the OPTIONAL peer `@tangle-network/agent-profile-materialize`.\n * Products that don't install it simply don't import this subpath — every\n * other agent-app skills surface (`../skills`, `ProfileChannels.skillRefs`)\n * works without it, falling back to `inline` delivery.\n */\n\nimport type { AgentProfile, AgentProfileFileMount } from '@tangle-network/agent-interface'\nimport { defineInlineResource } from '@tangle-network/agent-interface/profile'\nimport { KNOWN_HARNESSES, type Harness } from '../harness/index'\nimport { skillDirForHarness, type HarnessId } from '@tangle-network/agent-profile-materialize'\nimport { composeSkills, renderInlineSkills, type ComposedSkills, type SkillEntry } from '../skills/index'\n\n/** agent-app `Harness` -> platform `HarnessId`, identity-mapped for exactly\n * the harnesses the platform map covers. Harnesses absent here (`amp`,\n * `factory-droids`, `forge`, `acp`, `cursor`, `cli-base`) resolve to `null` —\n * {@link composeSkillsForHarness} refuses by default rather than silently\n * delivering `inline`; a caller that genuinely needs `inline` on one of\n * these opts in explicitly (`onNoSkillDir: 'inline'`). `cursor`'s adapter\n * supports `resources.skills` bespokely but isn't in the platform map yet;\n * treating it as unbridged is the safe posture until the map covers it,\n * rather than guessing its cwd skill dir here. */\nconst HARNESS_BRIDGE: Partial<Record<Harness, HarnessId>> = {\n opencode: 'opencode',\n 'claude-code': 'claude-code',\n nanoclaw: 'nanoclaw',\n 'kimi-code': 'kimi-code',\n codex: 'codex',\n pi: 'pi',\n prime: 'prime',\n hermes: 'hermes',\n openclaw: 'openclaw',\n}\n\n/** Resolve the cwd-relative skill dir `resources.skills` refs materialize\n * into on `harness` — via the platform's `skillDirForHarness`. `null` when\n * `harness` isn't bridged (see {@link HARNESS_BRIDGE}) or when the platform\n * itself has no cwd skill primitive for it (e.g. `hermes`, user-dir-only). */\nexport function resolveSkillDir(harness: Harness): string | null {\n const bridged = HARNESS_BRIDGE[harness]\n if (!bridged) return null\n return skillDirForHarness(bridged)\n}\n\n/** Filter `harnesses` down to those with no mounted skill dir (deduped,\n * first-seen order preserved) — the set that must fall back to `inline`\n * delivery, or that a caller should warn about before offering \"mounted\"\n * install UX. */\nexport function unsupportedSkillHarnesses(harnesses: Iterable<Harness>): Harness[] {\n const seen = new Set<Harness>()\n const out: Harness[] = []\n for (const harness of harnesses) {\n if (resolveSkillDir(harness) !== null) continue\n if (seen.has(harness)) continue\n seen.add(harness)\n out.push(harness)\n }\n return out\n}\n\n/** Inputs to {@link composeSkillsForHarness}. */\nexport interface ComposeSkillsForHarnessInput {\n skills: SkillEntry[]\n harness: Harness\n tier?: string\n heading?: string\n /**\n * What to do when `harness` has no native skill-mount directory (see\n * {@link resolveSkillDir}). Default `'throw'`: refuse rather than silently\n * inlining every skill BODY into the system prompt. Pass `'inline'` only as\n * a deliberate, auditable opt-in — the caller has decided every skill must\n * reach this harness even though it will be concatenated into the prompt.\n */\n onNoSkillDir?: 'throw' | 'inline'\n}\n\n/** `KNOWN_HARNESSES` filtered to those the platform materializer can mount\n * skill files onto natively (a non-null {@link resolveSkillDir}). Computed\n * fresh rather than cached — the platform map can grow without a release\n * here. Used only to build the actionable error in\n * {@link composeSkillsForHarness}; not exported because it duplicates\n * {@link unsupportedSkillHarnesses}'s complement and callers should reach\n * for that instead when they need the harness list at runtime. */\nfunction nativeSkillMountHarnesses(): Harness[] {\n return KNOWN_HARNESSES.filter((harness) => resolveSkillDir(harness) !== null)\n}\n\n/**\n * Compose {@link ComposedSkills} for `harness`.\n *\n * `mounted` delivery is the standard path: whenever the platform names a cwd\n * skill dir for `harness`, skills ride the typed `resources.skills` channel\n * and the platform materializer writes each one to that directory as a real\n * file — the agent reads it on demand with its own file tools.\n *\n * `inline` delivery — every skill BODY rendered straight into the system\n * prompt — is a NARROW fallback for harnesses with no native skill dir, never\n * a co-equal mode. An `AgentProfile` is a RECIPE that materializes into a\n * sandbox, not a prompt template: skill bodies belong in a file mount, and\n * `prompt.systemPrompt` should carry only what the agent must obey without a\n * tool call (identity, tool-call contract, safety rules, output format) plus\n * a short index of what's mounted. Concatenating skill bodies into the prompt\n * degrades the model toward empty answers once it grows large enough — one\n * product reproduced a 151,882-byte prompt exactly this way, from an\n * unnoticed inline fallback.\n *\n * Because of that, `onNoSkillDir` defaults to `'throw'`: a harness with no\n * skill dir refuses instead of silently inlining. The thrown error names the\n * harness, the skill count, the byte size that would have been inlined, and\n * the harnesses that DO support native mounting. Pass `onNoSkillDir:\n * 'inline'` only as a deliberate, auditable opt-in when every skill genuinely\n * must reach this harness regardless of prompt cost.\n *\n * The one function a product calls instead of hand-checking `resolveSkillDir`\n * and branching between {@link composeSkills}'s two modes itself.\n */\nexport function composeSkillsForHarness(input: ComposeSkillsForHarnessInput): ComposedSkills {\n const { skills, harness, tier, heading, onNoSkillDir = 'throw' } = input\n const skillDir = resolveSkillDir(harness)\n if (skillDir) return composeSkills({ skills, mode: 'mounted', skillDir, tier, heading })\n if (onNoSkillDir === 'inline') return composeSkills({ skills, mode: 'inline', tier, heading })\n\n const relevant = tier ? skills.filter((s) => s.tier === tier) : skills\n const promptSection = renderInlineSkills({ skills, tier, heading })\n const bytes = new TextEncoder().encode(promptSection).byteLength\n const mountable = nativeSkillMountHarnesses()\n throw new Error(\n `composeSkillsForHarness: \"${harness}\" has no native skill-mount directory. ` +\n `Inlining ${relevant.length} skill(s) (${bytes} bytes) into its system prompt would silently ` +\n `convert mounted skills into prompt text — a 151,882-byte prompt shipped this way once, and ` +\n `oversized prompts degrade toward empty answers. Mount the skills instead: pick a harness with ` +\n `native skill support (${mountable.join(', ')}), or pass onNoSkillDir: 'inline' to opt in ` +\n `explicitly and accept the inlined bytes.`,\n )\n}\n\nexport type { ComposedSkills, SkillEntry } from '../skills/index'\n\n/** A file that rides BESIDE a skill entry (kit sources, references, pinned\n * requirements — anything the SKILL.md tells the agent to read or run).\n * `path` is skill-dir-relative (`kit/iso-kit.mjs`, `references/x.md`). */\nexport interface SkillSupportFile {\n path: string\n content: string\n}\n\n/** Optional naming and reconciliation policies for skill support files. */\nexport interface SkillSupportFileOptions {\n /** Resource name for newly created mounts. Defaults to `<skillId>/<path>`. */\n resourceName?: (file: SkillSupportFile) => string\n /**\n * `retain` (default) keeps identical mounts at their desired paths.\n * `replace` removes owned mounts and appends canonical mounts in file order.\n * Foreign mounts always keep their paths. On a supported harness, if they\n * occupy every desired path, `replace` leaves the original profile unchanged.\n */\n reconcileExisting?: 'retain' | 'replace'\n}\n\n/** Inline file mounts placing a skill's support files beside its entry on\n * `harness`: `<skillDir>/<skillId>/<path>`. Empty when the harness has no\n * cwd skill dir — the same posture as `resources.skills` itself (the\n * platform skips skills there too), so nothing orphan lands in a workspace\n * a harness will never read.\n *\n * This is the placement primitive for kit-carrying skills (vendored\n * executable kits, reference trees). A growing program belongs in THESE\n * mounts — never in an env var: runtimeSecrets values are capped (8192\n * chars on the sandbox SDK) and a skill tree outgrew that cap in production\n * once, taking every isolated turn down with a secret-provider refusal. */\nexport function skillSupportFileMounts(\n harness: Harness,\n skillId: string,\n files: readonly SkillSupportFile[],\n options: Pick<SkillSupportFileOptions, 'resourceName'> = {},\n): AgentProfileFileMount[] {\n const skillDir = resolveSkillDir(harness)\n if (!skillDir || files.length === 0) return []\n return files.map((file) => ({\n path: `${skillDir}/${skillId}/${file.path}`,\n resource: defineInlineResource(\n options.resourceName ? options.resourceName(file) : `${skillId}/${file.path}`,\n file.content,\n ),\n }))\n}\n\n/** Attach a skill's support files to `profile` for `harness`, idempotently.\n *\n * Replacement is by EXACT CONTENT under the skill's own subtree (any path\n * ending `/<skillId>/<path>` whose bytes match a support file of THIS call):\n * re-deriving the same profile for another harness replaces this skill's\n * own mounts wherever they previously pointed, while pack-declared files\n * with similar paths stay untouched. With no skill dir the skill's own\n * mounts are dropped (and nothing added) — mirroring how the platform\n * treats the skill entry itself on that harness. `options` can customize\n * new resource names and opt into replacing owned mounts in file order. */\nexport function withSkillSupportFiles<\n P extends { resources?: AgentProfile['resources'] },\n>(\n profile: P,\n harness: Harness,\n skillId: string,\n files: readonly SkillSupportFile[],\n options: SkillSupportFileOptions = {},\n): P {\n const hasSkillDir = resolveSkillDir(harness) !== null\n const desired = skillSupportFileMounts(harness, skillId, files, options)\n const desiredByPath = new Map(\n desired.map((mount) => [mount.path, mount.resource] as const),\n )\n const byRelPath = new Map(files.map((file) => [file.path, file.content] as const))\n const suffix = `/${skillId}/`\n const relUnderSkill = (path: string): string | null => {\n const at = path.lastIndexOf(suffix)\n return at < 0 ? null : path.slice(at + suffix.length)\n }\n // \"Ours\" = a mount under THIS skill's subtree whose bytes match a support\n // file of this call. It is STALE when the harness has no skill dir (there\n // is nowhere to place it — mirroring how the platform skips the skill\n // entry itself) or when this call would place it at a different path\n // (re-derivation for another harness). Exact-content identity only: a\n // foreign mount at one of our paths keeps the location (pack-declared\n // files win at their declared paths). By default an identical mount is\n // kept as-is; the replace policy regenerates owned mounts in file order.\n const shouldDropMount = (mount: AgentProfileFileMount): boolean => {\n if (mount.resource.kind !== 'inline') return false\n const rel = relUnderSkill(mount.path)\n if (rel === null || byRelPath.get(rel) !== mount.resource.content) return false\n if (options.reconcileExisting === 'replace') return true\n const desiredHere = desiredByPath.get(mount.path)\n return (\n !hasSkillDir ||\n desiredHere === undefined ||\n desiredHere.kind !== 'inline' ||\n desiredHere.content !== mount.resource.content\n )\n }\n const existing = profile.resources?.files ?? []\n const retained = existing.filter((mount) => !shouldDropMount(mount))\n const taken = new Set(retained.map((mount) => mount.path))\n const additions = desired.filter((mount) => !taken.has(mount.path))\n // Preserve the replace policy's no-op when foreign mounts occupy every\n // destination; without a skill dir, owned mounts are still removed.\n if (additions.length === 0 && (\n retained.length === existing.length ||\n (hasSkillDir && options.reconcileExisting === 'replace')\n )) return profile\n return {\n ...profile,\n resources: { ...(profile.resources ?? {}), files: [...retained, ...additions] },\n }\n}\n"],"mappings":";;;;;;;;;AAqBA,SAAS,4BAA4B;AAErC,SAAS,0BAA0C;AAYnD,IAAM,iBAAsD;AAAA,EAC1D,UAAU;AAAA,EACV,eAAe;AAAA,EACf,UAAU;AAAA,EACV,aAAa;AAAA,EACb,OAAO;AAAA,EACP,IAAI;AAAA,EACJ,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,UAAU;AACZ;AAMO,SAAS,gBAAgB,SAAiC;AAC/D,QAAM,UAAU,eAAe,OAAO;AACtC,MAAI,CAAC,QAAS,QAAO;AACrB,SAAO,mBAAmB,OAAO;AACnC;AAMO,SAAS,0BAA0B,WAAyC;AACjF,QAAM,OAAO,oBAAI,IAAa;AAC9B,QAAM,MAAiB,CAAC;AACxB,aAAW,WAAW,WAAW;AAC/B,QAAI,gBAAgB,OAAO,MAAM,KAAM;AACvC,QAAI,KAAK,IAAI,OAAO,EAAG;AACvB,SAAK,IAAI,OAAO;AAChB,QAAI,KAAK,OAAO;AAAA,EAClB;AACA,SAAO;AACT;AAyBA,SAAS,4BAAuC;AAC9C,SAAO,gBAAgB,OAAO,CAAC,YAAY,gBAAgB,OAAO,MAAM,IAAI;AAC9E;AA+BO,SAAS,wBAAwB,OAAqD;AAC3F,QAAM,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NABLE_WORKSPACE_ROLES,
|
|
3
|
-
hasWorkspaceRole
|
|
4
|
-
} from "./chunk-6XIAPIW6.js";
|
|
5
|
-
|
|
6
|
-
// src/teams-react/components/RoleSelect.tsx
|
|
7
|
-
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@tangle-network/ui/primitives";
|
|
8
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
var ROLE_CAPABILITY = {
|
|
10
|
-
viewer: "Can view",
|
|
11
|
-
editor: "Can edit",
|
|
12
|
-
admin: "Can manage settings and people",
|
|
13
|
-
owner: "Owner"
|
|
14
|
-
};
|
|
15
|
-
var ROLE_DESCRIPTION = {
|
|
16
|
-
viewer: "Reads everything; can\u2019t chat or edit",
|
|
17
|
-
editor: "Also chats with the agent and edits",
|
|
18
|
-
admin: "Also invites people and sets roles"
|
|
19
|
-
};
|
|
20
|
-
function RoleSelect({ value, onChange, ariaLabel, id, disabled }) {
|
|
21
|
-
return /* @__PURE__ */ jsxs(Select, { value, onValueChange: (role) => onChange(role), disabled, children: [
|
|
22
|
-
/* @__PURE__ */ jsx(SelectTrigger, { id, "aria-label": ariaLabel, children: /* @__PURE__ */ jsx(SelectValue, { children: ROLE_CAPABILITY[value] }) }),
|
|
23
|
-
/* @__PURE__ */ jsx(SelectContent, { children: ASSIGNABLE_WORKSPACE_ROLES.map((role) => /* @__PURE__ */ jsxs(SelectItem, { value: role, textValue: ROLE_CAPABILITY[role], children: [
|
|
24
|
-
/* @__PURE__ */ jsx("span", { className: "block", children: ROLE_CAPABILITY[role] }),
|
|
25
|
-
/* @__PURE__ */ jsx("span", { className: "block font-normal text-muted-foreground", "data-role-description": true, children: ROLE_DESCRIPTION[role] })
|
|
26
|
-
] }, role)) })
|
|
27
|
-
] });
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// src/teams-react/components/member-access.ts
|
|
31
|
-
function canManageMember(member, currentRole, currentUserId) {
|
|
32
|
-
if (!hasWorkspaceRole(currentRole, "admin") || member.role === "owner" || member.inherited) return false;
|
|
33
|
-
return !isCurrentMember(member, currentUserId);
|
|
34
|
-
}
|
|
35
|
-
function isCurrentMember(member, currentUserId) {
|
|
36
|
-
return currentUserId != null && member.userId === currentUserId;
|
|
37
|
-
}
|
|
38
|
-
function memberRoleLabel(member) {
|
|
39
|
-
if (member.role === "owner") return member.inherited ? "Organization admin" : "Owner";
|
|
40
|
-
return ROLE_CAPABILITY[member.role];
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// src/teams-react/components/invitation-detail.ts
|
|
44
|
-
function shortDate(value) {
|
|
45
|
-
return new Date(value).toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
|
|
46
|
-
}
|
|
47
|
-
function invitationDetail(invitation, delivery = "email") {
|
|
48
|
-
const role = ROLE_CAPABILITY[invitation.permissions];
|
|
49
|
-
switch (invitation.status) {
|
|
50
|
-
case "accepted":
|
|
51
|
-
return invitation.acceptedAt ? `${role} \xB7 joined ${shortDate(invitation.acceptedAt)}` : `${role} \xB7 joined`;
|
|
52
|
-
case "pending": {
|
|
53
|
-
const sent = delivery === "link" ? null : invitation.emailStatus === "sent" ? "email sent" : invitation.emailStatus === "not_sent" ? "email not sent yet" : null;
|
|
54
|
-
return [role, sent, `expires ${shortDate(invitation.expiresAt)}`].filter(Boolean).join(" \xB7 ");
|
|
55
|
-
}
|
|
56
|
-
case "expired":
|
|
57
|
-
return `${role} \xB7 expired ${shortDate(invitation.expiresAt)}`;
|
|
58
|
-
case "revoked":
|
|
59
|
-
return `${role} \xB7 revoked`;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export {
|
|
64
|
-
RoleSelect,
|
|
65
|
-
canManageMember,
|
|
66
|
-
isCurrentMember,
|
|
67
|
-
memberRoleLabel,
|
|
68
|
-
invitationDetail
|
|
69
|
-
};
|
|
70
|
-
//# sourceMappingURL=chunk-YL5JDX7K.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/teams-react/components/RoleSelect.tsx","../src/teams-react/components/member-access.ts","../src/teams-react/components/invitation-detail.ts"],"sourcesContent":["/**\n * The role picker both team panels and the settings sections share: the ui\n * `Select`, with each role named by what it lets a person do and, in the open\n * list, one line on what it adds, so choosing one never needs a help page.\n * The trigger shows the name alone and fills its container; give the\n * container the width.\n */\n\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@tangle-network/ui/primitives'\nimport { ASSIGNABLE_WORKSPACE_ROLES, type AssignableWorkspaceRole, type WorkspaceRole } from '../../teams/roles'\n\n/** Each workspace role in the words a person decides by. */\nexport const ROLE_CAPABILITY: Record<WorkspaceRole, string> = {\n viewer: 'Can view',\n editor: 'Can edit',\n admin: 'Can manage settings and people',\n owner: 'Owner',\n}\n\n// What each assignable role adds, under its name in the open list; chatting\n// with the agent is what a viewer cannot do. Each line fits a phone-width\n// trigger, so the open list is never wider than the screen.\nconst ROLE_DESCRIPTION: Record<AssignableWorkspaceRole, string> = {\n viewer: 'Reads everything; can’t chat or edit',\n editor: 'Also chats with the agent and edits',\n admin: 'Also invites people and sets roles',\n}\n\nexport interface RoleSelectProps {\n value: WorkspaceRole\n onChange(role: WorkspaceRole): void\n /** Accessible name (no visible label — the panels label the row). */\n ariaLabel: string\n id?: string\n disabled?: boolean\n}\n\nexport function RoleSelect({ value, onChange, ariaLabel, id, disabled }: RoleSelectProps) {\n return (\n <Select value={value} onValueChange={(role) => onChange(role as WorkspaceRole)} disabled={disabled}>\n <SelectTrigger id={id} aria-label={ariaLabel}>\n <SelectValue>{ROLE_CAPABILITY[value]}</SelectValue>\n </SelectTrigger>\n <SelectContent>\n {ASSIGNABLE_WORKSPACE_ROLES.map((role) => (\n <SelectItem key={role} value={role} textValue={ROLE_CAPABILITY[role]}>\n <span className=\"block\">{ROLE_CAPABILITY[role]}</span>\n <span className=\"block font-normal text-muted-foreground\" data-role-description>{ROLE_DESCRIPTION[role]}</span>\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n )\n}\n","/**\n * Who may change a member's access, and the words for a role shown as text.\n * `MembersPanel` and the settings `MembersSection` both read these, so the two\n * member lists apply one rule.\n */\n\nimport { hasWorkspaceRole, type WorkspaceRole } from '../../teams/roles'\nimport type { MemberView } from '../contracts'\nimport { ROLE_CAPABILITY } from './RoleSelect'\n\n/**\n * Whether the viewer can change this member's role or remove them: an admin\n * can, except for an owner, an inherited organization admin, or their own row,\n * so no one demotes or removes themselves from a list.\n */\nexport function canManageMember(member: MemberView, currentRole: WorkspaceRole, currentUserId?: string | null): boolean {\n if (!hasWorkspaceRole(currentRole, 'admin') || member.role === 'owner' || member.inherited) return false\n return !isCurrentMember(member, currentUserId)\n}\n\n/** True on the viewer's own row. */\nexport function isCurrentMember(member: MemberView, currentUserId?: string | null): boolean {\n return currentUserId != null && member.userId === currentUserId\n}\n\n/** A role shown as text rather than a picker. */\nexport function memberRoleLabel(member: MemberView): string {\n if (member.role === 'owner') return member.inherited ? 'Organization admin' : 'Owner'\n return ROLE_CAPABILITY[member.role]\n}\n","/** The line under an invitation's address, shared by `InvitationsPanel` and the settings `InvitationsSection`. */\n\nimport type { InvitationDelivery } from '../../teams/invitations'\nimport type { InvitationView } from '../contracts'\nimport { ROLE_CAPABILITY } from './RoleSelect'\n\nfunction shortDate(value: Date | number | string): string {\n return new Date(value).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })\n}\n\n/**\n * The line under the address: what the invitee can do, then only what is true\n * of this invitation now. Every status says itself in words, so a past\n * invitation reads as joined, expired or revoked without a badge. A link-only\n * invitation never mentions email.\n */\nexport function invitationDetail(invitation: InvitationView, delivery: InvitationDelivery = 'email'): string {\n const role = ROLE_CAPABILITY[invitation.permissions]\n switch (invitation.status) {\n case 'accepted':\n return invitation.acceptedAt ? `${role} · joined ${shortDate(invitation.acceptedAt)}` : `${role} · joined`\n case 'pending': {\n const sent = delivery === 'link' ? null : invitation.emailStatus === 'sent' ? 'email sent' : invitation.emailStatus === 'not_sent' ? 'email not sent yet' : null\n return [role, sent, `expires ${shortDate(invitation.expiresAt)}`].filter(Boolean).join(' · ')\n }\n case 'expired':\n return `${role} · expired ${shortDate(invitation.expiresAt)}`\n case 'revoked':\n return `${role} · revoked`\n }\n}\n"],"mappings":";;;;;;AAQA,SAAS,QAAQ,eAAe,YAAY,eAAe,mBAAmB;AAiCtE,cAIE,YAJF;AA7BD,IAAM,kBAAiD;AAAA,EAC5D,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AACT;AAKA,IAAM,mBAA4D;AAAA,EAChE,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AACT;AAWO,SAAS,WAAW,EAAE,OAAO,UAAU,WAAW,IAAI,SAAS,GAAoB;AACxF,SACE,qBAAC,UAAO,OAAc,eAAe,CAAC,SAAS,SAAS,IAAqB,GAAG,UAC9E;AAAA,wBAAC,iBAAc,IAAQ,cAAY,WACjC,8BAAC,eAAa,0BAAgB,KAAK,GAAE,GACvC;AAAA,IACA,oBAAC,iBACE,qCAA2B,IAAI,CAAC,SAC/B,qBAAC,cAAsB,OAAO,MAAM,WAAW,gBAAgB,IAAI,GACjE;AAAA,0BAAC,UAAK,WAAU,SAAS,0BAAgB,IAAI,GAAE;AAAA,MAC/C,oBAAC,UAAK,WAAU,2CAA0C,yBAAqB,MAAE,2BAAiB,IAAI,GAAE;AAAA,SAFzF,IAGjB,CACD,GACH;AAAA,KACF;AAEJ;;;ACtCO,SAAS,gBAAgB,QAAoB,aAA4B,eAAwC;AACtH,MAAI,CAAC,iBAAiB,aAAa,OAAO,KAAK,OAAO,SAAS,WAAW,OAAO,UAAW,QAAO;AACnG,SAAO,CAAC,gBAAgB,QAAQ,aAAa;AAC/C;AAGO,SAAS,gBAAgB,QAAoB,eAAwC;AAC1F,SAAO,iBAAiB,QAAQ,OAAO,WAAW;AACpD;AAGO,SAAS,gBAAgB,QAA4B;AAC1D,MAAI,OAAO,SAAS,QAAS,QAAO,OAAO,YAAY,uBAAuB;AAC9E,SAAO,gBAAgB,OAAO,IAAI;AACpC;;;ACvBA,SAAS,UAAU,OAAuC;AACxD,SAAO,IAAI,KAAK,KAAK,EAAE,mBAAmB,SAAS,EAAE,OAAO,SAAS,KAAK,WAAW,MAAM,UAAU,CAAC;AACxG;AAQO,SAAS,iBAAiB,YAA4B,WAA+B,SAAiB;AAC3G,QAAM,OAAO,gBAAgB,WAAW,WAAW;AACnD,UAAQ,WAAW,QAAQ;AAAA,IACzB,KAAK;AACH,aAAO,WAAW,aAAa,GAAG,IAAI,gBAAa,UAAU,WAAW,UAAU,CAAC,KAAK,GAAG,IAAI;AAAA,IACjG,KAAK,WAAW;AACd,YAAM,OAAO,aAAa,SAAS,OAAO,WAAW,gBAAgB,SAAS,eAAe,WAAW,gBAAgB,aAAa,uBAAuB;AAC5J,aAAO,CAAC,MAAM,MAAM,WAAW,UAAU,WAAW,SAAS,CAAC,EAAE,EAAE,OAAO,OAAO,EAAE,KAAK,QAAK;AAAA,IAC9F;AAAA,IACA,KAAK;AACH,aAAO,GAAG,IAAI,iBAAc,UAAU,WAAW,SAAS,CAAC;AAAA,IAC7D,KAAK;AACH,aAAO,GAAG,IAAI;AAAA,EAClB;AACF;","names":[]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The teams panels that Tax, Legal and GTM render today, each in a card the
|
|
3
|
-
* way those pages draw them, so the story and the browser proof can check
|
|
4
|
-
* that the role picker, Remove and Invite stay inside the card at phone width.
|
|
5
|
-
* As `admin` the viewer is Amir, an admin whose own row offers no role change
|
|
6
|
-
* or removal.
|
|
7
|
-
*/
|
|
8
|
-
declare const VIEWERS: {
|
|
9
|
-
readonly owner: {
|
|
10
|
-
readonly currentRole: 'owner';
|
|
11
|
-
readonly currentUserId: 'usr-dana';
|
|
12
|
-
};
|
|
13
|
-
readonly admin: {
|
|
14
|
-
readonly currentRole: 'admin';
|
|
15
|
-
readonly currentUserId: 'usr-amir';
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export declare function TeamPanelsDemo({ viewer }: {
|
|
19
|
-
viewer?: keyof typeof VIEWERS;
|
|
20
|
-
}): import("react").JSX.Element;
|
|
21
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Email-invitation panel: invite by email + role, and a history of every
|
|
3
|
-
* invitation (pending / accepted / expired / revoked) with its email-delivery
|
|
4
|
-
* status. Pending rows expose copy-link / resend / revoke. Fully callback-driven
|
|
5
|
-
* — the host supplies the data and the async `onInvite` / `onResend` / `onRevoke`
|
|
6
|
-
* callbacks (backed by `./teams/invitations-api`), so this imports no app router,
|
|
7
|
-
* fetch client, or toast. Styled with the shipped Tangle Quiet tokens (`var(--*)`).
|
|
8
|
-
*
|
|
9
|
-
* Mount alongside a list-only `MembersPanel` (`showInviteForm={false}`): the
|
|
10
|
-
* members panel shows accepted members, this owns the invite flow + pending list.
|
|
11
|
-
*/
|
|
12
|
-
import type { InvitationsPanelProps } from '../contracts.js';
|
|
13
|
-
export declare function InvitationsPanel({ invitations, currentRole, onInvite, onResend, onRevoke, onCopy, onNotice, }: InvitationsPanelProps): import("react").JSX.Element;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The invite-by-email row both team panels share: address, role, Invite. The
|
|
3
|
-
* address is checked with the same rule the invitations API enforces, so
|
|
4
|
-
* Invite stays disabled until the address could be delivered to, and the
|
|
5
|
-
* reason appears under the field once the person leaves it or tries to send.
|
|
6
|
-
* On a narrow card the field, the role and Invite stack, the role at full
|
|
7
|
-
* width so its longest name fits, and nothing passes the card's edge.
|
|
8
|
-
*/
|
|
9
|
-
import type { WorkspaceRole } from '../../teams/roles.js';
|
|
10
|
-
interface InviteFormProps {
|
|
11
|
-
label: string;
|
|
12
|
-
placeholder: string;
|
|
13
|
-
/** Send the invite; resolve true to clear the field, false to keep it for a retry. */
|
|
14
|
-
onInvite(input: {
|
|
15
|
-
email: string;
|
|
16
|
-
role: WorkspaceRole;
|
|
17
|
-
}): Promise<boolean>;
|
|
18
|
-
}
|
|
19
|
-
export declare function InviteForm({ label, placeholder, onInvite }: InviteFormProps): import("react").JSX.Element;
|
|
20
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workspace members panel: list members, invite by email + role, change a
|
|
3
|
-
* member's role, remove a member. Fully callback-driven — the host supplies the
|
|
4
|
-
* data and the async `onInvite`/`onChangeRole`/`onRemove` callbacks (backed by
|
|
5
|
-
* `./teams/members-api`), so this imports no app router, fetch client, or toast.
|
|
6
|
-
* Styled with the shipped Tangle Quiet tokens (`var(--*)`).
|
|
7
|
-
*
|
|
8
|
-
* Role gating mirrors the API and `MembersSection` (`canManageMember`): only
|
|
9
|
-
* admins/owners see role selects and the remove control; inherited org owners,
|
|
10
|
-
* explicit owners and the viewer's own row are not editable here. The invite
|
|
11
|
-
* role select offers `admin` only to admins/owners.
|
|
12
|
-
*
|
|
13
|
-
* Below 36rem of panel a member's role picker takes its own full-width line
|
|
14
|
-
* under the name, and Remove stays beside the name, so the longest capability
|
|
15
|
-
* name fits and nothing passes the card's edge.
|
|
16
|
-
*/
|
|
17
|
-
import type { MembersPanelProps } from '../contracts.js';
|
|
18
|
-
export declare function MembersPanel({ members, currentRole, currentUserId, onInvite, onChangeRole, onRemove, onNotice, showInviteForm, }: MembersPanelProps): import("react").JSX.Element;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|