@namzu/sdk 64.1.0 → 64.2.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/CHANGELOG.md +6 -0
- package/dist/public-runtime.d.ts +1 -1
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +1 -1
- package/dist/public-runtime.js.map +1 -1
- package/dist/runtime/query/executor.d.ts +3 -1
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +1 -0
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +17 -0
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/tooling.d.ts +3 -1
- package/dist/runtime/query/tooling.d.ts.map +1 -1
- package/dist/runtime/query/tooling.js +3 -0
- package/dist/runtime/query/tooling.js.map +1 -1
- package/dist/tools/builtins/skill.d.ts.map +1 -1
- package/dist/tools/builtins/skill.js +21 -1
- package/dist/tools/builtins/skill.js.map +1 -1
- package/dist/types/session/records.d.ts +73 -1
- package/dist/types/session/records.d.ts.map +1 -1
- package/dist/types/session/records.js +25 -0
- package/dist/types/session/records.js.map +1 -1
- package/dist/types/tool/index.d.ts +29 -0
- package/dist/types/tool/index.d.ts.map +1 -1
- package/dist/types/tool/index.js.map +1 -1
- package/package.json +1 -1
- package/src/public-runtime.ts +1 -0
- package/src/runtime/query/executor.ts +4 -0
- package/src/runtime/query/index.ts +16 -0
- package/src/runtime/query/tooling.ts +11 -1
- package/src/tools/builtins/skill.ts +23 -1
- package/src/types/session/records.ts +28 -0
- package/src/types/tool/index.ts +31 -0
|
@@ -660,6 +660,31 @@ export const OutcomeProgressWrittenRecordSchema = inTurn('outcome_progress_writt
|
|
|
660
660
|
progress: outcomeBody,
|
|
661
661
|
})
|
|
662
662
|
|
|
663
|
+
/**
|
|
664
|
+
* A skill's hooks were attached to the conversation (or refused) when the model
|
|
665
|
+
* loaded it. Written by the `skill` tool's host in the turn that loaded it,
|
|
666
|
+
* flagged `ignorable`: a release that does not know the type skips it, keeps it
|
|
667
|
+
* in the hash chain and folds the conversation as before, and a host that does
|
|
668
|
+
* know it attaches the skill's hooks again when the conversation is continued
|
|
669
|
+
* (`docs/sdk/hooks.md`, "Hooks in a skill"). Never a field of a record that
|
|
670
|
+
* existed before it, for the reason the outcome records give above.
|
|
671
|
+
*
|
|
672
|
+
* Carries the turn's id when the skill was loaded in a turn, and none when a
|
|
673
|
+
* copy of a conversation (a fork) carries the record over.
|
|
674
|
+
*
|
|
675
|
+
* `directory` is the skill's own folder, `grantsWithheld` whether its
|
|
676
|
+
* `allowed-tools` were left unapproved, and `toolCallId` the `skill` call that
|
|
677
|
+
* loaded it, so a copy of a conversation that stops before that call can leave
|
|
678
|
+
* the record behind.
|
|
679
|
+
*/
|
|
680
|
+
export const SkillHooksAttachedRecordSchema = recordSchema('skill_hooks_attached', {
|
|
681
|
+
ignorable: z.literal(true),
|
|
682
|
+
skill: text.min(1),
|
|
683
|
+
directory: text.min(1),
|
|
684
|
+
grantsWithheld: z.boolean(),
|
|
685
|
+
toolCallId: text.min(1).optional(),
|
|
686
|
+
})
|
|
687
|
+
|
|
663
688
|
export const LogRepairedRecordSchema = recordSchema('log_repaired', {
|
|
664
689
|
truncatedBytes: positive,
|
|
665
690
|
lastGoodSeq: positive,
|
|
@@ -702,6 +727,7 @@ const RECORD_ONLY_SCHEMAS = {
|
|
|
702
727
|
turn_outcome_recorded: TurnOutcomeRecordedRecordSchema,
|
|
703
728
|
child_outcome_recorded: ChildOutcomeRecordedRecordSchema,
|
|
704
729
|
outcome_progress_written: OutcomeProgressWrittenRecordSchema,
|
|
730
|
+
skill_hooks_attached: SkillHooksAttachedRecordSchema,
|
|
705
731
|
} as const
|
|
706
732
|
|
|
707
733
|
export type SessionRecordOnlyType = keyof typeof RECORD_ONLY_SCHEMAS
|
|
@@ -1124,6 +1150,7 @@ export type LogRepairedRecord = z.infer<typeof LogRepairedRecordSchema>
|
|
|
1124
1150
|
export type TurnOutcomeRecordedRecord = z.infer<typeof TurnOutcomeRecordedRecordSchema>
|
|
1125
1151
|
export type ChildOutcomeRecordedRecord = z.infer<typeof ChildOutcomeRecordedRecordSchema>
|
|
1126
1152
|
export type OutcomeProgressWrittenRecord = z.infer<typeof OutcomeProgressWrittenRecordSchema>
|
|
1153
|
+
export type SkillHooksAttachedRecord = z.infer<typeof SkillHooksAttachedRecordSchema>
|
|
1127
1154
|
|
|
1128
1155
|
export type SessionRecordOnly =
|
|
1129
1156
|
| SessionStartedRecord
|
|
@@ -1145,6 +1172,7 @@ export type SessionRecordOnly =
|
|
|
1145
1172
|
| TurnOutcomeRecordedRecord
|
|
1146
1173
|
| ChildOutcomeRecordedRecord
|
|
1147
1174
|
| OutcomeProgressWrittenRecord
|
|
1175
|
+
| SkillHooksAttachedRecord
|
|
1148
1176
|
|
|
1149
1177
|
/** One line of a session log. */
|
|
1150
1178
|
export type SessionRecord = SessionEventRecord | SessionRecordOnly
|
package/src/types/tool/index.ts
CHANGED
|
@@ -136,6 +136,18 @@ export interface SkillRegistryRef {
|
|
|
136
136
|
): SkillHooksPlan
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
+
/** What a conversation keeps of a skill whose hooks were attached to it; see {@link ToolContext.recordSkillHooks}. */
|
|
140
|
+
export interface SkillHooksRecordFact {
|
|
141
|
+
/** The skill's name. */
|
|
142
|
+
readonly skill: string
|
|
143
|
+
/** The skill's own folder. */
|
|
144
|
+
readonly directory: string
|
|
145
|
+
/** The skill's `allowed-tools` were left unapproved (a hook that guards its work could not be loaded). */
|
|
146
|
+
readonly grantsWithheld: boolean
|
|
147
|
+
/** The `skill` call that loaded it. */
|
|
148
|
+
readonly toolCallId?: string
|
|
149
|
+
}
|
|
150
|
+
|
|
139
151
|
/** What the `skill` tool tells a host's hook reader about the use it is making of a skill. */
|
|
140
152
|
export interface SkillHooksOptions {
|
|
141
153
|
/** The skill runs in a delegated agent: its hooks belong to that agent's run only. */
|
|
@@ -158,6 +170,14 @@ export interface SkillHooksPlan {
|
|
|
158
170
|
* guards its work could not be loaded, or hooks cannot be attached here.
|
|
159
171
|
*/
|
|
160
172
|
readonly withholdGrants: boolean
|
|
173
|
+
/**
|
|
174
|
+
* The hooks (or the refusal) belong to the conversation and should come
|
|
175
|
+
* back when it is continued: the `skill` tool keeps a record of the use
|
|
176
|
+
* ({@link ToolContext.recordSkillHooks}) once the instructions were
|
|
177
|
+
* delivered. Absent or false: nothing is kept (a forked skill, whose hooks
|
|
178
|
+
* belong to one run; a skill whose hooks are switched off).
|
|
179
|
+
*/
|
|
180
|
+
readonly resumable?: boolean
|
|
161
181
|
/** Make the hooks live. Idempotent for a skill already attached to the conversation. */
|
|
162
182
|
attach(): SkillHooksHandle
|
|
163
183
|
}
|
|
@@ -865,6 +885,17 @@ export interface ToolContext {
|
|
|
865
885
|
readonly commit: () => void
|
|
866
886
|
}
|
|
867
887
|
|
|
888
|
+
/**
|
|
889
|
+
* Keep, in the conversation's own record, that a skill's hooks were attached
|
|
890
|
+
* (or refused) for it, so a host that continues the conversation later can
|
|
891
|
+
* attach them again. Called by the `skill` tool once the instructions were
|
|
892
|
+
* delivered, only for a skill the host's {@link SkillHooksPlan.resumable}
|
|
893
|
+
* names. Resolves `true` when the record was written; `false` (it does not
|
|
894
|
+
* throw) when it could not be, and the tool then says so in its result.
|
|
895
|
+
* Absent outside a turn that has a session log.
|
|
896
|
+
*/
|
|
897
|
+
recordSkillHooks?: (fact: SkillHooksRecordFact) => Promise<boolean>
|
|
898
|
+
|
|
868
899
|
/**
|
|
869
900
|
* Effective model-visible character cap for this tool result.
|
|
870
901
|
*
|