Don't write ahp commit hash to every file (#305695)

* Don't write ahp commit hash to every file

Co-authored-by: Copilot <copilot@github.com>

* undo

---------

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Rob Lourens
2026-03-27 08:54:33 -07:00
committed by GitHub
parent 9b0dd7c567
commit 492790d5ca
11 changed files with 17 additions and 12 deletions

View File

@@ -172,7 +172,7 @@ function mergeDuplicateImports(content: string): string {
function processFile(src: string, dest: string, commitHash: string): void {
function processFile(src: string, dest: string): void {
let content = fs.readFileSync(src, 'utf-8');
content = stripExistingHeader(content);
@@ -182,7 +182,7 @@ function processFile(src: string, dest: string, commitHash: string): void {
content = convertIndentation(content);
content = content.split('\n').map(line => line.trimEnd()).join('\n');
const header = `${COPYRIGHT}\n\n${BANNER}\n// Synced from agent-host-protocol @ ${commitHash}\n`;
const header = `${COPYRIGHT}\n\n${BANNER}\n`;
content = header + '\n' + content;
if (!content.endsWith('\n')) {
@@ -219,9 +219,14 @@ function main() {
console.error(` SKIP (not found): ${file.src}`);
continue;
}
processFile(srcPath, file.dest, commitHash);
processFile(srcPath, file.dest);
}
// Write the source commit hash to a single version file
const versionFile = path.join(DEST_DIR, '.ahp-version');
fs.writeFileSync(versionFile, commitHash + '\n', 'utf-8');
console.log(` .ahp-version -> ${commitHash}`);
console.log();
console.log('Done.');
}

View File

@@ -0,0 +1 @@
101c091

View File

@@ -5,7 +5,6 @@
// allow-any-unicode-comment-file
// DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts
// Synced from agent-host-protocol @ 32572fc
// Generated from types/actions.ts — do not edit
// Run `npm run generate` to regenerate.

View File

@@ -5,7 +5,6 @@
// allow-any-unicode-comment-file
// DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts
// Synced from agent-host-protocol @ 32572fc
import { ToolCallConfirmationReason, ToolCallCancellationReason, PendingMessageKind, type URI, type StringOrMarkdown, type IAgentInfo, type IErrorInfo, type IUserMessage, type IResponsePart, type IToolCallResult, type IToolDefinition, type ISessionActiveClient, type IUsageInfo, type ISessionCustomization } from './state.js';

View File

@@ -5,7 +5,6 @@
// allow-any-unicode-comment-file
// DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts
// Synced from agent-host-protocol @ 32572fc
import type { URI, ISnapshot, ISessionSummary, ITurn } from './state.js';
import type { IActionEnvelope, IStateAction } from './actions.js';

View File

@@ -5,7 +5,6 @@
// allow-any-unicode-comment-file
// DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts
// Synced from agent-host-protocol @ 32572fc
// ─── Standard JSON-RPC Codes ─────────────────────────────────────────────────

View File

@@ -5,7 +5,6 @@
// allow-any-unicode-comment-file
// DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts
// Synced from agent-host-protocol @ 32572fc
import type { IInitializeParams, IInitializeResult, IReconnectParams, IReconnectResult, ISubscribeParams, ISubscribeResult, ICreateSessionParams, IDisposeSessionParams, IListSessionsParams, IListSessionsResult, IFetchContentParams, IFetchContentResult, IBrowseDirectoryParams, IBrowseDirectoryResult, IFetchTurnsParams, IFetchTurnsResult, IUnsubscribeParams, IDispatchActionParams, IAuthenticateParams, IAuthenticateResult } from './commands.js';

View File

@@ -5,7 +5,6 @@
// allow-any-unicode-comment-file
// DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts
// Synced from agent-host-protocol @ 32572fc
import type { URI, ISessionSummary } from './state.js';

View File

@@ -5,7 +5,6 @@
// allow-any-unicode-comment-file
// DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts
// Synced from agent-host-protocol @ 32572fc
import { ActionType } from './actions.js';
import { SessionLifecycle, SessionStatus, TurnState, ToolCallStatus, ToolCallConfirmationReason, ToolCallCancellationReason, ResponsePartKind, PendingMessageKind, type IRootState, type ISessionState, type IToolCallState, type IResponsePart, type IToolCallResponsePart, type ITurn, type IPendingMessage } from './state.js';

View File

@@ -5,7 +5,6 @@
// allow-any-unicode-comment-file
// DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts
// Synced from agent-host-protocol @ 32572fc
// ─── Type Aliases ────────────────────────────────────────────────────────────
@@ -875,6 +874,14 @@ export interface ICustomizationRef {
description?: string;
/** Icons for the plugin */
icons?: Icon[];
/**
* Opaque version token for this customization.
*
* Clients SHOULD include a nonce with every customization they provide.
* Consumers can compare nonces to detect whether a customization has
* changed since it was last seen, avoiding redundant reloads or copies.
*/
nonce?: string;
}
/**

View File

@@ -5,7 +5,6 @@
// allow-any-unicode-comment-file
// DO NOT EDIT -- auto-generated by scripts/sync-agent-host-protocol.ts
// Synced from agent-host-protocol @ 32572fc
import { ActionType, type IStateAction } from '../actions.js';
import { NotificationType, type IProtocolNotification } from '../notifications.js';