Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions dist/manifest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,21 @@ export type ExtensionContributions = {
settings?: ExtensionSettingContribution[];
keybindings?: ExtensionKeybindingContribution[];
};
/** A power requested beyond the always-granted Tier-0 API. Granted at install. */
export type ExtensionCapability = 'workspace.observe' | 'sessions.observe' | 'panes.observe' | 'fs.read' | 'transcript.read' | 'git.read' | 'sessions.prompt' | 'fs.write' | 'git.commit' | 'network.fetch';
/**
* A power requested beyond the always-granted Tier-0 API. Granted at install.
*
* ── THIS LIST MUST MATCH WHAT THE HOST IMPLEMENTS, NOT WHAT IT PLANS TO ──
* It previously also declared fs.read, transcript.read, git.read, sessions.prompt,
* fs.write, git.commit and network.fetch. None of them were implemented anywhere:
* no request method could carry them, no broker arm performed them, and the host
* now REFUSES to install a manifest that asks for one.
*
* Keeping them here was worse than useless. This package exists so an author gets
* a type error instead of a runtime surprise — and it delivered the exact opposite:
* `permissions: ['fs.write']` type-checked cleanly and then failed the install.
* A capability belongs in this union only once the host can actually perform it.
*/
export type ExtensionCapability = 'workspace.observe' | 'sessions.observe' | 'panes.observe';
export type ExtensionActivationEvent = 'onStartupFinished' | '*' | `onCommand:${string}` | `onView:${string}`;
export type ExtensionManifest = {
id: string;
Expand Down
6 changes: 5 additions & 1 deletion dist/vite-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
// dev guards throw at activate() unless it is defined at build time.
//
// Usage — vite.config.ts:
// import { extensionViteConfig } from 'agent-code-extension-api/vite'
// import { extensionViteConfig } from 'agent-code-extension-api'
// export default extensionViteConfig()
//
// NOTE the specifier: the package exposes exactly ONE export path ("." in
// package.json), so the `/vite` subpath this comment used to name resolves to
// nothing — an author copying it got a module-not-found before their first build.
/** A plain object matching Vite's `UserConfig` shape — returned untyped so this
* package need not depend on vite. Spread/return it from vite.config.ts. */
export function extensionViteConfig(options = {}) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "agent-code-extension-api",
"version": "0.2.0",
"version": "0.3.0",
"description": "Types and authoring helpers for building Agent Code extensions.",
"type": "module",
"main": "dist/index.js",
Expand Down
27 changes: 15 additions & 12 deletions src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,21 @@ export type ExtensionContributions = {
keybindings?: ExtensionKeybindingContribution[]
}

/** A power requested beyond the always-granted Tier-0 API. Granted at install. */
export type ExtensionCapability =
| 'workspace.observe'
| 'sessions.observe'
| 'panes.observe'
| 'fs.read'
| 'transcript.read'
| 'git.read'
| 'sessions.prompt'
| 'fs.write'
| 'git.commit'
| 'network.fetch'
/**
* A power requested beyond the always-granted Tier-0 API. Granted at install.
*
* ── THIS LIST MUST MATCH WHAT THE HOST IMPLEMENTS, NOT WHAT IT PLANS TO ──
* It previously also declared fs.read, transcript.read, git.read, sessions.prompt,
* fs.write, git.commit and network.fetch. None of them were implemented anywhere:
* no request method could carry them, no broker arm performed them, and the host
* now REFUSES to install a manifest that asks for one.
*
* Keeping them here was worse than useless. This package exists so an author gets
* a type error instead of a runtime surprise — and it delivered the exact opposite:
* `permissions: ['fs.write']` type-checked cleanly and then failed the install.
* A capability belongs in this union only once the host can actually perform it.
*/
export type ExtensionCapability = 'workspace.observe' | 'sessions.observe' | 'panes.observe'

export type ExtensionActivationEvent =
| 'onStartupFinished'
Expand Down
6 changes: 5 additions & 1 deletion src/vite-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@
// dev guards throw at activate() unless it is defined at build time.
//
// Usage — vite.config.ts:
// import { extensionViteConfig } from 'agent-code-extension-api/vite'
// import { extensionViteConfig } from 'agent-code-extension-api'
// export default extensionViteConfig()
//
// NOTE the specifier: the package exposes exactly ONE export path ("." in
// package.json), so the `/vite` subpath this comment used to name resolves to
// nothing — an author copying it got a module-not-found before their first build.

export type ExtensionViteOptions = {
/** Entry module path. Default: 'src/index.ts'. Must match manifest `entry` once built. */
Expand Down