Skip to content
Merged
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
342 changes: 342 additions & 0 deletions lib/client.js

Large diffs are not rendered by default.

23 changes: 22 additions & 1 deletion lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* @module dsh-github
*/
import type { Context } from '@deepseek-ai/cordis';
import z from '@deepseek-ai/schemastery';
import { type GitRunner } from './git.js';
import { type GhRunner } from './credential.js';
import { Config, type Config as PluginConfig } from './config.js';
Expand All @@ -34,6 +35,25 @@ export declare const name = "dsh-github";
export declare const inject: string[];
export { Config };
export type { Config as PluginConfig };
/**
* User-settings namespace owned by this plugin. The card in the "Plugins"
* settings section edits this namespace; the GitHub token itself travels
* through the credentials seam (never a settings field), addressed by
* {@link GithubSettingsSchema.tokenRef}.
*/
export declare const GITHUB_SETTINGS_NAMESPACE: import("@deepseek-ai/dsh-settings").SettingsNamespace;
/**
* Settings surface for the browser configuration card. Only the fields that
* make sense to edit from the settings page are exposed here; every other
* tunable stays a cordis.yml entry config field.
*/
export declare const GithubSettingsSchema: z<Schemastery.ObjectS<{
tokenRef: z<string, string>;
tokenSource: z<"auto" | "credentials" | "env" | "gh", "auto" | "credentials" | "env" | "gh">;
}>, Schemastery.ObjectT<{
tokenRef: z<string, string>;
tokenSource: z<"auto" | "credentials" | "env" | "gh", "auto" | "credentials" | "env" | "gh">;
}>>;
/** Environment-dependent runners, injectable for tests. */
export interface PluginDeps {
runGit?: GitRunner;
Expand All @@ -53,7 +73,8 @@ export interface PluginDeps {
*/
export declare function applyWithDeps(ctx: Context, config: PluginConfig, deps?: PluginDeps): void;
/**
* Apply the plugin: register tools, commands, and the write-approval gate.
* Apply the plugin: register tools, commands, the write-approval gate, and the
* user-settings namespace backing the browser configuration card.
* @param ctx - plugin context; the injected services are ready at this point.
* @param config - validated Schemastery configuration (defaults applied).
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 29 additions & 1 deletion lib/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/index.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions lib/types/client.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Browser half of `@perrylink/dsh-github` — the GitHub token configuration
* card contributed to the "Plugins" settings section.
* @module @perrylink/dsh-github/client
*/
import type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client';
/** Required services (cordis fiber inject). */
export declare const inject: string[];
/**
* Mount the GitHub configuration card into the plugins settings section.
* @param ctx - the browser plugin context.
*/
export declare function apply(ctx: ClientContext): void;
18 changes: 17 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
".": {
"types": "./lib/index.d.ts",
"import": "./lib/index.js"
}
},
"./client": {
"types": "./lib/types/client.d.ts",
"default": "./lib/client.js"
},
"./package.json": "./package.json"
},
"files": [
"lib",
Expand Down Expand Up @@ -60,6 +65,15 @@
"dsh": {
"bundle": {
"patch": "./cordis.patch.yml"
},
"client": {
"inject": [
"@deepseek-ai/dsh-client-connection",
"@deepseek-ai/dsh-client-locale",
"@deepseek-ai/dsh-client-runtime",
"@deepseek-ai/dsh-client-ui-slots"
],
"platform": "web"
}
},
"dshWorkshop": {
Expand Down Expand Up @@ -109,6 +123,7 @@
"@deepseek-ai/dsh-credentials": ">=0.1.0-rc.8 <0.2.0",
"@deepseek-ai/dsh-llm": ">=0.1.0-rc.8 <0.2.0",
"@deepseek-ai/dsh-session": ">=0.1.0-rc.8 <0.2.0",
"@deepseek-ai/dsh-settings": ">=0.1.0-rc.8 <0.2.0",
"@deepseek-ai/dsh-tools": ">=0.1.0-rc.8 <0.2.0"
},
"devDependencies": {
Expand All @@ -117,6 +132,7 @@
"@deepseek-ai/dsh-credentials": "0.1.0-rc.8",
"@deepseek-ai/dsh-llm": "0.1.0-rc.8",
"@deepseek-ai/dsh-session": "0.1.0-rc.8",
"@deepseek-ai/dsh-settings": "0.1.0-rc.8",
"@deepseek-ai/dsh-tools": "0.1.0-rc.8",
"@deepseek-ai/schemastery": "3.18.1",
"@types/node": "^22.0.0",
Expand Down
Loading
Loading