PerryLink/dsh-os--packages-contract ↗★ 1

@perrylink/dsh-os-contract

Canonical service names, capabilities, error codes, refs, result/error/audit protocol helpers and thin validators shared by dsh-os modules.

패키지
@perrylink/dsh-os-contract
호환성
미검증
버전
0.2.0
라이선스
MIT
최근 업데이트
2026. 11. 21.

설치

검증된 bundle이 없거나 호환성 검사에 실패했습니다. 먼저 저장소 설명을 읽어 주세요. 전체 README 읽기 ↗

Usage

import {
  CAPABILITIES,
  ERROR_CODES,
  SERVICES,
  assertManifest,
  defineTool,
  isOsObject,
  makeRef,
  parseRef,
} from '@perrylink/dsh-os-contract'

SERVICES.trigger // 'triggers' → the module provides ctx.triggers
CAPABILITIES[0] // 'fs.read'
ERROR_CODES.E_NOT_FOUND // 'E_NOT_FOUND'

makeRef('memory', 'm-1') // 'dsh://memory/m-1'
parseRef('dsh://memory/m-1') // { kind: 'memory', id: 'm-1' }

isOsObject({ id: 'm-1', createdAt: Date.now() }) // true

assertManifest(pkg) // returns pkg, or throws E_INVALID_ARGUMENT

const tool = defineTool({
  name: 'snip_search',
  description: 'Search snippets.',
  parameters: { type: 'object', additionalProperties: false, properties: {} },
  output: {
    schema: { type: 'object', additionalProperties: true },
    render: (_args, value) => [{ type: 'text', text: JSON.stringify(value) }],
  },
  async execute(args) {
    return { items: [] }
  },
})